Key idea of this section
E X = ∫Ω X dP = ∫ℝ x μX(dx), defined for X ≥ 0 as a supremum over simple functions, and justified in the limit by the monotone and dominated convergence theorems.
Construction in three steps
A simple random variable takes finitely many values: X = ∑ᵢ aᵢ 1Aᵢ with Aᵢ ∈ 𝓕. Its expectation is E X = ∑ᵢ aᵢ P(Aᵢ), which is well defined (independent of the representation), linear and monotone. For X ≥ 0 we set
E X = sup { E S : S simple, 0 ≤ S ≤ X } ∈ [0, ∞]
A concrete approximating sequence is Sₙ = min(n, 2⁻ⁿ⌊2ⁿX⌋), which is simple and increases to X pointwise. Finally, for general X write X = X⁺ − X⁻ with X⁺ = max(X, 0) and X⁻ = max(−X, 0); if E|X| = E X⁺ + E X⁻ < ∞ we say X is integrable, write X ∈ L¹, and set E X = E X⁺ − E X⁻. Expectation is then linear and monotone on L¹, and |E X| ≤ E|X|.
The three convergence theorems
The whole point of the Lebesgue integral is that it interacts well with limits. Here are the three results used constantly in probability.
Theorem 4.1 (monotone convergence). If 0 ≤ X₁ ≤ X₂ ≤ ⋯ and Xₙ ↑ X almost surely, then E Xₙ ↑ E X.
Theorem 4.2 (Fatou's lemma). If Xₙ ≥ 0, then E(lim inf Xₙ) ≤ lim inf E Xₙ.
Theorem 4.3 (dominated convergence). If Xₙ → X almost surely and |Xₙ| ≤ Y with E Y < ∞, then E|Xₙ − X| → 0, and in particular E Xₙ → E X.
Proof of 4.2 from 4.1. Let Yₘ = infn≥m Xₙ. Then Yₘ ↑ lim inf Xₙ, and Yₘ ≤ Xₙ for every n ≥ m, so E Yₘ ≤ infn≥m E Xₙ. Letting m → ∞ and applying monotone convergence on the left gives the result. ∎
Proof of 4.3 from 4.2. Apply Fatou to the nonnegative variables 2Y − |Xₙ − X|. Since lim inf of these is 2Y, we get 2E Y ≤ 2E Y − lim sup E|Xₙ − X|, so lim sup E|Xₙ − X| ≤ 0. ∎
Without domination the conclusion can fail: on (0, 1) with Lebesgue measure, Xₙ = n · 1(0, 1/n) tends to 0 at every point, yet E Xₙ = 1 for all n. Applying monotone convergence to partial sums gives the important corollary E ∑ₙ Xₙ = ∑ₙ E Xₙ for nonnegative Xₙ, which is how expectations of infinite sums are computed.
The law of the unconscious statistician
Theorem 4.4. If g is Borel and g(X) is integrable or nonnegative, then E g(X) = ∫ℝ g(x) μX(dx). In the discrete case this is ∑ₓ g(x) P(X = x), and with a density it is ∫ g(x) f(x) dx.
Proof. For g = 1B both sides equal P(X ∈ B). Linearity gives simple g; monotone convergence gives nonnegative g; and the decomposition g = g⁺ − g⁻ gives integrable g. ∎
This "standard machine" (indicators, then simple functions, then limits, then differences) proves most identities about integrals. Another product of it is Fubini's theorem for nonnegative functions, from which follows a formula used repeatedly.
Theorem 4.5 (tail formula). If X ≥ 0, then E X = ∫₀∞ P(X > t) dt. If N takes values in {0, 1, 2, …}, then E N = ∑k≥1 P(N ≥ k).
Proof. X = ∫₀∞ 1{t < X} dt pointwise. Take expectations and exchange E with ∫ by Tonelli's theorem, which is permitted for nonnegative integrands. The discrete version is the same argument with a sum. ∎
For a Geometric(p) variable, P(N ≥ k) = (1 − p)ᵏ⁻¹, so E N = ∑k≥1 (1 − p)ᵏ⁻¹ = 1/p, with no differentiation of series required.
Variance, covariance and indicators
For X ∈ L², define Var X = E(X − E X)² = E X² − (E X)² and Cov(X, Y) = E[(X − E X)(Y − E Y)]. Bilinearity gives
Var(X₁ + ⋯ + Xₙ) = ∑ᵢ Var Xᵢ + 2 ∑i<j Cov(Xᵢ, Xⱼ)
If X and Y are independent and integrable, then E XY = E X · E Y (prove it for indicators, then use the standard machine), so Cov(X, Y) = 0 and variances of independent summands add. The converse is false: if X is uniform on {−1, 0, 1} and Y = X², then Cov(X, Y) = E X³ − E X · E X² = 0, yet Y is a function of X. The correlation coefficient ρ = Cov(X, Y)/√(Var X · Var Y) lies in [−1, 1] by the Cauchy–Schwarz inequality, with |ρ| = 1 exactly when Y is almost surely an affine function of X.
The method of indicators exploits linearity of expectation, which needs no independence. Write a count as a sum of indicators N = ∑ᵢ 1Aᵢ; then E N = ∑ᵢ P(Aᵢ) and Var N = ∑ᵢ P(Aᵢ)(1 − P(Aᵢ)) + 2∑i<j [P(Aᵢ ∩ Aⱼ) − P(Aᵢ)P(Aⱼ)].
Worked example 4.6 (fixed points). Let N be the number of fixed points of a uniformly random permutation of {1, …, n}, and Aᵢ = {i is fixed}. Then P(Aᵢ) = 1/n and P(Aᵢ ∩ Aⱼ) = 1/(n(n − 1)) for i ≠ j. Hence E N = 1 for every n, and
Var N = n · (1/n)(1 − 1/n) + 2 · C(n, 2) · [1/(n(n − 1)) − 1/n²] = (1 − 1/n) + 1/n = 1
for every n ≥ 2. The exact law is P(N = 0) = ∑k=0n (−1)ᵏ/k! → e−1 by inclusion–exclusion, and in fact N converges in distribution to Poisson(1).
Worked example 4.7 (coupon collector). A collector receives independent uniformly random coupons from n types. After k distinct types have been seen, the waiting time for a new one is Geometric((n − k)/n), with mean n/(n − k). Summing over k = 0, …, n − 1, the expected time to complete the collection is
E T = n (1 + 1/2 + ⋯ + 1/n) = n Hₙ ∼ n log n
For n = 6 (the faces of a die), E T = 6 · 49/20 = 14.7 rolls.
Exercise
- (a)Use the tail formula to compute E X for X ~ Exponential(λ).
- (b)Let X ~ Binomial(n, p). Write X as a sum of indicators and derive Var X = np(1 − p).
- (c)A random permutation of {1, …, 10} is chosen. What is the expected number of indices i ≤ 9 with σ(i + 1) = σ(i) + 1?
Show solution
Answers: (a) E X = ∫₀∞ e−λt dt = 1/λ. (b) X = ∑ 1Aᵢ with independent Aᵢ of probability p; covariances vanish, so Var X = ∑ p(1 − p) = np(1 − p). (c) For each i, the pair (σ(i), σ(i + 1)) is uniform over the 90 ordered pairs of distinct values, of which 9 have the form (v, v + 1); so each indicator has probability 1/10 and the expectation is 9/10.