Law of Large Numbers

As a sample grows, its average gets closer and closer to the expected value.

Prerequisites: Expected Value, Variance of a Random Variable, Statistical Independence.

The law of large numbers says that the average of many independent repetitions of the same random experiment gets close to the expected value, and gets closer as the number of repetitions grows. Toss a fair coin ten times and you may well see 7 heads; toss it ten thousand times and the proportion of heads will almost certainly be very near one half.

It is the reason averages are useful at all. It justifies estimating a population mean by a sample mean, interpreting probabilities as long-run frequencies, and running simulations to approximate quantities that are hard to compute exactly.

Intuition

Each individual outcome is unpredictable, but in an average, high and low values partly cancel. With few observations, one or two unusual values can pull the average far from the centre. With many observations, any single value has a weight of only 1/n1/n, so it can move the average very little, and the overall result is dominated by the typical behaviour of the process.

Four jagged lines showing the running proportion of heads in fair coin tosses. Early on they jump between 0 and 1; by a few hundred tosses all four stay close to the dotted line at 0.5, and by 2,000 tosses they lie between about 0.49 and 0.51.
Running proportion of heads in four simulated sequences of 2,000 fair coin tosses. The horizontal axis is on a log scale so that the erratic early tosses are visible. After 2,000 tosses the four proportions are 0.505, 0.495, 0.496 and 0.493.

The figure shows four simulated sequences of coin tosses. After a handful of tosses the proportion of heads is all over the place: one run starts with seven heads in a row. As the tosses accumulate, the lines settle into an ever narrower band around 0.5. No single run is forced to reach 0.5 exactly; they simply wander less and less.

Statement

Let X1,X2,…X_1, X_2, \dots be independent and identically distributed (iid) random variables, each with finite mean μ=E⁡[Xi]\mu = \E[X_i]. Write the average of the first nn of them as

Xˉn=1n∑i=1nXi.\bar{X}_n = \frac{1}{n} \sum_{i=1}^n X_i.

The subscript nn is a reminder that the average depends on how many observations it uses. For coin tosses, Xi=1X_i = 1 for heads and 00 for tails, so μ=0.5\mu = 0.5 and Xˉn\bar{X}_n is the proportion of heads.

Weak law of large numbers. For every tolerance ε>0\varepsilon > 0, however small,

P(∣Xˉn−μ∣>ε)→0as n→∞.P\big(|\bar{X}_n - \mu| > \varepsilon\big) \to 0 \quad \text{as } n \to \infty.

In words: pick any margin of error you like. The probability that the average misses μ\mu by more than that margin becomes as small as you want once nn is large enough. This kind of convergence is called convergence in probability.

There is also a strong law of large numbers, which says that, with probability 1, the sequence of averages Xˉ1,Xˉ2,…\bar{X}_1, \bar{X}_2, \dots actually converges to μ\mu. Under the same assumptions, both laws hold. The distinction matters in advanced probability; for most purposes, “the average converges to the mean” is the message of both.

The assumptions

Why it is true

When the variance σ2\sigma^2 is also finite, there is a short proof. From the article on sampling distributions, E⁡[Xˉn]=μ\E[\bar{X}_n] = \mu and Var⁡(Xˉn)=σ2/n\Var(\bar{X}_n) = \sigma^2/n. Chebyshev’s inequality says that any random variable is unlikely to be many standard deviations from its mean: for any ε>0\varepsilon > 0,

P(∣Xˉn−μ∣≥ε)≤Var⁡(Xˉn)ε2=σ2nε2.P\big(|\bar{X}_n - \mu| \ge \varepsilon\big) \le \frac{\Var(\bar{X}_n)}{\varepsilon^2} = \frac{\sigma^2}{n\varepsilon^2}.

The right-hand side goes to 00 as nn grows, which proves the weak law. The proof also shows why it works: the variance of the average shrinks like 1/n1/n. (The law still holds without a finite variance, but the proof is harder.)

Worked example

For a fair coin, μ=0.5\mu = 0.5 and σ2=0.5×0.5=0.25\sigma^2 = 0.5 \times 0.5 = 0.25. How likely is the proportion of heads to be within 0.05 of one half?

The exact probabilities, computed from the binomial distribution, are:

Tosses nn P(0.45≤Xˉn≤0.55)P(0.45 \le \bar{X}_n \le 0.55)
10 about 0.246
100 about 0.729
1,000 about 0.9986
10,000 greater than 0.999999

With 10 tosses, the only proportion in the band is exactly 5 heads, which happens about a quarter of the time. With 1,000 tosses, missing the band is roughly a 1-in-700 event.

Chebyshev’s inequality gives a guaranteed, but much cruder, bound. For n=1000n = 1000 and ε=0.05\varepsilon = 0.05:

P(∣Xˉn−0.5∣≥0.05)≤0.251000×0.052=0.1.P\big(|\bar{X}_n - 0.5| \ge 0.05\big) \le \frac{0.25}{1000 \times 0.05^2} = 0.1.

The true probability is about 0.0017. Chebyshev is useful for proving that convergence happens, not for computing how fast; the central limit theorem gives far better approximations.

Common misunderstandings

“After a run of heads, tails is due.” This is the gambler’s fallacy. Coin tosses are independent: the coin has no memory, and the probability of heads on the next toss is still 0.5. The law of large numbers does not work by correcting past deviations. It works by diluting them. Suppose the first 10 tosses give 8 heads, 3 more than expected. Over the next 990 tosses we expect 495 heads, so after 1,000 tosses we expect (8+495)/1000=0.503(8 + 495)/1000 = 0.503. The 3 extra heads are still there; they just matter less and less in the average.

“The number of heads will get close to half the number of tosses.” The proportion converges; the count need not. The difference between the number of heads and n/2n/2 typically grows like n\sqrt{n} (its standard deviation is 0.5n0.5\sqrt{n}). In the figure, after 2,000 tosses the four runs are off by +10, −11, −8 and −15 heads, yet their proportions are all within 0.008 of 0.5.

“The law of large numbers says the average is approximately normal.” That is the central limit theorem, a different and more detailed result. The law of large numbers says where the average goes (to μ\mu). The central limit theorem describes the shape and size of its fluctuations around μ\mu along the way.

“With enough data, any average is accurate.” Only if the data are independent draws from the process you care about. A huge biased sample converges, reliably, to the wrong answer.

Further reading