Expectations as Areas Under Tails
A nonnegative random variable can be described either by the values it takes or by the probabilities that it exceeds each threshold. The tail description is especially useful when the distribution is given by a survival function, or when the variable is integer-valued and its tail probabilities are simple. The formulas below turn those tails into expectations; they also allow the value \(+\infty\).
Throughout, \((\Omega,\mathcal{F},\mathbb{P})\) is a probability space, so \(\mathbb{P}(\Omega)=1\). A nonnegative random variable \(X\) means an \(\mathcal{F}\)-measurable function \(X:\Omega\to[0,\infty]\). Its expectation is the nonnegative Lebesgue integral \(\mathbb{E}[X]=\int_\Omega X\,d\mathbb{P}\), which may be infinite. The formulas also apply when \(X\) is finite almost surely, the usual real-valued case. We write \(\mathbb{P}(X>t)\) for \(\mathbb{P}(\{\omega:X(\omega)>t\})\).
The Layer-Cake Formula
Proof. For each \(\omega\in\Omega\), the indicator of the interval of thresholds below \(X(\omega)\) satisfies $$ X(\omega)=\int_0^\infty \chi_{\{t:X(\omega)>t\}}(t)\,dt. $$ Indeed, if \(X(\omega)=a<\infty\), the set of such thresholds is \([0,a)\), of Lebesgue measure \(a\); if \(X(\omega)=+\infty\), it is all of \([0,\infty)\), of infinite measure. The function \((\omega,t)\mapsto\chi_{\{t<X(\omega)\}}\) is measurable on \(\mathcal{F}\otimes\mathcal{B}_{[0,\infty)}\): its set of value \(1\) is the countable union of \(\{X>q\}\times[0,q)\) over positive rational \(q\). The probability measure \(\mathbb{P}\) and Lebesgue measure are both sigma-finite. Tonelli’s theorem for nonnegative measurable functions on a product of sigma-finite measure spaces therefore applies, giving $$ \int_\Omega\int_0^\infty \chi_{\{t<X(\omega)\}}\,dt\,d\mathbb{P}(\omega) =\int_0^\infty\int_\Omega \chi_{\{X(\omega)>t\}}\,d\mathbb{P}(\omega)\,dt =\int_0^\infty\mathbb{P}(X>t)\,dt. $$ The left side is \(\mathbb{E}[X]\) by the pointwise identity. This proves the formula, including when either side is infinite. \(\square\)
The strict inequality in \(\mathbb{P}(X>t)\) matches the pointwise interval \([0,X(\omega))\). Replacing it by \(\mathbb{P}(X\ge t)\) gives the same integral: for each fixed \(\omega\), the two threshold indicators differ at most at the single point \(t=X(\omega)\), which has Lebesgue measure zero. The strict version is convenient because it follows directly from the pointwise identity.
Worked Example: An Exponential Tail
Suppose \(X\) has the exponential distribution with rate \(2\), meaning it has density \(2e^{-2x}\) for \(x\ge0\) and density \(0\) for \(x<0\). For \(t\ge0\), its tail is $$ \mathbb{P}(X>t)=\int_t^\infty 2e^{-2x}\,dx =\left[-e^{-2x}\right]_{x=t}^{x=\infty} =e^{-2t}. $$ The layer-cake formula now gives $$ \mathbb{E}[X]=\int_0^\infty e^{-2t}\,dt =\left[-\frac12 e^{-2t}\right]_{t=0}^{t=\infty} =\frac12. $$ To check independently from the density, integration by parts yields $$ \int_0^\infty x\,2e^{-2x}\,dx =\left[-xe^{-2x}\right]_0^\infty+\int_0^\infty e^{-2x}\,dx =0+\frac12 =\frac12. $$ The boundary term at infinity is zero since \(xe^{-2x}\to0\), and the term at zero is zero since it contains the factor \(x\). Both calculations give the same finite expectation.
Worked Example: A Finite-Valued Variable and Its Tail
Let \(X\) take the values \(0,2,5\) with probabilities \(1/2,1/3,1/6\), respectively. These probabilities sum to \(1/2+1/3+1/6=1\). For \(0\le t<2\), the event \(X>t\) consists of the outcomes \(X=2\) and \(X=5\), so its probability is \(1/3+1/6=1/2\). For \(2\le t<5\), only the outcome \(X=5\) exceeds \(t\), so the probability is \(1/6\). For \(t\ge5\), no value exceeds \(t\). Thus $$ \mathbb{E}[X]=\int_0^2\frac12\,dt+\int_2^5\frac16\,dt =2\cdot\frac12+3\cdot\frac16 =1+\frac12 =\frac32. $$ The endpoint \(t=2\) belongs to the second interval because the event is \(X>t\), not \(X\ge t\). A single endpoint would not change the integral, but specifying it makes the event calculation exact. Directly from the distribution, $$ \mathbb{E}[X]=0\cdot\frac12+2\cdot\frac13+5\cdot\frac16 =0+\frac23+\frac56 =\frac46+\frac56 =\frac{9}{6} =\frac32. $$ The direct computation confirms the tail integral.
The Tail-Sum Formula
Proof. For each \(\omega\), if \(N(\omega)=n\) is a nonnegative integer, then exactly the first \(n\) indicators in the following sum equal \(1\): $$ N(\omega)=\sum_{k=1}^{\infty}\chi_{\{N(\omega)\ge k\}}. $$ If \(N(\omega)=+\infty\), every indicator equals \(1\) and both sides are infinite. The partial sums are nonnegative measurable functions increasing to \(N\). By the Monotone Convergence Theorem, $$ \mathbb{E}[N] =\lim_{r\to\infty}\mathbb{E}\left[\sum_{k=1}^{r}\chi_{\{N\ge k\}}\right] =\lim_{r\to\infty}\sum_{k=1}^{r}\mathbb{E}[\chi_{\{N\ge k\}}] =\sum_{k=1}^{\infty}\mathbb{P}(N\ge k). $$ The finite-sum equality follows from additivity of the integral, and \(\mathbb{E}[\chi_A]=\mathbb{P}(A)\) for each event \(A\). Since the terms of the series are nonnegative, its value is finite if and only if the expectation is finite. \(\square\)
Worked Example: A Geometric Tail
Let \(N\) have probabilities \(\mathbb{P}(N=n)=2^{-(n+1)}\) for \(n=0,1,2,\ldots\). They sum to \(1\), since \(\sum_{n=0}^\infty 2^{-(n+1)}=(1/2)/(1-1/2)=1\). For every integer \(k\ge1\), $$ \mathbb{P}(N\ge k)=\sum_{n=k}^\infty 2^{-(n+1)} =\frac{2^{-(k+1)}}{1-1/2} =2^{-k}. $$ Therefore the tail-sum formula gives $$ \mathbb{E}[N]=\sum_{k=1}^{\infty}2^{-k} =\frac{1/2}{1-1/2} =1. $$ For an independent check, the probability-law computation is $$ \sum_{n=0}^\infty n\,2^{-(n+1)} =\frac12\sum_{n=0}^\infty n\left(\frac12\right)^n =\frac12\cdot\frac{1/2}{(1-1/2)^2} =\frac12\cdot 2 =1. $$ Here the power-series identity \(\sum_{n=0}^\infty nr^n=r/(1-r)^2\) applies because \(|r|<1\), and \(r=1/2\). The direct sum agrees with the tail calculation.
Tail Formulas for Moments
The same argument expresses every positive moment of a nonnegative random variable through its tail. For \(p>0\), the pointwise identity $$ x^p=\int_0^\infty p\,t^{p-1}\chi_{\{t<x\}}\,dt,\qquad x\in[0,\infty], $$ follows by integrating \(p\,t^{p-1}\) from \(0\) to \(x\). Applying Tonelli’s theorem to this nonnegative measurable integrand gives the following result.
Proof. The integrand \(p\,t^{p-1}\chi_{\{t<X(\omega)\}}\) is nonnegative and measurable on the product space. The two measure spaces are sigma-finite, so Tonelli’s theorem permits the order of integration to be exchanged. Integrating first over \(t\) gives \(X(\omega)^p\), including the value \(+\infty\); integrating first over \(\omega\) gives \(p\,t^{p-1}\mathbb{P}(X>t)\). Integrating these equal quantities proves the formula. \(\square\)
Worked Example: A Second Moment from an Exponential Tail
For the rate-\(2\) exponential variable above, use the moment formula with \(p=2\). The tail is \(e^{-2t}\), so $$ \mathbb{E}[X^2]=\int_0^\infty 2t\,e^{-2t}\,dt. $$ Integration by parts, with \(u=t\) and \(dv=2e^{-2t}\,dt\), gives $$ \int_0^\infty 2t\,e^{-2t}\,dt =\left[-te^{-2t}\right]_0^\infty+\int_0^\infty e^{-2t}\,dt =0+\frac12 =\frac12. $$ As a check from the density, $$ \int_0^\infty x^2\,2e^{-2x}\,dx =\left[-x^2e^{-2x}\right]_0^\infty+\int_0^\infty 2x e^{-2x}\,dx =0+\frac12 =\frac12. $$ The boundary term vanishes because \(x^2e^{-2x}\to0\); the remaining integral is the mean already computed. Thus both methods give the same second moment.
A Common Indexing Error
Pitfall: shifting the tail-sum index. For the geometric variable above, a mistaken calculation might write $$ \mathbb{E}[N]\overset{\text{wrong}}{=}\sum_{k=1}^{\infty}\mathbb{P}(N>k) =\sum_{k=1}^{\infty}\mathbb{P}(N\ge k+1) =\sum_{k=1}^{\infty}2^{-(k+1)} =\frac12. $$ The error is the starting index: the formula for \(N\) includes the contribution of the threshold \(1\), namely \(\mathbb{P}(N\ge1)=1/2\). The corrected tail-sum is $$ \sum_{k=1}^{\infty}\mathbb{P}(N\ge k) =\sum_{k=1}^{\infty}2^{-k} =1. $$ A formula using the strict tail is also valid when it is indexed as \(\sum_{k=0}^{\infty}\mathbb{P}(N>k)\); the first term is then \(\mathbb{P}(N>0)=1/2\), not an omitted term. Checking the pointwise identity for a value such as \(N=1\) is a reliable way to detect this shift: exactly one indicator, \(\chi_{\{N\ge1\}}\), must contribute.
These formulas are useful whenever a tail is easier to calculate than the full probability law. They also give immediate finiteness criteria: a nonnegative expectation is finite precisely when its tail integral is finite, and a nonnegative integer-valued expectation is finite precisely when its tail-probability series converges. Neither formula requires the expectation to be finite in advance; nonnegativity and the stated measurability hypotheses are what justify the integrations and limits.
Check Your Understanding
In each problem, specify the tail event with its correct strict or non-strict inequality before calculating.
- If \(X\) has tail \(\mathbb{P}(X>t)=e^{-3t}\) for \(t\ge0\), compute \(\mathbb{E}[X]\) from the layer-cake formula.
- A random variable takes values \(1\) and \(4\) with probabilities \(3/4\) and \(1/4\). Write its tail on each threshold interval and compute its expectation from that tail.
- For a nonnegative integer-valued \(N\), derive the tail-sum formula from the pointwise expansion into indicators.
- If \(\mathbb{P}(N\ge k)=3^{-k}\) for \(k\ge1\), compute \(\mathbb{E}[N]\) using a geometric series.
- State the tail formula for \(\mathbb{E}[X^p]\), including its assumptions, and explain which theorem justifies exchanging the order of integration.