Skip to content

The law of large numbers

Watch twenty running averages of die rolls settle on 3.5 inside a narrowing funnel, and see why a streak never has to be paid back.

Helps to know firstSums of random variables

Helps to know first
This topic

First, the picture

Roll a die again and again and keep the running average. Twenty people do it at once. Guess where their averages go, then watch.

Averages settle down

Twenty players, each rolling a fair die 10 000 times (seeds 4100 to 4119).

Twenty players each roll a fair die again and again. Each path will be one player's running average.

rolls n
1
inside the funnel
20 of 20
spread of the 20
1.7146
σ/√n
1.7078

Predict first. Twenty players each roll a die thousands of times. What do their running averages do?

0.00 / 11.40 s
Describe this picture

Before the clip, three small sketches ask for a guess: the twenty averages “all end exactly on 3.5”, “stay in a narrowing funnel” or “keep wandering the same”; a tap starts the clip. Then twenty paths are drawn left to right, each the running average of its own player’s seeded rolls of a fair die, against the number of rolls nn on an axis marked 1, 10, 100, 1000 and 10 000, each mark ten times the last. A line marks the mean, 3.5. A dashed funnel labelled “3.5 ± 2σ/√n” shows 3.5±2σX/n3.5\pm2\sigma_X/\sqrt n with σX=1.7078\sigma_X=1.7078: its half-width is 1.080 at n=10n=10, 0.342 at 100, 0.108 at 1000 and 0.034 at 10 000. The paths start far apart and close in, nearly all inside the funnel; after 10 000 rolls the twenty lie between 3.469 and 3.522, all inside. At the end your guess is drawn dotted. Readouts give nn, how many of the twenty lie inside the funnel, their measured spread and σX/n\sigma_X/\sqrt n. After the clip a slider, “Rolls, n”, moves a cursor along nn and the readouts follow; at n=100n=100 the spread is 0.1487 against 0.1708, with 19 of 20 inside.

Averages settle down

What did you guess? The paths did not land exactly on 3.5, and they did not keep wandering. Each one closed in on 3.5, fast at first and then more slowly, and nearly all stayed inside the dashed funnel: one of the twenty was outside it at 10, 100 and 1000 rolls, and all twenty were inside at 10 000.

That is the law of large numbers: the average of many independent draws settles on the mean. It is why a casino can count on its share of every bet, and why a poll of a thousand people says something about millions. This page says how fast the average settles, and what the law does not promise.

How fast

One roll of a fair die has mean μX=3.5\mu_X=3.5 and variance σX2=35/12\sigma_X^2=35/12, so its spread is σX=1.7078\sigma_X=1.7078, as in Variance and standard deviation. The average of nn rolls is

Xˉn=X1+X2+⋯+Xnn.\bar X_n=\frac{X_1+X_2+\cdots+X_n}{n}.

Its mean is 3.5, because each roll has mean 3.5. For its spread, use the rule from Sums of random variables: for independent draws, variances add. The sum of nn rolls has variance nσX2n\sigma_X^2. Dividing the sum by nn divides the variance by n2n^2. So

Var{Xˉn}=σX2n,spread of Xˉn=σXn.\mathrm{Var}\{\bar X_n\}=\frac{\sigma_X^2}{n},\qquad\text{spread of }\bar X_n=\frac{\sigma_X}{\sqrt n}.

That square root is the shape of the funnel. Ten times as many rolls shrink the spread by 10\sqrt{10}, about 3.16. To halve it you need four times as many rolls. The dashed funnel in the picture is two spreads either side of 3.5: about 19 of the 20 paths should lie inside it at any nn. Drag the cursor after the clip and compare the count.

Markov and Chebyshev inequalities

“About 19 of 20 within two spreads” uses the bell shape of the averages, which the page The central limit theorem explains. Can I promise anything without it? Yes, with two short inequalities.

Markov’s inequality. If XX is never negative, then for any a>0a>0

Pr⁡{X≥a}≤E{X}a.\Pr\{X\ge a\}\le\frac{\mathbb{E}\{X\}}{a}.

The reason: the draws that are at least aa alone contribute at least a⋅Pr⁡{X≥a}a\cdot\Pr\{X\ge a\} to the mean, and the others contribute nothing negative. For a die, Pr⁡{X≥6}≤3.5/6=0.583\Pr\{X\ge6\}\le3.5/6=0.583. The true value is 16=0.167\tfrac16=0.167. The bound is safe but loose.

Chebyshev’s inequality. Apply Markov’s inequality to the squared distance from the mean, (X−μX)2(X-\mu_X)^2, whose mean is σX2\sigma_X^2. For any k>0k>0,

Pr⁡{∣X−μX∣≥k σX}≤1k2.\Pr\{\lvert X-\mu_X\rvert\ge k\,\sigma_X\}\le\frac1{k^2}.

It holds for every shape. For a die, a distance of at least 2.5 from 3.5 is k=2.5/1.7078k=2.5/1.7078 spreads, and the bound is σX2/2.52=2.917/6.25=0.467\sigma_X^2/2.5^2=2.917/6.25=0.467. The truth is 26=0.333\tfrac26=0.333, the rolls 1 and 6.

