Random variables organize probability computations around functions rather than events. On countable spaces the theory is powered by the summable families of Chapter 7: expectation is the sum of a family indexed by the sample space, and all its properties — linearity, transfer, product formula for independent variables — are theorems about summable families. The chapter proves the key inequalities of Markov, Chebyshev, Cauchy–Schwarz and Jensen, and ends with the classical laws and the weak law of large numbers, whose proof is two lines once Chebyshev is available.
BernoulliB(p): X∈{0,1}, P(X=1)=p. Indicator of an event.
BinomialB(n,p): P(X=k)=(kn)pk(1−p)n−k, 0≤k≤n: number of successes in nindependent Bernoulli trials (High School volume; re-proved below via sums of independent variables).
GeometricG(p): P(X=k)=(1−p)k−1p, k∈N∗: rank of the first success (Example 21.5).
PoissonP(λ): P(X=k)=e−λk!λk, k∈N — a probability measure by the exponential series. The law of rare events (Chapter 23).
Remark 22.3(Which law models what)
The four laws answer four primitive questions: Bernoulli, “did it happen?”; binomial, “how many times in n tries?”; geometric, “how long until the first time?”; Poisson, “how many events at a given rate, when tries are many and individually unlikely?”. Recognizing the question is nine tenths of the modelling: sums of indicators point to the binomial, waiting times to the geometric, rare-event counts to the Poisson — with the passage from binomial to Poisson made precise by the law of rare events in Chapter 23.
Proposition 22.4(Memorylessness of the geometric law)
If X∼G(p), then for all m,n∈N:
P(X>m+n∣X>m)=P(X>n),
and the geometric laws are the only laws on N∗ with this property.
Proof. Summing the geometric weights, P(X>n)=(1−p)n. Hence
Conversely, if G(n)=P(X>n) satisfies G(m+n)=G(m)G(n) with G(0)=1, then G(n)=G(1)n by induction; q=G(1)∈[0,1), and q=0 or the law is G(1−q): P(X=k)=G(k−1)−G(k)=qk−1(1−q). ∎
Example 22.5(No number is ever “due”)
Roll a die, waiting for a six: the waiting time is X∼G(1/6). Memorylessness says that after 10 fruitless rolls, the remaining wait X−10, given X>10, is again G(1/6): the conditional expected wait is still 6 rolls, exactly as at the start. The die does not remember, and no six is ever “due” — the gambler’s fallacy is the belief that the conditional law should have shifted. Conversely, the proposition’s uniqueness half says this indifference characterizes geometric waiting times: any waiting time whose forecast never updates is geometric. Real queues and lifetimes usually do update, which is precisely how one detects that they are not geometric.
22.2 Expectation
Definition 22.6(Expectation)
A real random variableX on (Ω,P)has an expectation if the family (X(ω)P({ω}))ω∈Ω is summable (Chapter 7); its expectation is then
E(X)=ω∈Ω∑X(ω)P({ω}).
Theorem 22.7(Transfer theorem)
X has an expectation if and only if the family (xP(X=x))x∈X(Ω) is summable, and then
E(X)=x∈X(Ω)∑xP(X=x).
More generally, for f:X(Ω)→R, the variable f(X) has an expectation iff ∑x∣f(x)∣P(X=x)<∞, and then E(f(X))=∑xf(x)P(X=x).
Proof. Partition Ω into the level sets Ωx={X=x}, x∈X(Ω). By the summation-by-packets theorem for summable families (Chapter 7), the family (X(ω)P({ω}))ω is summable iff each packet is (automatic: ∑ω∈Ωx∣x∣P({ω})=∣x∣P(X=x)) and the family of packet sums (xP(X=x))x is summable — and then the total sums agree. For f(X): apply the proven statement to the variable Y=f∘X, whose level sets are {Y=y}=⨆x:f(x)=y{X=x}; a second summation by packets converts ∑yyP(Y=y) into ∑xf(x)P(X=x), the packets now grouping the values x by their image f(x), with absolute summability of one family equivalent to that of the other. ∎
(Positivity and monotonicity) X≥0⇒E(X)≥0; X≤Y⇒E(X)≤E(Y); and ∣E(X)∣≤E(∣X∣).
(Domination) If ∣X∣≤Z and Z has an expectation, so does X.
Proof. All are properties of sums of summable families (Chapter 7): linearity of the sum, positivity term by term, and the domination criterion for summability. (Note that linearity is immediate on the definition over Ω, while it would be awkward on the transfer formula — one benefit of defining E upstream.) ∎
Example 22.9
X∼B(n,p): writing X=X1+⋯+Xn as a sum of Bernoulli indicators and using linearity, E(X)=np — no binomial coefficients needed. X∼G(p): E(X)=∑k≥1k(1−p)k−1p=p⋅(1−(1−p))21=p1, by differentiating the geometric series inside its disk (Chapter 11). X∼P(λ): E(X)=∑k≥1ke−λk!λk=λe−λ∑j≥0j!λj=λ.
Example 22.10(Transfer in action)
For X∼P(λ), compute E(1+X1) — the law of 1+X1 itself is awkward, but transfer never asks for it:
Two lessons. Computationally: recognizing a shifted exponential series is the whole work — transfer reduces expectations of f(X) to series manipulation. Structurally: the naive plug-in value would be 1+EX1=1+λ1, and the true answer is larger,
λ1−e−λ≥1+λ1,
exactly as Jensen’s inequality for the convex function t↦1+t1 demands. Expectations of convex images sit above the naive plug-in value, and transfer plus a series check makes the abstract inequality concrete.
Proof. The equivalence of the two formulations follows by summing the pointwise identity over (x,y)∈A×B (σ-additivity twice). For the product: the double family (xyP(X=x)P(Y=y))(x,y) is summable, since by Fubini for families (Chapter 7)
by independence this family is exactly (xyP(X=x,Y=y)), whose sum is E(XY) by transfer applied to the variable (X,Y)↦xy; Fubini again evaluates the unsigned sum as the product E(X)E(Y). ∎
Example 22.12(Products, with and without independence)
Roll two fair dice. If Y is the second die (independent of the first), E(XY)=E(X)E(Y)=3.52=12.25. If instead Y=X (the “product” of a die with itself),
E(X2)=61+4+9+16+25+36=691≈15.17=12.25:
same marginal laws in both scenarios, different joint laws, different product expectations. The moral, worth engraving: E(XY) is a functional of the pair, not of the two marginals — and the gap E(X2)−E(X)2≈2.92 is, by König–Huygens, precisely the variance1235 of the die.
22.3 Variance, covariance, and the classical inequalities
Definition 22.13(Moments, variance)
X has a moment of order 2 if X2 has an expectation (then so does X, by domination: ∣X∣≤21+X2). Its variance and standard deviation are then
V(X)=E((X−E(X))2)=E(X2)−E(X)2,σ(X)=V(X),
(the second form — the König–Huygens formula — by expanding the square and using linearity:
E((X−EX)2)=E(X2−2XEX+E(X)2)=E(X2)−2E(X)2+E(X)2,
the middle term using that EX is a constant). For X,Y with second moments, the covariance is
Proof.1 and 2 are expansions of squares plus linearity; the products XiXj have expectations by Cauchy–Schwarz below (or by ∣XiXj∣≤2Xi2+Xj2). 3 is Theorem 22.11 applied to the centered variables. A standard counterexample to the converse: X uniform on {−1,0,1} and Y=X2 are uncorrelated (E(XY)=E(X3)=0=EX⋅EY) but clearly dependent. ∎
Theorem 22.15(Markov and Chebyshev inequalities)
(Markov) If X≥0 has an expectation, then for every a>0:
P(X≥a)≤aE(X).
(Chebyshev) If X has a second moment, then for every ε>0:
P(∣X−E(X)∣≥ε)≤ε2V(X).
Proof.1.Pointwise, a1X≥a≤X (on the event the left side is a≤X; off it, 0≤X). Take expectations: aP(X≥a)≤E(X) by monotonicity and E(1A)=P(A). 2. Apply Markov to the nonnegative variable (X−EX)2 at level a=ε2: the event{(X−EX)2≥ε2} is exactly {∣X−EX∣≥ε}. ∎
Example 22.16(Uncorrelated but glued together)
Roll two fair dice, X and Yindependent, and set S=X+Y, D=X−Y. By bilinearity of the covariance,
Cov(S,D)=V(X)−V(Y)+Cov(Y,X)−Cov(X,Y)=V(X)−V(Y)=0:
sum and difference are uncorrelated. Independent? Certainly not: S=12 forces D=0, while P(D=0)=61 unconditionally. Correlation only tests the linear part of a dependence; here the dependence is carried by the constraint that S and D have the same parity, invisible to covariance. (For this pair, zero covariance needed V(X)=V(Y): identical distributions, not independence, did the work.)
Example 22.17(When Markov is exact)
Markov’s inequality is an equality precisely when nothing is wasted in the bound a1X≥a≤X: the variable must take only the values 0 and a. Concretely, if P(X=a)=π and P(X=0)=1−π, then E(X)=aπ and
P(X≥a)=π=aE(X).
A realistic reading: in a population where average wealth is 100 and wealth is either 0 or 106, the proportion of millionaires is exactly 10−4 — Markov’s bound, hit exactly by maximal inequality. Whenever X spreads over intermediate values the bound is strict, often wildly so; but as the extreme case shows, no better inequality can be extracted from the mean alone.
Example 22.18(Chebyshev is sharp — without further hypotheses)
Fix ε>0, q∈(0,1], and let X take the values ±ε with probability 2q each and 0 with probability 1−q. Then E(X)=0, V(X)=qε2, and
P(∣X−EX∣≥ε)=q=ε2V(X):
equality in Chebyshev. So the inequality cannot be improved using only the variance — the 1/ε2 decay is the exact price of second-moment information. Faster decay requires stronger hypotheses: boundedness of the variable buys exponential concentration, as Exercise 22.7 previews and this chapter’s weekend problem develops systematically.
Theorem 22.19(Cauchy–Schwarz and Jensen)
(Cauchy–Schwarz) If X,Y have second moments, XY has an expectation and E(XY)2≤E(X2)E(Y2); consequently Cov(X,Y)2≤V(X)V(Y).
(Jensen) If φ:I→R is convex on an interval containing X(Ω), and X, φ(X) have expectations, then
φ(E(X))≤E(φ(X)).
Proof.1.Summability of XY: ∣XY∣≤2X2+Y2. The map (X,Y)↦E(XY) is a positive symmetric bilinear form on the space of variables with second moments, so the abstract Cauchy–Schwarz inequality of Chapter 12 applies (positive semi-definite suffices for the inequality). Applying it to the centered variables gives the covariance bound.
2. First, m=E(X) lies in I: I is an interval containing all values of X, and expectation is monotone, so m is between infX(Ω) and supX(Ω). By the support-line theorem for convex functions (Chapter 8), there are α,β with φ(t)≥αt+β for all t∈I and φ(m)=αm+β. Then, pointwise on Ω, φ(X)≥αX+β; taking expectations,
E(φ(X))≥αE(X)+β=φ(E(X)).
∎
Example 22.20
Jensen with φ(t)=t2 gives E(X)2≤E(X2) — positivity of the variance; with φ(t)=1/t on (0,∞): EX1≤E(X1) — the harmonic mean is below the arithmetic mean, now in random form.
Remark 22.21(Common pitfalls)
(i) E(XY)=E(X)E(Y)requiresindependence (or at least zero covariance): taking Y=X gives E(X2)=E(X)2 whenever V(X)>0. (ii) Likewise V(X+X)=4V(X), not 2V(X): variances add only across independent (or uncorrelated) summands. (iii) E(f(X)) is not f(E(X)); for convexf Jensen even tells you the direction of the error, as in Example 22.10. (iv) Existence is a real hypothesis: for the St Petersburg variable X=2K with P(K=k)=2−k (k≥1),
k≥1∑2k⋅2−k=k≥1∑1=∞:
X is finite almost surely yet has no expectation, and no fair entry price for the game exists. Summability in the definition of E is not bookkeeping pedantry — it is where heavy tails are detected. (v) Finally, the transfer theorem needs absolutesummability before any rearrangement of the sum over values is legitimate (Chapter 7).
Example 22.22(Chebyshev on one hundred tosses)
For X∼B(100,21): EX=50, V(X)=25. Chebyshev with ε=6:
P(45≤X≤55)=P(∣X−50∣<6)≥1−3625≈0.31,
while the exact binomial sum gives ≈0.73. The guaranteed 31% is far from the truth, but it required only the mean and variance — the same certificate applies verbatim to any variable with E=50, V=25, however exotic, and Example 22.18 shows some such variable saturates it. Universality has a price; when the distribution is genuinely binomial, the exponential tools of the weekend problem close most of the gap.
Example 22.23(The correlation of a part with its whole)
For independent identically distributed X,Y with varianceσ2>0, how correlated is one summand with the sum S=X+Y? Compute
Cov(X,S)=Cov(X,X)+Cov(X,Y)=σ2+0=σ2,V(S)=2σ2,
so the correlation coefficient is
ρ(X,S)=σ(X)σ(S)Cov(X,S)=σ⋅σ2σ2=21≈0.707,
whatever the common law — dice, coins, Poisson counts. With n summands the same computation gives ρ(X1,Sn)=1/n: each individual term’s influence on the total dilutes like a square root, which is the correlational shadow of the n scale of fluctuations. Cauchy–Schwarz guarantees ∣ρ∣≤1 always; here the bound is met exactly in the degenerate case n=1 and decays predictably after.
Example 22.24(Weighted AM–GM from Jensen)
Let Y take the positive values a1,…,ak with probabilities λ1,…,λk. The function −ln is convex on (0,∞), so Jensen gives −lnE(Y)≤E(−lnY), i.e.
a1λ1a2λ2⋯akλk≤λ1a1+λ2a2+⋯+λkak:
the weighted arithmetic–geometric inequality, with equality iff Y is constant. Equal weights λi=k1 recover the classical AM–GM. Probability has quietly proved a purely algebraic theorem: choosing a probability law is just a bookkeeping device for convex combinations — the barycentric viewpoint of Chapter 17 once more, now with Jensen as the engine.
22.4 The weak law of large numbers
Theorem 22.25(Weak law of large numbers)
Let (Xk)k≥1 be pairwise independentrandom variables with the same law, admitting a second moment; write m=E(X1) and Sn=X1+⋯+Xn. Then for every ε>0:
P(nSn−m≥ε)≤nε2V(X1)n→∞0.
Proof. By linearity E(Sn/n)=m; by Theorem 22.14 (pairwise independence kills the covariances) V(Sn)=nV(X1), so V(Sn/n)=V(X1)/n. Chebyshev’s inequality applied to Sn/n gives the bound. ∎
Remark 22.26
This is the theorem that connects probability to frequency: for Xk the indicator of an eventA in independent repetitions, Sn/n is the observed frequency of A, and the law of large numbers says it concentrates around P(A) at rate nε2p(1−p). The strong law (Sn/n→m almost surely) is a Year 3 theorem — its proof for fourth moments is within reach, though: see Exercise 22.9, which runs Borel–Cantelli on the Chebyshev-type bound. The same Chebyshev estimate powered the Bernstein-polynomial proof of the Weierstrass approximation theorem in Chapter 10 — the counting lemma there was the weak law of large numbers in disguise.
Example 22.27(Collecting fifty coupons)
The coupon collector of Exercise 22.3 with n=50 distinct toys: the expected total is
E(T50)=50H50=50k=1∑50k1≈50×4.499≈225
boxes — four and a half times the naive guess 50. The harmonic growth is the whole story: the first 25 toys arrive in about 50ln2≈35 boxes, while the last toy alone costs 50 boxes on average (a geometric wait of parameter 501). Completion problems are dominated by their endgame, which is why Exercise 22.12 finds fluctuations of order n — the size of that final geometric wait — around the mean nlnn.
Example 22.28(How large must n be?)
To pin the observed frequency within ε=0.01 of P(A) with confidence 95%, Chebyshev’s bound demands
The dependence is brutal in ε (quadratic) and mild in the confidence (linear in 1/α). Both features are properties of the bound, not of the truth: the weekend problem’s exponential inequalities lower the price of confidence from 1/α to ln(1/α) — the same specification will cost about 18500 samples there — while the 1/ε2 scale is genuine and unimprovable. Knowing which part of a bound is loose is as useful as the bound itself.
The law of large numbers as a picture: the law of Sn/n (schematically drawn) keeps its center m but narrows as n grows, so the probability outside the band [m−ε,m+ε] — the two tails — shrinks to zero. Chebyshev bounds the tails by V(X1)/(nε2); the weekend problem shows they are in fact exponentially small.
Remark 22.29(Perspectives within this volume)
Forward, everything here feeds Chapter 23: the expectationE(tX) of one cunning function of X packs the whole law into a power series, moments become derivatives at 1, and Wald-type identities for random sums carry the branching-process theory; the product theorem for independent variables becomes multiplicativity of generating functions. Backward, expectation is a barycenter with probability weights (Chapter 17), Jensen’s inequality is the support-line geometry of convex functions (Chapter 8), and the exponential-moment method of this chapter’s weekend problem is Markov applied to etX — one inequality, upgraded by one good change of variable, spanning three chapters.
22.5 Exercises
Exercise 22.1★
Compute E(X) and V(X) for X∼B(n,p) (via indicators), X∼P(λ) (show V(X)=λ), and X∼G(p) (show V(X)=p21−p; use E(X(X−1)) and the second derivative of the geometric series).
Let X∼P(λ) and Y∼P(μ) be independent. Show that X+Y∼P(λ+μ) (convolution of the weights; binomial theorem), and that the conditional law of X given X+Y=n is binomial B(n,λ+μλ).
the binomial lawB(n,λ+μλ): given the total count, each event independently “chooses” the first source with probability proportional to its rate.
Exercise 22.3★
(Coupon collector, expectation) A cereal brand hides one of n distinct toys, uniformly, in each box. Let Tn be the number of boxes needed to collect all n toys. Writing Tn as a sum of independent geometric variables (time to see a new toy when k are still missing), show
E(Tn)=nk=1∑nk1∼nlnn
(equivalent by the series–integral comparison of Chapter 6).
Solution
Solution of Exercise 22.3.
When k toys are still missing, each new box brings a new toy with probability nk, independently of the past: the waiting time Wk for the next new toy is geometric G(nk), with E(Wk)=kn, and Tn=Wn+Wn−1+⋯+W1 (first box always gives a new toy: Wn=1, consistent with E=n/n). By linearity,
E(Tn)=k=1∑nkn=nk=1∑nk1∼nlnn,
using ∑k≤nk1=lnn+γ+o(1) (Chapter 6). Collecting the last few toys is what costs: half the boxes go to the final handful.
Exercise 22.4★★
Let X≥0 be integer-valued. Prove the tail formula
E(X)=n=1∑∞P(X≥n)
(when either side is finite), by writing X=∑n≥11X≥n and exchanging summations (Fubini for nonnegative families). Recover E(X)=p1 for the geometric law.
Solution
Solution of Exercise 22.4.
Pointwise, X(ω)=#{n≥1:X(ω)≥n}=∑n≥11X≥n(ω). The double family (1X≥n(ω)P({ω}))n,ω is nonnegative, so Fubini for families (Chapter 7) applies unconditionally: summing first in n gives E(X), summing first in ω gives ∑nP(X≥n); the two are simultaneously finite and equal. For X∼G(p): P(X≥n)=qn−1 (q=1−p), so E(X)=∑n≥1qn−1=1−q1=p1.
Exercise 22.5★★
(Sampling without replacement is more concentrated) An urn has N balls, M of them white. Draw n≤N without replacement and let X count the whites (hypergeometriclaw). Using indicators X=∑i=1nYi with Yi the i-th draw: show each Yi is Bernoulli of parameter p=M/N (symmetry!), conclude E(X)=np exactly as with replacement, and show Cov(Yi,Yj)=−N−1p(1−p)<0 for i=j, hence V(X)=np(1−p)N−1N−n≤np(1−p).
Solution
Solution of Exercise 22.5.
Symmetry: the i-th ball drawn is a uniformly random ball of the urn (any of the N balls is equally likely to land in position i of the drawing order), so P(Yi=1)=NM=p and E(X)=np by linearity — no independence needed.
Covariance: for i=j, E(YiYj)=P(draws i,j both white)=N(N−1)M(M−1) (ordered pairs of distinct positions get an ordered pair of distinct balls, uniformly). Hence
sampling without replacement has the same mean but smallervariance than with replacement (equality only for n=1), the negative correlations acting as a stabilizer. For n=N the variance vanishes: the count is then deterministic.
Exercise 22.6★★
Let X have a second moment. Show that c↦E((X−c)2) is minimal exactly at c=E(X), with minimum V(X). Then show that P(X=E(X))=1 if and only if V(X)=0. (For the second point: if V(X)=0, use Chebyshev with ε=1/n and monotone continuity, Theorem 21.6.)
minimal exactly at c=m with value V(X) — expectation is the best constant predictor in mean square.
If P(X=m)=1 then (X−m)2 vanishes with probability 1, so V(X)=0 (the defining family has null terms except on a null set). Conversely, if V(X)=0, Chebyshev (Theorem 22.15) gives P(∣X−m∣≥n1)≤n2V(X)=0 for every n; the events{∣X−m∣≥n1} increase to {X=m}, so monotone continuity (Theorem 21.6) yields P(X=m)=0.
Exercise 22.7★★★
(Concentration beats Markov) Let Sn∼B(n,21) (number of heads in n fair tosses). Compare the bounds given by Markov (P(Sn≥43n)), by Chebyshev, and by the exponential (Chernoff) method:
and optimize t to obtain an exponentially small bound. (At t=ln3: bound (2⋅3−3/4)n≈(0.877)n.)
Solution
Solution of Exercise 22.7.
E(Sn)=2n and V(Sn)=4n. Markov:P(Sn≥43n)≤3n/4n/2=32 — a constant bound, useless for large n. Chebyshev: the event implies Sn−2n≥4n, so the probability is ≤(n/4)2n/4=n4 — decays, but only polynomially. Chernoff: by independence, E(etSn)=∏i=1nE(etXi)=(21+et)n, and Markov applied to etSn≥e3nt/4 gives, for every t>0,
Minimize the exponent: dtdln21+et=1+etet=43 at et=3, i.e. t=ln3, giving
P(Sn≥43n)≤(24)n3−3n/4=(2⋅3−3/4)n≈(0.877)n,
exponentially small. The hierarchy Markov → Chebyshev → Chernoff is the standard ladder: each rung applies Markov to a faster-growing function of the variable.
Exercise 22.8★★★
(Weierstrass again, probabilistically) Let f:[0,1]→R be continuous and Sn∼B(n,x). Show that the Bernstein polynomial Bnf(x)=∑k=0nf(nk)(kn)xk(1−x)n−k equals E[f(nSn)], and re-derive the estimate ∣Bnf(x)−f(x)∣≤ωf(δ)+4nδ22∥f∥∞ of Chapter 10 in this probabilistic language (split on nSn−x≥δ and use Chebyshev).
Solution
Solution of Exercise 22.8.
By the transfer theorem (Theorem 22.7) applied to f(nSn) with Sn∼B(n,x):
E[f(nSn)]=k=0∑nf(nk)(kn)xk(1−x)n−k=Bnf(x).
Fix δ>0 and split ∣f(Sn/n)−f(x)∣ on the eventD={nSn−x≥δ}: off D, the difference is at most the modulus of continuityωf(δ)=sup∣s−t∣≤δ∣f(s)−f(t)∣; on D, at most 2∥f∥∞. Taking expectations and using Chebyshev with V(nSn)=nx(1−x)≤4n1:
Uniform continuity of f on [0,1] makes ωf(δ)→0: choose δ then n, and Bnf→funiformly — the Weierstrass approximation theorem of Chapter 10, whose “counting lemma” is now recognizable as Chebyshev’s inequality for the binomial law.
Exercise 22.9★★★
(Strong law under fourth moments) Let (Xk) be independent, identically distributed, centered (EX1=0), with E(X14)<∞. Expanding E(Sn4) and counting the surviving terms (only E(Xi4) and E(Xi2Xj2) terms, i=j), show E(Sn4)≤Cn2 for a constant C. Deduce ∑nP(∣Sn/n∣≥ε)<∞ for each ε>0 (Markov at order 4) and conclude with Borel–Cantelli (Theorem 21.25) that Sn/n→0 almost surely along a suitable formulation: the event⋂j⋃N⋂n≥N{∣Sn/n∣<j1} has probability 1.
Solution
Solution of Exercise 22.9.
Expand Sn4=∑i,j,k,lXiXjXkXl and take expectations. By independence and centering, any term containing an index appearing exactly once vanishes (E(Xi)=0 factors out). Surviving terms: the n diagonal terms E(Xi4), and the terms pairing two pairs of equal indices, E(Xi2Xj2)=E(X12)2 for i=j, appearing 3n(n−1) times: choose the unordered pair of values ((2n) ways), then the 2!2!4!=6 ways to place them in the four slots — 6(2n)=3n(n−1). Hence, with E(X12)2≤E(X14) (Jensen or Cauchy–Schwarz),
E(Sn4)=nE(X14)+3n(n−1)E(X12)2≤Cn2,C=4E(X14).
Markov at order 4:
P(nSn≥ε)=P(Sn4≥n4ε4)≤n4ε4Cn2=n2ε4C,
a summable series. By Borel–Cantelli 1 (Theorem 21.25), for each j the eventBj=limsupn{∣Sn/n∣≥j1} has probability 0, so P(⋃jBj)=0 by countable subadditivity. On the complement — of probability 1 — for every j there is N with ∣Sn/n∣<j1 for all n≥N: precisely Sn/n→0. The strong law of large numbers holds under a fourth moment; removing that hypothesis (Kolmogorov’s theorem) is Year 3 work.
Exercise 22.10★
Two fair dice are thrown; let M be the larger of the two results. Using the tail formula of Exercise 22.4 (finite version), show
E(M)=k=1∑6P(M≥k)=6−j=0∑5(6j)2=36161≈4.47.
Solution
Solution of Exercise 22.10.
P(M≤k)=(6k)2 (both dice at most k, independently), so P(M≥k)=1−(6k−1)2 and
comfortably above the mean 3.5 of a single die, as a maximum should be.
Exercise 22.11★★
Let Fn be the number of fixed points of a uniformly random permutation of {1,…,n} (n≥2). Writing Fn=∑i1σ(i)=i, compute E(Fn)=1, Cov(1σ(i)=i,1σ(j)=j)=n2(n−1)1 for i=j, and conclude V(Fn)=1: on average one letter is fixed, with variance exactly 1, whatever n.
Solution
Solution of Exercise 22.11.
With Ii=1σ(i)=i: P(σ(i)=i)=n!(n−1)!=n1, so E(Fn)=n⋅n1=1. For i=j: P(σ(i)=i,σ(j)=j)=n!(n−2)!=n(n−1)1, hence
Mean 1, variance1, independent of n — consistent with the Poisson limit of the matching problem (Exercise 21.5).
Exercise 22.12★★★
(Coupon collector, concentration) In the setting of Exercise 22.3, show
V(Tn)=k=1∑n(k/n)21−k/n≤n2k=1∑nk21≤6π2n2,
using independence of the geometric stages and V(G(p))=p21−p (Exercise 22.1; the value π2/6 is Example 14.12). Deduce with Chebyshev that nlnnTn→1in probability: the collector’s total time is nlnn up to fluctuations of order n.
Solution
Solution of Exercise 22.12.
Tn=∑k=1nGk where Gk∼G(k/n) is the time to see a new toy when k are missing, the stages being independent. Hence
Since Hn∼lnn, dividing by nlnn shows Tn/(nlnn)→1 in probability: the fluctuations of Tn are of order n, negligible against the mean nlnn.
22.6 Problem: the concentration toolbox, from Markov to Hoeffding
Problem 22.1
Weekend problem — exponential concentration by hand, and how many people a poll must ask
Markov’s inequality costs one moment and buys a 1/a decay; Chebyshev costs two moments and buys 1/ε2 — and Example 22.18 shows that is all those moments can buy. This problem climbs the rest of the ladder: the exponential (Chernoff) method with its exact rate for coin flips, Hoeffding’s inequality for all bounded variables, and the payoff — explicit, honest sample sizes for polls, election calls and coin testing. Throughout, Sn∼B(n,p) is a sum of nindependent Bernoulli variables and pn=Sn/n the empirical frequency.
Part I — Calibration on the fair coin. Here p=21 and a∈(21,1).
Markov at level an: show P(Sn≥an)≤2a1, a bound that does not even tend to 0. Where does Markov lose so much?
Chebyshev: using the symmetry of the fair binomial about n/2, show
P(Sn≥an)=21P(Sn−2n≥n(a−21))≤8n(a−1/2)21,
i.e. n2 at a=43: polynomial decay at last.
(Chernoff, general level) Compute E(etSn)=(21+et)n and optimize P(Sn≥an)≤E(etSn)e−tan over t>0: show the optimal t is ln1−aa and
P(Sn≥an)≤e−nI(a),I(a)=ln2+alna+(1−a)ln(1−a)>0.
Check that a=43 recovers the bound (2⋅3−3/4)n of Exercise 22.7.
(The exponent is exact) Let k=an be an integer. From the fact that (kn)ak(1−a)n−k is the largest of the n+1 terms of a probability distribution, prove (kn)≥n+1enH(a) with H(a)=−alna−(1−a)ln(1−a), and deduce the matching lower bound
P(Sn≥an)≥(ann)2−n≥n+1e−nI(a).
Tabulate the three bounds at n=100, a=43: Markov 32, Chebyshev 0.02, Chernoff ≈2.1⋅10−6 (the true value is ≈2.8⋅10−7). Moral, in one sentence?
Part II — Hoeffding’s inequality.
(Rademacher case) For ε=±1 with probability 21 each, prove
E(etε)=cosht≤et2/2(t∈R)
by comparing the two series term by term ((2k)!≥2kk!).
Deduce, for independent Rademacher variables ε1,…,εn and every s>0:
P(i=1∑nεi≥s)≤e−s2/(2n).
Translate to fair coins (Xi=21+εi): P(pn−21≥δ)≤e−2nδ2, and the two-sided version with a factor 2.
(Hoeffding’s lemma) Let X∈[0,1] with EX=p, and ψ(t)=lnE(etX). Justify that ψ is twice differentiable with
ψ′′(t)=Et(X2)−Et(X)2,Et(Y):=E(etX)E(YetX),
a variance of a reweighted variable still taking values in [0,1]; bound it by 41 (Exercise 22.6’s minimality argument) and conclude by Taylor:
E(et(X−p))≤et2/8.
(Hoeffding’s inequality) For independentXi∈[0,1] with common mean p, deduce
P(∣pn−p∣≥δ)≤2e−2nδ2(δ>0).
Compare the Chebyshev rate nδ2p(1−p) with Hoeffding’s 2e−2nδ2: which hypothesis does each require, and from which n (roughly) does the exponential bound win at δ=0.03, p=21?
Part III — How many people must a poll ask? A poll asks nindependent, uniformly chosen voters; each answers honestly; p is the true score, pn the poll’s figure.
Show that the poll is accurate to ±δ with confidence 1−α (i.e. P(∣pn−p∣≥δ)≤α) as soon as
n≥2δ2ln(2/α).
Compute the required n for the standard “three points, ninety-five percent” specification (δ=0.03, α=0.05): n≥2050; and for one point: n≥18445. Observe — and explain — the striking fact that the answer does not involve the population size.
Redo question 13 with Chebyshev (V(X1)=p(1−p)≤41): n≥4αδ21=5556 at three points. Note that sampling without replacement only helps (Exercise 22.5: the variance shrinks by N−1N−n).
(Calling an election) A candidate’s true score is p=0.52. How many voters must be polled so that P(pn≤21)≤0.01? Show n≥2⋅(0.02)2ln100≈5757 — calling a close race costs far more than estimating a score.
What the mathematics does not cover: list the modelling assumptions used (independent uniform sampling, honest answers, fixed p), and explain in a short paragraph why real polling errors are dominated by bias (non-uniform sampling, non-response), which no increase of n reduces.
Part IV — Sharper and cheaper.
(Median of means: exponential decay from two moments) Split a budget of km samples into kindependent groups of m; let p(1),…,p(k) be the group means and M their median. Choose m so that each group satisfies P(p(i)−p≥δ)≤81 (Chebyshev: m≥δ22 suffices). Show that if ∣M−p∣≥δ then at least k/2 groups err, and deduce
P(∣M−p∣≥δ)≤(⌈k/2⌉k)(81)k/2≤2k⋅8−k/2=2−k/2:
exponential concentration using nothing beyond variances.
(Paley–Zygmund) For X≥0 with a second moment, prove P(X>0)≥E(X2)E(X)2(Cauchy–Schwarz on X1X>0): the reverse-direction tool — moments can also force events to happen.
(Pinsker-lite) Show I(a)≥2(a−21)2 on (21,1)(the difference vanishes to second order at 21 and its second derivative is a(1−a)1−4≥0): Chernoff’s exact exponent always beats Hoeffding’s quadratic one.
Expand I(21+δ)=2δ2+O(δ4) and combine with question 4: for small deviations the Hoeffding exponent 2nδ2 is asymptotically exact — no method can beat it by more than polynomial factors.
Draw up the toolbox table: for Markov, Chebyshev, the fourth-moment bound of Exercise 22.9, Hoeffding, and Chernoff with exponent I, state in one line each: hypothesis required, decay obtained, and the question in this problem where it was sharpest.
Part V — Dividends.
(Testing a coin) A coin is either fair or biased with p=0.55. You flip it n times and declare “biased” when pn>0.525. Show that both error probabilities are at most e−2n(0.025)2, and that n≥3685 flips guarantee both below 1%.
(Rare events need a variance-aware bound) Let p=0.01 and take the relative specification δ=p/2=0.005, α=0.05. Compare the sample sizes demanded by Hoeffding (n≈74000) and by Chebyshev with the true variancep(1−p) (n≈7920): the variance-blind exponential bound loses to the humble second moment. State the moral, and where the missing tool (a variance-aware exponential bound; the Poisson approximation of Chapter 23) will come from.
(Strong law for coins) From ∑n2e−2nδ2<∞ and Borel–Cantelli (Theorem 21.25), prove that pn→p almost surely for independent coin flips: formulate the almost-sure event as ⋂j⋃N⋂n≥N{∣pn−p∣<j1} as in Exercise 22.9, and conclude. (Boundedness replaces the fourth moment used there.)
Synthesis. In five sentences: what each rung of the ladder (moments one, two, four; bounded exponential; exact exponent) costs and buys; why polling 2050 people suffices for a country of any size; and which of these bounds the Year 3 volume will sharpen into the central limit theorem’s exact constants.
Solution
Solution of Problem 22.1.
1.E(Sn)=2n and Markov (Theorem 22.15) give P(Sn≥an)≤ann/2=2a1. Markov only knows the mean: it cannot distinguish a variable concentrated at n/2 from one spread between 0 and n, so it prices the tail as if all the mass could sit there.
2. The fair binomial is symmetric about n/2 (Sn and n−Sn have the same law), so with x=n(a−21)>0 the two events{Sn−2n≥x} and {Sn−2n≤−x} are disjoint and equiprobable: P(Sn≥an)=21P(Sn−2n≥x). Chebyshev with V(Sn)=4n:
P(Sn≥an)≤21⋅n2(a−1/2)2n/4=8n(a−1/2)21,
which is n2 at a=43.
3. By independence and the product theorem, E(etSn)=(EetX1)n=(21+et)n. Markov applied to etSn:
P(Sn≥an)≤e−tan(21+et)n=exp(n(ln21+et−ta)).
The exponent’s derivative in t is 1+etet−a, vanishing at et=1−aa, i.e. t∗=ln1−aa>0; there 21+et∗=2(1−a)1 and the exponent equals
with I(21)=0 and I′(a)=ln1−aa>0 on (21,1): I(a)>0. At a=43: e−I(3/4)=21(43)−3/4(41)−1/4=2⋅3−3/4, the bound of Exercise 22.7.
4. The n+1 numbers (jn)aj(1−a)n−j sum to 1, and the largest is the one at j=k=an (the mode of B(n,a) is ⌊(n+1)a⌋=k here). A maximum of n+1 numbers summing to 1 is at least n+11:
Hence P(Sn≥an)≥(ann)2−n≥en(H(a)−ln2)/(n+1)=e−nI(a)/(n+1): up to the polynomial factor n+1, Chernoff’s exponent is the truth.
5.n=100, a=43: Markov 32; Chebyshev 1002=0.02; Chernoff (2⋅3−3/4)100=e−100I(3/4)≈2.1⋅10−6, against the exact 2.8⋅10−7. Moral: each moment of information divides the bound polynomially; the exponential moment changes its nature.
6.cosht=∑k≥0(2k)!t2k and et2/2=∑k≥02kk!t2k; the claim follows term by term from (2k)!≥2kk!, which holds by induction: (2k)!=2k(2k−1)⋅(2k−2)!≥2k⋅2k−1(k−1)!=2kk!⋅(2k−1)≥2kk!.
7. By independence, E(et∑εi)=(cosht)n≤ent2/2, so Markov gives P(∑εi≥s)≤ent2/2−ts; minimizing at t=s/n yields e−s2/(2n).
8. With Xi=21+εi, pn−21=2n1∑εi, so {pn−21≥δ}={∑εi≥2nδ} and question 7 gives the bound e−(2nδ)2/(2n)=e−2nδ2. The symmetric event has the same bound, whence the factor 2 for pn−21≥δ.
9.E(etX)=∑xetxP(X=x) is a series of smooth functions of t whose term-by-term derivatives are dominated, on every compactt-interval, by e∣t∣P(X=x) (as 0≤x≤1): by the differentiation theorem for normally convergent series (Theorem 10.7) it is twice differentiable, and the quotient rule gives ψ′=Et(X) and ψ′′=Et(X2)−Et(X)2, where Et is the expectation for the reweighted weights etxP(X=x)/E(etX) — nonnegative, summing to 1, carried by the same values x∈[0,1]. A variance of a [0,1]-valued variable is at most 41: by Exercise 22.6, it is mincEt((X−c)2)≤Et((X−21)2)≤41. Taylor with integral remainder, using ψ(0)=0, ψ′(0)=p:
ψ(t)=tp+∫0t(t−s)ψ′′(s)ds≤tp+2t2⋅41,
i.e. E(et(X−p))≤et2/8 for all real t.
10. By independence, E(et(Sn−np))≤ent2/8; Markov and the optimization t=4δ give
P(pn−p≥δ)≤ent2/8−tnδt=4δ=e−2nδ2;
applying this to the variables 1−Xi (also in [0,1]) bounds the other tail, whence the two-sided 2e−2nδ2.
11. Chebyshev needs only a second moment and gives nδ2p(1−p); Hoeffding needs boundedness and gives 2e−2nδ2. At p=21, δ=0.03: the bounds are n278 (approximately) versus 2e−0.0018n; they cross near n≈1200, after which the exponential bound wins, and wildly so (n=5000: 0.056 versus 2.5⋅10−4).
12. By Hoeffding (question 10), P(∣pn−p∣≥δ)≤2e−2nδ2≤α as soon as 2nδ2≥lnα2, i.e. n≥2δ2ln(2/α).
13.δ=0.03, α=0.05: n≥2⋅0.0009ln40≈2049.4: 2050 people. For δ=0.01: n≥0.0002ln40≈18445. The population size never appears because each sampled voter is modelled as a fresh Bernoulli(p) draw: the poll’s difficulty is the variance of a coin, not the size of the country. Halving the margin costs four times the sample — the 1/δ2 law.
14. Chebyshev: P(∣pn−p∣≥δ)≤nδ2p(1−p)≤4nδ21≤α for n≥4αδ21, i.e. 5556 at three points — about 2.7 times the Hoeffding requirement. Without replacement, the variance is multiplied by N−1N−n<1 (Exercise 22.5), so the same n can only do better: the with-replacement computation is the conservative one.
15.{pn≤21}⊆{pn−0.52≤−0.02}, so by the one-sided Hoeffding bound P(pn≤21)≤e−2n(0.02)2≤0.01 as soon as n≥2⋅0.0004ln100≈5756.5: 5757 voters. The cost scales like the inverse square of the lead, not of the desired precision: close races are expensive.
16. Used: the sample is drawn uniformly and independently from the electorate; every sampled person answers, honestly, and p does not move during polling. Real polls violate all three: reachable and willing respondents are not a uniform sample (selection and non-response bias), and answers can be untruthful or unstable. These are bias errors: they shift E(pn) away from p by an amount independent of n, so no sample size reduces them — the mathematics of this Part controls only the fluctuation term.
17. Chebyshev for one group of size m: P(p(i)−p≥δ)≤4mδ21≤81 for m≥δ22. If fewer than k/2 groups err, then more than k/2 of the values p(i) lie in the open interval (p−δ,p+δ), and so does their median; hence {∣M−p∣≥δ} forces at least ⌈k/2⌉ errors among kindependent groups. The union bound over the (⌈k/2⌉k) possible sets of erring groups gives
P(∣M−p∣≥δ)≤(⌈k/2⌉k)(81)k/2≤2k8−k/2=2−k/2:
exponential decay in the number of groups, bought with nothing but variances — useful precisely when the summands are unbounded and Hoeffding is unavailable.
19. Let h(a)=I(a)−2(a−21)2. Then h(21)=0, h′(a)=ln1−aa−4(a−21) vanishes at 21, and
h′′(a)=a1+1−a1−4=a(1−a)1−4≥0
since a(1−a)≤41. So h′ increases from 0 on [21,1), hence h′≥0 and h≥0: I(a)≥2(a−21)2.
20.I(21)=I′(21)=0, I′′(a)=a(1−a)1 gives I′′(21)=4, and I′′′(21)=0 (the function is symmetric about 21), so I(21+δ)=2δ2+O(δ4). Question 4 then bounds the true tail below by e−n(2δ2+O(δ4))/(n+1): for small δ the Hoeffding exponent 2nδ2 is asymptotically exact — only polynomial-in-n improvements are possible.
21. Markov: one moment, decay 1/a, useful only as the engine behind the others (question 1 shows it flat). Chebyshev: two moments, decay nδ2V, sharp without further hypotheses (Example 22.18), and the best tool at question 23. Fourth moment (Exercise 22.9): decay C/n2, just enough summability for a strong law. Hoeffding: bounded variables, decay 2e−2nδ2, the workhorse of Part III. Chernoff with the exact rate I(a): full exponential moments, unbeatable exponent (questions 4, 20), the reference point for everything else.
22. If the coin is fair: P(pn>0.525)≤P(pn−21≥0.025)≤e−2n(0.025)2. If p=0.55: P(pn≤0.525)≤P(pn−0.55≤−0.025)≤e−2n(0.025)2. Both errors are below 0.01 when 2n(0.025)2≥ln100, i.e. n≥3684.2: 3685 flips. (Distinguishing hypotheses 2.5 points apart costs what estimating to ±2.5 points costs.)
23. Hoeffding: n≥2(0.005)2ln40≈73778. Chebyshev with the true variancep(1−p)=0.0099: n≥0.05⋅(0.005)20.0099=7920 — nine times cheaper. Hoeffding’s exponent 2nδ2 prices the variance at its worst case 41, absurdly pessimistic when p=0.01; the humble second moment knows better. The missing tool is a variance-aware exponential bound (Bernstein’s inequality, Year 3) — or, for rare events, the Poisson approximation proved in Chapter 23, which works on the natural relative scale.
24. Fix δ>0: ∑n2e−2nδ2<∞ (geometric-type series), so Borel–Cantelli 1 (Theorem 21.25) gives P(∣pn−p∣≥δ infinitely often)=0, i.e. the eventEj=⋃N⋂n≥N{∣pn−p∣<j1} has probability 1 for each j. The countable intersection ⋂jEj still has probability 1 (subadditivity on the complements), and on it pn→p: the strong law of large numbers for coin flips, with boundedness playing the role that the fourth moment played in Exercise 22.9.
25. One moment buys a flat bound; two buy 1/(nδ2), and no more (the sharpness example); four buy 1/n2, enough to telescope into an almost-sure law; boundedness buys e−2nδ2; and the full exponential moment buys the exact rate I, which no method beats. Polling 2050 people suffices for any country because the sample’s fluctuation is governed by the coin’s variance, not the population’s size — the 1/δ2 and ln(1/α) price tags are universal. The Year 3 volume’s central limit theorem replaces these inequalities, on the n scale, by an exact limit law with explicit constants — turning every bound of this problem into an asymptotic equality.