MathLabs

Probability and statistics

The law of large numbers and the central limit theorem

Why averages of independent random variables settle down, and why — once standardized — they look like a bell curve: Chebyshev's inequality, the weak and strong laws of large numbers, and the central limit theorem.

IntuitionWhy averages settle down

Flip a fair coin once and you cannot predict heads or tails. Flip it 10,000 times and the fraction of heads is almost certainly close to 0.5, even though every single flip is still unpredictable. Randomness does not disappear — it dilutes: individual outcomes stay random, but their average becomes more and more predictable as you collect more of them.

A 3D bell-shaped surface peaking at the centre and decaying smoothly to zero in every direction, the graph of z = e^(-r^2) where r is distance from the centre.
The bivariate Gaussian bump z=e−r2z = e^{-r^2}: a preview of the bell-shaped surface that sums of many independent random contributions approach — the central limit theorem, later on this page.

UndergraduateChebyshev's inequality: how far can a random variable stray?

Definition: Chebyshev's inequality

For a random variable XX with finite mean μ\mu and variance σ2\sigma^2, Chebyshev's inequality bounds how much probability can sit far from the mean, using nothing but σ2\sigma^2 — no assumption on the shape of XX's distribution is needed.

P(∣X−μ∣≥k)≤σ2k2,k>0P(|X-\mu|\ge k)\le \frac{\sigma^2}{k^2}, \qquad k>0

For a random variable XX with finite mean μ\mu and variance σ2\sigma^2, and any k>0k>0: P(∣X−μ∣≥k)≤σ2k2P(|X-\mu|\ge k)\le \dfrac{\sigma^2}{k^2}.

Why is it true?

Markov's inequality applied to the non-negative random variable (X−μ)2(X-\mu)^2 gives P((X−μ)2≥k2)≤E[(X−μ)2]/k2=σ2/k2P((X-\mu)^2 \ge k^2) \le E[(X-\mu)^2]/k^2 = \sigma^2/k^2; the event (X−μ)2≥k2(X-\mu)^2 \ge k^2 is exactly ∣X−μ∣≥k|X-\mu| \ge k.

Proof

We first prove Markov's inequality: for a non-negative random variable Y≥0Y\ge0 and any a>0a>0, the indicator bound Y≥a⋅1{Y≥a}Y\ge a\cdot\mathbb{1}_{\{Y\ge a\}} holds pointwise, because on the event {Y≥a}\{Y\ge a\} the right side equals a≤Ya\le Y, and elsewhere the right side is 0≤Y0\le Y. Taking expectations of both sides preserves the inequality: E[Y]≥aP(Y≥a)E[Y]\ge aP(Y\ge a), hence P(Y≥a)≤E[Y]/aP(Y\ge a)\le E[Y]/a.

Now apply Markov's inequality to the non-negative random variable Y=(X−μ)2Y=(X-\mu)^2 with threshold a=k2a=k^2: P((X−μ)2≥k2)≤E[(X−μ)2]/k2P((X-\mu)^2\ge k^2)\le E[(X-\mu)^2]/k^2. By definition of variance, E[(X−μ)2]=σ2E[(X-\mu)^2]=\sigma^2, so the right side is exactly σ2/k2\sigma^2/k^2.

Finally, the events on either side of Markov's inequality coincide: (X−μ)2≥k2  ⟺  ∣X−μ∣≥k(X-\mu)^2\ge k^2 \iff |X-\mu|\ge k (both sides are non-negative, so squaring preserves the order). Substituting gives P(∣X−μ∣≥k)≤σ2/k2P(|X-\mu|\ge k)\le\sigma^2/k^2, which is Chebyshev's inequality.

Example: A quick bound

A random variable XX has mean μ=10\mu = 10 and variance σ2=4\sigma^2 = 4. Bound P(∣X−10∣≥4)P(|X - 10| \ge 4).

Solution

P(∣X−10∣≥4)≤σ2/42=4/16=0.25P(|X-10|\ge 4) \le \sigma^2/4^2 = 4/16 = 0.25: no matter the shape of XX's distribution, it strays 4 or more from its mean with probability at most 25%.

Example: Monte Carlo estimation of π

