Math paradoxes

Glossary / Law of large numbers

Glossary · law of large numbers

Heads settle at half, yet tails fall further behind?

During the Second World War the mathematician John Kerrich found himself in an internment camp in Denmark and flipped a coin 10,000 times. He got 5,067 heads, that is 50.67%: almost exactly half. But counted in coins, heads were 134 ahead of tails. The longer you flip, the closer the share gets to half, while the gap in coins usually just grows. Both facts are true at once, and that is the heart of the law of large numbers.

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

The coin paradox

Five people each flip their own coin. The top chart shows each person's share of heads: the lines squeeze towards 50%. The bottom one shows by how many coins heads are ahead of tails: the lines usually spread away from zero. These are the same flips, only counted differently.

Flips each0
Shares of heads–
Average gap, coins–

The flips axis is logarithmic: each mark is ten times further than the previous one. At most 100,000 flips per person.

It doesn't correct, it dilutes

Say 8 of the first 10 flips came up heads: that's 80%. The coin remembers nothing, so from then on heads and tails come equally on average. The 6 extra heads never go away, but they drown in an ever larger number of new flips:

10 flips80%
100 flips53%
1,000 flips50.3%
10,000 flips50.03%
a million flips50.0003%

Nobody "pays back" the debt with tails. The share approaches half only because the old surplus becomes an ever smaller part of the whole.

Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

What exactly the law promises

Repeat the same trial many times, with the attempts not affecting one another. An event has probability p. Then the share of attempts in which it happens approaches p as the number of attempts n grows. More precisely: however small a tolerance you pick, 1% or 0.1%, the chance of falling outside it goes to zero.

  • Promises: the share → pThe share of heads in a long series is almost surely close to 50%.
  • Doesn't promise: the gap → 0The difference between heads and tails in coins usually grows. It just grows more slowly than the number of flips.
  • Doesn't promise: "tails is due now"The next flip knows nothing of the previous ones. The law works through dilution, not correction.
  • Promises nothing for small nThe law is about what happens in the long run. Over a short stretch it guarantees nothing.

Try it: 200 players

Now it's 200 people instead of five, each flipping a coin n times. At the top is everyone's share of heads, at the bottom heads minus tails in coins. Move the slider: the top cloud shrinks, the bottom one spreads.

Average distance of the share from 50%–
Average gap, coins–
Another 200 players

Small samples lie: two hospitals

This is a classic problem by the psychologists Daniel Kahneman and Amos Tversky. One hospital has 15 births a day, another 45. Boys and girls are born about equally often. Where will there be more days in a year with over 60% boys? Most people answer "the same". Check it: each cell is one day, a filled cell is a day with more than 60% boys.

Small hospital, 15 a day–
Large hospital, 45 a day–
Another year

The small hospital usually has twice as many such days: the exact calculation gives 55 days a year on average against 25. A small sample lands on extremes more often. That is why small schools, villages and teams so often turn up among both the best and the worst of any ranking: not always because they are special, but because they have few people.

When to rely on the law

  • The casino is calmEach bet gives the casino a small edge. Millions of independent bets turn it into almost guaranteed income: the house's share of wins sticks to its probability.
  • So is the insurer, while risks are independentThousands of houses that burn independently of one another give a predictable total of payouts. A flood or an earthquake hits all of them at once, and then the law doesn't help: the attempts are no longer independent.
  • It won't help a player in one eveningA few hundred bets are too few: luck decides the result. The law works for whoever makes millions of bets, that is, the casino.
  • Don't draw conclusions from a few casesThree good deals, five reviews, one hospital with 15 births a day: all small samples, and extremes are routine in them.
Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

How spread out the share is

σshare = √( p(1 − p) / n )

For a coin p = ½, so the spread of the share of heads is 0.5/√n: 5 percentage points after 100 flips, only 0.5 after 10,000. To make the share ten times more precise you need a hundred times more flips. In the 200-player simulation n = – right now: the formula gives –, and the players got –.

Why the gap grows like √n

H − T = 2H − n · σ(H − T) = √n · E|H − T| ≈ √(2n/π) ≈ 0.8 √n

Each flip adds +1 or −1 to the difference, and these steps are independent. The spreads of independent steps add up, so after n steps the spread of the difference is √n. So the typical gap is about 8 coins after 100 flips and about 80 after 10,000. But divide by the number of flips: 8 out of 100 is 8%, 80 out of 10,000 just 0.8%. The gap grows, but more slowly than n, so the share still converges to half. Kerrich's gap of 134 with σ = 100 is a perfectly ordinary result. In the 200-player simulation at n = – the formula gives – coins, and the average came out at –.

The idea of the proof: Chebyshev's inequality

P( |X̄ − p| ≥ ε ) ≤ p(1 − p) / (n ε²)

Pafnuty Chebyshev proved a simple thing: a quantity rarely strays from its mean by more than a few spreads. The chance of straying by ε is at most the variance divided by ε². The variance of the share is p(1 − p)/n and falls as n grows, so for any ε the chance of falling outside the tolerance goes to zero. That is the law of large numbers. Take ε = 5 points: for a coin the bound is 100/n. At n = – Chebyshev guarantees that at most – of the players end up more than 5 points from 50%, and in the simulation it is –. The bound is crude, but it works for any independent identical trials, not just coins.

Where it shows up

Other terms