The weak law. Now apply Chebyshev’s inequality to the average Xˉn\bar X_n, whose variance is σX2/n\sigma_X^2/n. Write ε\varepsilon for a small distance you will accept, such as 0.1. Then

Pr⁡{∣Xˉn−μX∣≥ε}≤σX2n ε2,\Pr\{\lvert\bar X_n-\mu_X\rvert\ge\varepsilon\}\le\frac{\sigma_X^2}{n\,\varepsilon^2},

and the right-hand side falls to 0 as nn grows. However small you make ε\varepsilon, the chance that the average misses by more than ε\varepsilon can be made as small as you like by rolling enough. That is the weak law of large numbers.

What the law does not promise

A fair coin has landed heads five times in a row. Is tails now due? Many people feel it must be: the coin has to catch up. It does not. The coin has no memory, as the page Independence showed, and the next flip is still even odds.

Then how does the average settle? Not by paying back the streak, but by burying it. After five heads, the next thousand flips are about half heads, and five extra heads in a thousand barely move the share.

The counts themselves do not even out. After n=10 000n=10\,000 flips, the share of heads has a spread of 0.25/10 000=0.005\sqrt{0.25/10\,000}=0.005, so it is within 0.010.01 of one half about 95 % of the time. But the gap between heads and tails, the count of heads minus the count of tails, is typically about 2n/π≈80\sqrt{2n/\pi}\approx80, and it keeps growing as n\sqrt n. The share settles; the gap does not.

The law also says nothing about the next draw. It is about averages of many draws, never about one.

Worked example

How many rolls? You want the average of your die rolls to be within 0.10.1 of 3.53.5, with a chance of about 95 %.

  1. With the bell. Two spreads should be 0.1: 2σX/n=0.12\sigma_X/\sqrt n=0.1, so n=2⋅1.7078/0.1=34.16\sqrt n=2\cdot1.7078/0.1=34.16 and n=1166.7n=1166.7. Round up: 1167 rolls.
  2. With Chebyshev’s guarantee. Ask for a miss chance of at most 0.05: σX2/(n⋅0.12)≤0.05\sigma_X^2/(n\cdot0.1^2)\le0.05, so n≥2.917/(0.05⋅0.01)=5833.3n\ge2.917/(0.05\cdot0.01)=5833.3. Round up: 5834 rolls. That is safe for any shape, but five times more than the bell needs.
  3. The spread of 100 rolls. 1.7078/100=0.17081.7078/\sqrt{100}=0.1708.
  4. Halving the funnel. Four times as many rolls.
  5. After five heads. The next flip is still heads with chance 12\tfrac12.

Where you’ll meet this

A pollster who asks 1000 people a yes-or-no question is averaging 1000 draws of 0 or 1. The spread of the share is at most 0.25/1000=0.016\sqrt{0.25/1000}=0.016, and that sets the margin quoted with the poll.

A computer that estimates an area, a price or a probability by simulating random cases is relying on this law; to get one more correct digit, it needs a hundred times as many cases, because of the square root. An instrument that averages many noisy readings of the same quantity gains the same way. And a casino wins over many bets because its small edge is the mean, and the average of thousands of bets settles on it.

In signal processing · averaging noisy estimates

The page Averaged periodograms: Bartlett and Welch estimates a spectrum by averaging the spectra of many short pieces of a signal. Averaging KK independent pieces divides the variance of the estimate by KK, the σX2/n\sigma_X^2/n of this page.

Where this leads · the mean as a projection

Of all lists (c,c,…,c)(c,c,\dots,c), the one closest to nn numbers is (xˉ,xˉ,…,xˉ)(\bar x,\bar x,\dots,\bar x): the average times the all-ones list. That is a projection in the sense of Projections in the linear algebra course.

The funnel says how wide the pile of averages is. The page The central limit theorem shows what shape it has.

Reference card

QuantityFormulaNotes
AverageXˉn=(X1+⋯+Xn)/n\bar X_n=(X_1+\cdots+X_n)/nindependent draws, one shape
Its varianceVar{Xˉn}=σX2/n\mathrm{Var}\{\bar X_n\}=\sigma_X^2/nspread σX/n\sigma_X/\sqrt n
MarkovPr⁡{X≥a}≤E{X}/a\Pr\{X\ge a\}\le\mathbb{E}\{X\}/aX≥0X\ge0, a>0a>0
ChebyshevPr⁡{∣X−μX∣≥kσX}≤1/k2\Pr\{\lvert X-\mu_X\rvert\ge k\sigma_X\}\le1/k^2any shape
Weak lawPr⁡{∣Xˉn−μX∣≥ε}≤σX2/(nε2)\Pr\{\lvert\bar X_n-\mu_X\rvert\ge\varepsilon\}\le\sigma_X^2/(n\varepsilon^2)falls to 0 as nn grows
Sizing nnn=(2σX/ε)2n=(2\sigma_X/\varepsilon)^2about 95 %, with the bell
Countsheads minus tails grows like n\sqrt nthe share settles, the gap does not

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look