Tutorials › Statistical Theory I - Probability and Distribution Theory › Expectation Existence and Calculation Workshop

Expectation and LOTUS · Tutorial 322 of 994

Expectation Existence and Calculation Workshop

Learn to check absolute integrability before calculating expectations, and apply the appropriate sum or integral to discrete, continuous, and mixed laws.

Intermediate 10 min read

What You'll Learn

  • Distinguish finite, extended, and undefined expectations using positive and negative parts.
  • Check whether a discrete expectation is finite by examining its probability-weighted absolute values.
  • Check continuous expectations with an absolute-value density integral.
  • Combine atom contributions and density contributions for a mixed law.
  • Calculate event probabilities as expectations of indicators.
  • Recognize why a symmetric principal-value calculation does not establish an expectation.

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.

Definition: For a real-valued random variable \(Y\), define its positive and negative parts by \(Y^+=\max(Y,0)\) and \(Y^-=\max(-Y,0)\). Then \(Y=Y^+-Y^-\) and \(|Y|=Y^++Y^-\). If \(E[Y^+]\) and \(E[Y^-]\) are both finite, \(E[Y]=E[Y^+]-E[Y^-]\) is a finite expectation. If exactly one is infinite, the expectation is defined as \(+\infty\) or \(-\infty\), respectively. If both are infinite, \(E[Y]\) is undefined. A finite expectation exists exactly when \(E[|Y|]<\infty\).

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.

Result: Let \(g\) be a measurable real-valued function. For a discrete \(X\), \(E[|g(X)|]=\sum_i |g(x_i)|p_i\). For a random variable with density \(f\), \(E[|g(X)|]=\int_{\mathbb R}|g(x)|f(x)\,dx\). If the relevant quantity is finite, then \(E[g(X)]=\sum_i g(x_i)p_i\) or \(E[g(X)]=\int_{\mathbb R}g(x)f(x)\,dx\), respectively. These formulas also define an extended expectation when \(g(X)\) is nonnegative.

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.

Result: For a law with atoms \(a_j\) of probabilities \(q_j\) and a density component \(h\), \(E[|g(X)|]=\sum_j q_j|g(a_j)|+\int_{\mathbb R}|g(x)|h(x)\,dx\). The finite-expectation condition is that this total is finite. When it is finite, \(E[g(X)]=\sum_j q_jg(a_j)+\int_{\mathbb R}g(x)h(x)\,dx\).

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.

Theorem: For a real-valued random variable \(Y\), \(E[Y]\) is finite if and only if \(E[|Y|]<\infty\).

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.

Result: For any event \(A\), \(E[\mathbf{1}_A]=P(A)\).

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\)

1
Identify the quantity.
Decide whether the target is \(X\), a transformation \(g(X)\), or an indicator. The existence check must apply to that target.
2
Choose the law representation.
Use probability weights for a discrete law, a density integral for a density law, or both contributions for a mixed law.
3
Check absolute integrability.
Calculate or bound the weighted sum or integral of the absolute value before subtracting signed contributions.
4
State the correct conclusion.
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.
Key takeaway: Calculate an expectation only after checking the absolute-value sum or integral. For mixed laws, include every atom and the density component; for signed laws, never replace an undefined expectation with a cancellation based on symmetry.

Check Your Understanding

For each question, distinguish the existence check from the final calculation.

  1. For a discrete nonnegative \(X\) with \(P(X=k)=1/[k(k+1)]\), \(k\geq1\), does \(E[X]\) exist as a finite value?
  2. What condition must be checked before using \(\int g(x)f(x)\,dx\) as a finite expectation?
  3. Why does a symmetric distribution with infinite positive and negative parts not necessarily have expectation zero?
  4. A law has an atom and a density component. Which contributions must be included in \(E[|g(X)|]\)?
  5. Explain why \(E[\mathbf{1}_A]\) is finite for every event \(A\), and state its value.