To estimate π\pi, a computer samples nn independent points (Ui,Vi)(U_i,V_i) uniformly in the square [−1,1]2[-1,1]^2 and counts what fraction land inside the unit circle. Why does this converge to π\pi, and roughly how many samples nn are needed (via Chebyshev's inequality) so that the estimate is within 0.010.01 of π\pi with probability at least 0.990.99?

Solution

Let Yi=1{Ui2+Vi2≤1}Y_i=\mathbb{1}_{\{U_i^2+V_i^2\le1\}} indicate that the ii-th point falls inside the unit circle. Since points are uniform on a square of area 44 and the circle has area π\pi, E[Yi]=π/4E[Y_i]=\pi/4. Define the estimator π^n=4n∑i=1nYi\hat\pi_n=\frac{4}{n}\sum_{i=1}^nY_i, so E[π^n]=πE[\hat\pi_n]=\pi.

By the weak law of large numbers proved above, 1n∑i=1nYi→π/4\frac1n\sum_{i=1}^nY_i\to\pi/4 in probability, hence π^n→π\hat\pi_n\to\pi in probability: this is exactly why Monte Carlo simulation works — averaging independent random samples converges to the true expected value.

For a concrete sample size, Var(Yi)=π4(1−π4)≈0.168\mathrm{Var}(Y_i)=\frac{\pi}{4}\left(1-\frac{\pi}{4}\right)\approx0.168 (a Bernoulli variance), so Var(π^n)=16 Var(Yi)/n\mathrm{Var}(\hat\pi_n)=16\,\mathrm{Var}(Y_i)/n. Chebyshev's inequality gives P(∣π^n−π∣≥0.01)≤16×0.168n×0.0001P(|\hat\pi_n-\pi|\ge0.01)\le\frac{16\times0.168}{n\times0.0001}; requiring this to be at most 0.010.01 forces n≥2.7×106n\ge2.7\times10^{6} — millions of samples for two-decimal accuracy, which is why Monte Carlo methods favor cheaper, higher-variance-reducing variants in practice, but the law of large numbers is what guarantees convergence at all.

Example: Pooling risk in an insurance portfolio

An insurer's annual claim per policyholder XiX_i has mean μ=500\mu=500 and standard deviation σ=2000\sigma=2000 (in US dollars; claims are rare but large), and claims across the n=10000n=10000 policyholders in a pool are treated as i.i.d. Using the central limit theorem, estimate a premium per policyholder such that the pool's average claim exceeds it with probability at most about 0.00130.0013.

Solution

Let Xˉn\bar X_n be the average claim across the pool. By the weak law of large numbers, Xˉn→μ=500\bar X_n\to\mu=500 as the pool grows, so pooling many independent policyholders makes the average claim predictable even though any single claim XiX_i is highly volatile — this is the entire economic logic of insurance.

By the central limit theorem proved above, Xˉn\bar X_n is approximately normal with mean μ\mu and variance Var(Xˉn)=σ2/n=40\mathrm{Var}(\bar X_n)=\sigma^2/n=40 for n=10000n=10000, giving a standard deviation of sd(Xˉn)=40≈6.32\mathrm{sd}(\bar X_n)=\sqrt{40}\approx6.32 dollars — dramatically smaller than the 20002000-dollar volatility of a single claim.

For a normal distribution, P(Xˉn>μ+3 sd(Xˉn))≈P(Z>3)≈0.0013P(\bar X_n>\mu+3\,\mathrm{sd}(\bar X_n))\approx P(Z>3)\approx0.0013 where ZZ is standard normal. So setting the premium at μ+3 sd(Xˉn)≈519\mu+3\,\mathrm{sd}(\bar X_n)\approx519 dollars per policyholder keeps the probability of the pool's average claim exceeding the premium at about 0.13%0.13\% — the central limit theorem is precisely what lets an insurer convert wildly unpredictable individual risk into a narrow, priceable aggregate risk.

UndergraduateThe weak law of large numbers

Definition: Convergence in probability

A sequence of random variables YnY_n converges in probability to a constant cc if for every ε>0\varepsilon > 0, P(∣Yn−c∣>ε)→0P(|Y_n - c| > \varepsilon) \to 0 as n→∞n \to \infty: the chance of a large deviation shrinks to nothing, though for any fixed nn a large deviation is still possible.

Let X1,X2,…X_1, X_2, \dots be i.i.d. random variables with finite mean μ\mu. Then the sample mean Xˉn=1n∑i=1nXi\bar X_n = \frac{1}{n}\sum_{i=1}^n X_i converges to μ\mu in probability as n→∞n \to \infty.

Why is it true?

Var(Xˉn)=σ2/n→0\mathrm{Var}(\bar X_n) = \sigma^2/n \to 0 (when σ2\sigma^2 is finite), so Chebyshev's inequality gives P(∣Xˉn−μ∣≥ε)≤σ2/(nε2)→0P(|\bar X_n - \mu| \ge \varepsilon) \le \sigma^2/(n\varepsilon^2) \to 0. (The full theorem needs only a finite mean, via a more delicate truncation argument, but the Chebyshev proof is the illuminating special case.)

Proof

Let Xˉn=1n∑i=1nXi\bar X_n=\frac1n\sum_{i=1}^nX_i be the sample mean of nn i.i.d. copies of XX with mean μ\mu and, for this Chebyshev-based proof, finite variance σ2\sigma^2. Linearity of expectation gives E[Xˉn]=μE[\bar X_n]=\mu.

Independence makes variances add: Var(Xˉn)=1n2∑i=1nVar(Xi)=σ2n\mathrm{Var}(\bar X_n)=\frac1{n^2}\sum_{i=1}^n\mathrm{Var}(X_i)=\frac{\sigma^2}{n}, since each XiX_i contributes Var(Xi)=σ2\mathrm{Var}(X_i)=\sigma^2 and the cross terms Cov(Xi,Xj)\mathrm{Cov}(X_i,X_j) for i≠ji\ne j vanish by independence.

Fix any ε>0\varepsilon>0 and apply Chebyshev's inequality, proved above, to Xˉn\bar X_n: P(∣Xˉn−μ∣≥ε)≤Var(Xˉn)ε2=σ2nε2P(|\bar X_n-\mu|\ge\varepsilon)\le\frac{\mathrm{Var}(\bar X_n)}{\varepsilon^2}=\frac{\sigma^2}{n\varepsilon^2}.

As n→∞n\to\infty, the right side σ2/(nε2)→0\sigma^2/(n\varepsilon^2)\to0 for every fixed ε>0\varepsilon>0, which is exactly the definition of convergence in probability. Hence Xˉn→μ\bar X_n\to\mu in probability.

A version of this result was first proved by Jacob Bernoulli, published posthumously in 1713 in Ars Conjectandi — the earliest form of the law of large numbers, for the fraction of successes in repeated coin-like trials.

AdvancedThe strong law of large numbers

Definition: Almost sure convergence

A sequence YnY_n converges almost surely to cc if P(lim⁡n→∞Yn=c)=1P(\lim_{n\to\infty} Y_n = c) = 1: the entire sequence itself settles at cc for almost every outcome, which is stronger than convergence in probability (which only controls one nn at a time).

Let X1,X2,…X_1, X_2, \dots be i.i.d. random variables with finite mean μ\mu. Then Xˉn→μ\bar X_n \to \mu almost surely as n→∞n \to \infty.

Why is it true?

The classical proof (Kolmogorov, 1933) uses Kolmogorov's inequality — a strengthening of Chebyshev's that controls the whole trajectory of partial sums at once — together with a subsequence argument; it is considerably more delicate than the weak law's one-line Chebyshev proof.

Proof

We sketch the proof under the extra (common textbook) assumption that XX has a finite fourth moment E[X4]<∞E[X^4]<\infty; the general statement needs only a finite mean but requires a more delicate truncation argument (Kolmogorov, 1933). After centering, assume E[X]=0E[X]=0 (replace XiX_i by Xi−μX_i-\mu throughout), and let Sn=∑i=1nXiS_n=\sum_{i=1}^nX_i.

Expand E[Sn4]=∑i,j,k,lE[XiXjXkXl]E[S_n^4]=\sum_{i,j,k,l}E[X_iX_jX_kX_l] over all n4n^4 index quadruples. Independence and E[X]=0E[X]=0 kill every term that contains an index appearing exactly once (its factor averages to 00), leaving only the nn terms with all four indices equal and the 3n(n−1)3n(n-1) terms that pair up into two distinct equal indices. This gives E[Sn4]=nE[X4]+3n(n−1)σ4≤Cn2E[S_n^4]=nE[X^4]+3n(n-1)\sigma^4\le Cn^2 for a constant CC depending only on E[X4]E[X^4] and σ2\sigma^2.

Dividing by n4n^4: E[(Snn)4]≤Cn2E\left[\left(\frac{S_n}{n}\right)^4\right]\le\frac{C}{n^2}. Summing over nn, ∑n=1∞E[(Snn)4]≤∑n=1∞Cn2<∞\sum_{n=1}^\infty E\left[\left(\frac{S_n}{n}\right)^4\right]\le\sum_{n=1}^\infty\frac{C}{n^2}<\infty since ∑1/n2\sum 1/n^2 converges.

A sum of non-negative random variables with finite expected total sum must itself be finite almost surely (monotone convergence), so ∑n=1∞(Snn)4<∞\sum_{n=1}^\infty\left(\frac{S_n}{n}\right)^4<\infty almost surely, which forces its individual terms to vanish: (Snn)4→0\left(\frac{S_n}{n}\right)^4\to0, i.e. Snn→0\frac{S_n}{n}\to0 almost surely. Undoing the centering gives Xˉn→μ\bar X_n\to\mu almost surely, the strong law.

AdvancedThe central limit theorem

Xˉn−μσ/n →d N(0,1)as n→∞\frac{\bar X_n - \mu}{\sigma/\sqrt{n}} \ \xrightarrow{d}\ N(0,1) \quad \text{as } n \to \infty

Let X1,…,XnX_1, \dots, X_n be i.i.d. with mean μ\mu and finite variance σ2>0\sigma^2 > 0. Then as n→∞n \to \infty, the standardized sample mean Xˉn−μσ/n\dfrac{\bar X_n - \mu}{\sigma/\sqrt{n}} converges in distribution to the standard normal N(0,1)N(0,1) — regardless of the shape of the original distribution of XiX_i.

Why is it true?

Intuitively, the standardized sum's moment generating (or characteristic) function converges to that of N(0,1)N(0,1) term by term via a Taylor expansion, because only the mean and variance survive the standardization — all higher moments get washed out as n→∞n \to \infty. This is why the same bell shape appears no matter what XiX_i's original distribution looked like.

Proof

For a random variable ZZ, its characteristic function is φZ(t)=E[eitZ]\varphi_Z(t)=E[e^{itZ}]. Standardize each XiX_i by setting Zi=Xi−μσZ_i=\frac{X_i-\mu}{\sigma}, so that E[Zi]=0, E[Zi2]=1E[Z_i]=0,\ E[Z_i^2]=1, and the standardized sample mean becomes a sum of these: Tn=1n∑i=1nZi=Xˉn−μσ/nT_n=\frac{1}{\sqrt n}\sum_{i=1}^nZ_i=\frac{\bar X_n-\mu}{\sigma/\sqrt n}.

Because the ZiZ_i are i.i.d., the characteristic function of a sum multiplies: φTn(t)=[φZ ⁣(tn)]n\varphi_{T_n}(t)=\left[\varphi_Z\!\left(\frac{t}{\sqrt n}\right)\right]^n.

Since E[Z]=0E[Z]=0 and E[Z2]=1E[Z^2]=1, a Taylor expansion of φZ\varphi_Z near 00 gives φZ(s)=1−s22+o(s2)\varphi_Z(s)=1-\frac{s^2}{2}+o(s^2). Substituting s=t/ns=t/\sqrt n: φZ ⁣(tn)=1−t22n+o ⁣(1n)\varphi_Z\!\left(\frac{t}{\sqrt n}\right)=1-\frac{t^2}{2n}+o\!\left(\frac1n\right).

Raising to the nn-th power and using the standard limit (1+cn+o(1/n))n→ec\left(1+\frac{c}{n}+o(1/n)\right)^n\to e^{c}: φTn(t)=[1−t22n+o ⁣(1n)]n→e−t2/2\varphi_{T_n}(t)=\left[1-\frac{t^2}{2n}+o\!\left(\frac1n\right)\right]^n\to e^{-t^2/2}. Since e−t2/2e^{-t^2/2} is precisely the characteristic function of the standard normal N(0,1)N(0,1), Lévy's continuity theorem converts this pointwise convergence of characteristic functions into convergence in distribution: Tn→dN(0,1)T_n\xrightarrow{d}N(0,1).

Three theorems, three questions about Xˉn\bar X_n
ResultQuestion answeredType of statement
Chebyshev's inequalityHow far can XX stray from μ\mu?Finite-sample bound, any distribution
Weak law of large numbersDoes Xˉn\bar X_n approach μ\mu?Convergence in probability
Strong law of large numbersDoes the whole sequence Xˉn\bar X_n settle at μ\mu?Almost-sure convergence
Central limit theoremWhat shape do the fluctuations of Xˉn\bar X_n have?Convergence in distribution, to N(0,1)N(0,1)

These convergence results are the engine behind statistics: estimation asks how to turn a sample mean into a confidence interval for μ\mu, and hypothesis testing asks how to use the same normal approximation to decide between competing claims about a population.

The weak law of large numbers says that as n→∞n \to \infty, the sample mean Xˉn\bar X_n of i.i.d. variables with mean μ\mu

Chebyshev's inequality P(∣X−μ∣≥k)≤σ2/k2P(|X-\mu|\ge k) \le \sigma^2/k^2 requires which assumption about the distribution of XX?

By the central limit theorem, the distribution of the standardized sample mean (Xˉn−μ)/(σ/n)(\bar X_n - \mu)/(\sigma/\sqrt{n}) approaches, as n→∞n \to \infty,

After 10 consecutive heads on a fair coin, the law of large numbers implies that

References

  1. Sheldon Ross (2019). A First Course in Probability
  2. Rick Durrett (2019). Probability: Theory and Examples
  3. Andrey Kolmogorov (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung