Introduction
Some functions of a random variable are difficult to handle by integrating or summing over every possible value separately, but are simple on carefully chosen regions. An indicator of a threshold event is either zero or one; the floor and ceiling functions are constant on intervals between consecutive integers. The useful idea is to partition the support into those regions and apply LOTUS to the value of the function on each one.
The main care is at the boundaries. A strict threshold \(X>t\) excludes an atom at \(t\), while \(X\ge t\) includes it. Likewise, floor and ceiling use different half-open intervals, so a point mass at an integer must be assigned to the correct interval.
Threshold Indicators
An indicator is bounded, so its expectation always exists. Since its only possible values are zero and one, its expectation is the probability of the event it indicates.
To verify the first identity directly, split the sample space into the event \(\{X>t\}\) and its complement. The indicator equals one on the first event and zero on the second, so its expectation is \(1\cdot P(X>t)+0\cdot P(X\le t)=P(X>t)\). Replacing \(>\) by \(\ge\) gives the second identity by the same argument.
The distinction between the two probabilities is exactly the mass at the threshold: \(P(X\ge t)=P(X>t)+P(X=t)\). If \(X\) has a density, then \(P(X=t)=0\), so the two agree. For a discrete or mixed distribution, they need not agree.
Worked Example: A Strict Threshold for a Discrete Variable
Suppose \(X\) takes the values \(-2,0,1,4\) with probabilities \(0.1,0.2,0.3,0.4\), respectively. Find \(E[I(X>0)]\) and \(E[I(X\ge0)]\).
For \(X>0\), the qualifying values are 1 and 4. Therefore, \(P(X>0)=0.3+0.4=0.7\), and the indicator identity gives \(E[I(X>0)]=0.7\).
For \(X\ge0\), the qualifying values are 0, 1, and 4. Thus, \(P(X\ge0)=0.2+0.3+0.4=0.9\), so \(E[I(X\ge0)]=0.9\).
The difference is \(0.9-0.7=0.2=P(X=0)\). The atom at the threshold is excluded by \(>\) and included by \(\ge\).
Partition Formulas for Floor and Ceiling
For a real number \(x\), \(\lfloor x\rfloor\) is the greatest integer less than or equal to \(x\), and \(\lceil x\rceil\) is the least integer greater than or equal to \(x\). The intervals on which these functions are constant are not the same: \(\lfloor x\rfloor=k\) on \([k,k+1)\), whereas \(\lceil x\rceil=k\) on \((k-1,k]\).
Proof. The events \(A_k=\{k\le X<k+1\}\), for integers \(k\), are disjoint and cover all possible real values of \(X\). On \(A_k\), \(\lfloor X\rfloor=k\). Consequently, \(E[|\lfloor X\rfloor|]=\sum_{k\in\mathbb Z}|k|P(A_k)<\infty\). This establishes absolute convergence of the signed series \(\sum_k kP(A_k)\). Applying LOTUS to the function \(x\mapsto\lfloor x\rfloor\), or summing its constant value over this countable partition, gives \(E[\lfloor X\rfloor]=\sum_{k\in\mathbb Z}kP(A_k)\).
For the ceiling formula, the events \(B_k=\{k-1<X\le k\}\), \(k\in\mathbb Z\), are disjoint and cover the real line, and \(\lceil X\rceil=k\) on \(B_k\). Thus \(E[|\lceil X\rceil|]=\sum_{k\in\mathbb Z}|k|P(B_k)<\infty\). The series for the signed expectation is absolutely convergent, and LOTUS on this partition yields \(E[\lceil X\rceil]=\sum_{k\in\mathbb Z}kP(B_k)\). \(\square\)
These formulas do not require \(X\) to have a density. The probabilities of the intervals can be obtained from a probability mass function, a density, or both. The stated integrability conditions are enough for the formulas; a convenient sufficient condition for each is \(E[|X|]<\infty\), because \(|\lfloor x\rfloor|\le |x|+1\) and \(|\lceil x\rceil|\le |x|+1\).
If \(X\) is bounded, only finitely many intervals can have positive probability, so the formulas reduce to finite sums. For an unbounded \(X\), the sums may have infinitely many nonzero terms; their convergence should not be assumed without checking an integrability condition.
Worked Example: Rounding a Continuous Uniform Variable
Let \(X\sim\operatorname{Uniform}(0,2.5)\), with density \(f(x)=0.4\) for \(0<x<2.5\) and zero elsewhere. Find \(E[\lfloor X\rfloor]\) and \(E[\lceil X\rceil]\).
For the floor, the relevant intervals and their probabilities are \(P(0\le X<1)=0.4\), \(P(1\le X<2)=0.4\), and \(P(2\le X<3)=0.2\). The floor takes values 0, 1, and 2 on these intervals, respectively. Hence \(E[\lfloor X\rfloor]=0(0.4)+1(0.4)+2(0.2)=0.8\).
For the ceiling, the intervals are \((0,1]\), \((1,2]\), and \((2,3]\), with probabilities \(0.4,0.4,0.2\). The ceiling values are 1, 2, and 3, so \(E[\lceil X\rceil]=1(0.4)+2(0.4)+3(0.2)=0.4+0.8+0.6=1.8\).
The endpoints have probability zero under this continuous distribution, so their inclusion in one interval or another does not affect these calculations. With atoms at integer endpoints, the interval conventions would matter.
Handling Atoms at Integer Boundaries
The half-open intervals in the theorem assign every integer to exactly one region for each function. In particular, if \(X=k\) exactly, then \(\lfloor X\rfloor=k\) and \(\lceil X\rceil=k\). The floor partition assigns that point to \([k,k+1)\); the ceiling partition assigns it to \((k-1,k]\). Changing either endpoint convention without adjusting the function value can misallocate an atom.
Worked Example: Floor and Ceiling for a Mixed Distribution
Suppose \(X\) has probability \(1/4\) at \(-1\), probability \(1/4\) at \(1\), and probability \(1/2\) from a continuous \(\operatorname{Uniform}(0,2)\) component. Find \(E[I(X>1)]\), \(E[\lfloor X\rfloor]\), and \(E[\lceil X\rceil]\).
The atom at 1 does not satisfy \(X>1\). In the uniform component, half the probability lies above 1, and that component has mixture weight \(1/2\). Therefore \(P(X>1)=(1/2)(1/2)=1/4\), so \(E[I(X>1)]=1/4\). In contrast, \(P(X\ge1)=1/4+(1/2)(1/2)=1/2\), because the atom at 1 is included.
For the floor, the atom at \(-1\) contributes \((-1)(1/4)=-1/4\), and the atom at 1 contributes \(1(1/4)=1/4\). In the uniform component, \(\lfloor X\rfloor=0\) on \([0,1)\) and \(1\) on \([1,2)\), each with conditional probability \(1/2\). Its conditional mean floor is \(0(1/2)+1(1/2)=1/2\), contributing \((1/2)(1/2)=1/4\) after applying the mixture weight. Thus \(E[\lfloor X\rfloor]=-1/4+1/4+1/4=1/4\).
For the ceiling, the two atoms contribute \((-1)(1/4)\) and \(1(1/4)\), which cancel. In the uniform component, the ceiling is 1 on \((0,1]\) and 2 on \((1,2]\), apart from endpoints of probability zero. Its conditional mean is \(1(1/2)+2(1/2)=3/2\), contributing \((1/2)(3/2)=3/4\). Therefore \(E[\lceil X\rceil]=3/4\).
Common Mistakes and Why These Calculations Matter
Threshold and rounding functions turn a distribution into interpretable summaries. Threshold indicators give the probability of crossing a specified cutoff; floor and ceiling expectations describe the average integer category below or above each value. The partition method makes the calculation transparent even when the distribution has both continuous and discrete parts.
- Replacing \(>\) with \(\ge\) without checking for an atom. These probabilities differ by \(P(X=t)\). They are interchangeable only when that probability is zero.
- Using the same intervals for floor and ceiling. Floor equals \(k\) on \([k,k+1)\); ceiling equals \(k\) on \((k-1,k]\). The endpoint placement is part of the definition.
- Ignoring negative values. If \(X\) can be negative, the integer index \(k\) must range over all of \(\mathbb Z\), not only the nonnegative integers.
- Assuming a signed infinite sum is valid without an existence check. For the stated formulas, verify \(E[|\lfloor X\rfloor|]<\infty\) or \(E[|\lceil X\rceil|]<\infty\). Bounded \(X\) guarantees both.
A reliable calculation has three steps: identify the intervals where the function is constant, find the probability of each interval using the full distribution, and multiply each probability by the function value there. This keeps the function, the event boundaries, and the distribution calculation separate.
Check Your Understanding
Work through these questions by identifying the relevant events or intervals before calculating.
- For any \(X\), express \(E[I(X\le t)]\) as a probability. How does it differ from \(E[I(X<t)]\) if \(P(X=t)>0\)?
- State the interval on which \(\lfloor x\rfloor=3\), and the interval on which \(\lceil x\rceil=3\).
- If \(X\) is integer-valued and \(P(X=2)=0.4\), which rounding functions equal 2 when \(X=2\)?
- For a continuous distribution, why do endpoint conventions at integer boundaries usually not change floor and ceiling expectations? State the condition needed at those boundaries.
- What integrability condition justifies the floor expectation series when \(X\) has unbounded support?