Why Existence Comes Before Calculation
A sum or integral that looks plausible is not automatically an expectation. Before calculating \(E[g(X)]\), check whether the positive and negative contributions are both controlled. If they are not, an expression such as “positive infinity minus positive infinity” has no defined value, even when a symmetric rearrangement appears to cancel.
For a real-valued random variable \(Y\), the central check is absolute integrability: whether \(E[|Y|]\) is finite. Taking \(Y=g(X)\) makes this a check on the quantity whose expectation is sought, not necessarily on \(X\) itself. The same principle applies whether the distribution is discrete, continuous, or a combination of the two.
An expectation equal to \(+\infty\) is an extended expectation, not a finite mean. In many statistical applications, the relevant requirement is a finite expectation, so the absolute-integrability condition must be checked. For a function of a random variable, the corresponding condition is \(E[|g(X)|]<\infty\).
Checking and Calculating by Distribution Type
For a discrete random variable with possible values \(x_i\) and probabilities \(p_i=P(X=x_i)\), the absolute-integrability check and the expectation calculation use the same weights. For a random variable with density \(f\), they use integrals against that density. LOTUS permits calculation from the distribution of \(X\) without first finding the distribution of \(g(X)\); here, its sum or integral must still be checked for existence.
For discrete distributions, the sum is over all possible values, including infinitely many when the support is infinite. A finite number of large terms cannot determine convergence: the entire weighted series matters. For density distributions, the integral covers the full support, and the absolute value belongs inside the integrand for the existence check.
Worked Example: A Finite Expectation on Infinite Support
Let \(X\) take the positive integer values \(k=1,2,\ldots\), with \(P(X=k)=2^{-k}\). First verify that these are probabilities: \(\sum_{k=1}^{\infty}2^{-k}=1\). Since \(X\geq 0\), its absolute expectation is \(E[|X|]=\sum_{k=1}^{\infty}k2^{-k}\).
Write \(k\) as a sum of \(k\) ones and rearrange the nonnegative terms: \(\sum_{k=1}^{\infty}k2^{-k}=\sum_{j=1}^{\infty}\sum_{k=j}^{\infty}2^{-k}\). The inner geometric series equals \(2^{1-j}\). Therefore \(\sum_{j=1}^{\infty}2^{1-j}=2\), so \(E[|X|]=2<\infty\) and \(E[X]=2\). This example illustrates why an infinite support does not itself prevent a finite expectation; the weighted terms must be summed.
Worked Example: A Discrete Expectation That Is Undefined
Define a signed integer-valued \(X\) by \(P(X=n)=P(X=-n)=1/[2n(n+1)]\) for every integer \(n\geq1\). The total probability is \(\sum_{n=1}^{\infty}1/[n(n+1)]=1\), since \(1/[n(n+1)]=1/n-1/(n+1)\).
For the positive part, \(E[X^+]=\sum_{n=1}^{\infty}n/[2n(n+1)]=\frac12\sum_{n=1}^{\infty}1/(n+1)=\infty\). The negative part has the same expectation: \(E[X^-]=\infty\). Thus \(E[|X|]=\infty\) and the definition would require subtracting two infinite quantities. The expectation is undefined, not zero. Symmetry of the probabilities does not make this expectation exist.
For a density \(f\), the expectation formula is a Lebesgue integral against the probability law; in the familiar density notation this is \(\int g(x)f(x)\,dx\). Absolute integrability requires \(\int |g(x)|f(x)\,dx<\infty\). A finite value obtained by cancelling positive and negative areas in an improper integral is not, by itself, evidence of this condition.
Worked Example: A Symmetric Density With No Expectation
Let \(X\) have the standard Cauchy density \(f(x)=1/[\pi(1+x^2)]\), for \(-\infty<x<\infty\). Check the absolute expectation: \(E[|X|]=\frac{1}{\pi}\int_{-\infty}^{\infty}|x|/(1+x^2)\,dx =\frac{2}{\pi}\int_0^\infty x/(1+x^2)\,dx\).
For \(b>0\), the truncated integral is \(\int_0^b x/(1+x^2)\,dx=\frac12\log(1+b^2)\), which tends to infinity as \(b\) tends to infinity. Hence \(E[|X|]=\infty\). Symmetry gives equal infinite positive and negative parts, so \(E[X]\) is undefined. In contrast, the symmetric principal-value integral over \([-b,b]\) is zero for every \(b\). That cancellation does not turn the undefined expectation into zero.
Expectations Under a Mixed Law
A mixed law can have point masses as well as a density. Suppose its atoms are at values \(a_j\), with probabilities \(q_j\), and its remaining probability is described by a density \(h\). Thus \(\sum_j q_j+\int_{\mathbb R}h(x)\,dx=1\). For any measurable \(g\), atom contributions are weighted by their probabilities, while the continuous contribution is integrated against \(h\). Checking both contributions is essential: finiteness of one does not guarantee finiteness of the other.
These formulas follow by writing the law of \(X\) as the sum of its discrete and density components. Integration of a nonnegative function against that law adds its integral over each component. Applying this first to \(|g|\) gives the existence check; when that integral is finite, applying it to the positive and negative parts of \(g\) gives the signed formula.
Worked Example: Calculating a Mixed Expectation and an Indicator
Suppose \(X=-1\) with probability \(0.3\); with the remaining probability \(0.7\), \(X\) has a uniform density on \([0,2]\). The density component is \(h(x)=0.7/2=0.35\) on that interval. Calculate \(E[X]\), \(E[X^2]\), and \(P(X>1)\).
The absolute expectation of \(X\) is finite because both its atom and its bounded density component have bounded values. Its mean is \(E[X]=0.3(-1)+0.35\int_0^2 x\,dx=-0.3+0.35(2)=0.4\).
For the second moment, \(E[X^2]=0.3(-1)^2+0.35\int_0^2 x^2\,dx =0.3+0.35(8/3)=0.3+14/15=37/30\).
Finally, \(P(X>1)=E[\mathbf{1}_{\{X>1\}}]\). The atom at \(-1\) contributes zero, and the density component contributes \(0.35\int_1^2 1\,dx=0.35\). Therefore \(P(X>1)=0.35\).
Two Useful Checks, Fully Justified
The following existence criterion explains why absolute values appear before calculating a signed expectation. It applies to discrete, continuous, and mixed laws because it concerns the random variable itself, not a particular representation of its distribution.
Proof. By definition, \(Y^+=\max(Y,0)\) and \(Y^-=\max(-Y,0)\) are nonnegative, and \(|Y|=Y^++Y^-\). If \(E[|Y|]<\infty\), then both \(E[Y^+]\) and \(E[Y^-]\) are at most \(E[|Y|]\), so both are finite. Their difference defines a finite expectation. Conversely, if \(E[Y]\) is finite, both positive-part expectations are finite by the definition of expectation; adding them gives \(E[|Y|]=E[Y^+]+E[Y^-]<\infty\). \(\square\)
Indicators provide an especially useful case of LOTUS. For an event \(A\), \(\mathbf{1}_A\) equals 1 on \(A\) and 0 elsewhere, so it is bounded and automatically integrable.
Proof. The indicator is a discrete-valued function with value 1 on \(A\) and 0 on its complement. Its expectation is therefore \(1\cdot P(A)+0\cdot P(A^c)=P(A)\). Equivalently, integrating its value over the probability law contributes exactly the probability assigned to \(A\). Since \(0\leq\mathbf{1}_A\leq1\), its absolute expectation is finite. \(\square\)
Decide whether the target is \(X\), a transformation \(g(X)\), or an indicator. The existence check must apply to that target.
Use probability weights for a discrete law, a density integral for a density law, or both contributions for a mixed law.
Calculate or bound the weighted sum or integral of the absolute value before subtracting signed contributions.
Report a finite value, a defined infinite expectation, or an undefined expectation according to the positive and negative parts.
Common Mistakes and Why the Check Matters
- Assuming symmetry guarantees a mean of zero. Symmetry can make positive and negative contributions match, but if each is infinite, their difference is undefined. The Cauchy example shows why a principal value is not an expectation.
- Checking \(E[X]\) when the target is \(g(X)\). The relevant condition is \(E[|g(X)|]<\infty\). A transformation can change integrability, so check the quantity actually being averaged.
- Using only the density part of a mixed law. Atoms also contribute. Omitting even one atom can change the answer or miss a source of divergence.
- Treating a nonnegative infinite expectation as undefined. If \(Y\geq0\), its expectation is well-defined as a value in \([0,\infty]\). Undefinedness arises when both positive and negative parts have infinite expectations.
Check Your Understanding
For each question, distinguish the existence check from the final calculation.
- For a discrete nonnegative \(X\) with \(P(X=k)=1/[k(k+1)]\), \(k\geq1\), does \(E[X]\) exist as a finite value?
- What condition must be checked before using \(\int g(x)f(x)\,dx\) as a finite expectation?
- Why does a symmetric distribution with infinite positive and negative parts not necessarily have expectation zero?
- A law has an atom and a density component. Which contributions must be included in \(E[|g(X)|]\)?
- Explain why \(E[\mathbf{1}_A]\) is finite for every event \(A\), and state its value.