Law of large numbers, with a coin flip simulator

Flip a coin ten times and anything can happen. Flip it ten thousand times and the share of heads hardly budges from 50%.

Flips0
Share of heads—
Heads − tails0
00.250.50.751110

Number of flips on a log scale. The dashed funnel is where 95% of runs stay: it narrows as 1/√n.

What the law of large numbers says

As you repeat an independent random experiment more and more times, the average outcome gets closer to the expected value. For a fair coin the proportion of heads drifts towards 50%. Jacob Bernoulli proved the first version in Ars Conjectandi, published in 1713.

Look at the heads − tails box

After 10,000 flips the proportion is usually within about a percentage point of 50%, yet the raw difference between heads and tails is often 50 or 100 and can keep wandering further from zero. Both are true at once: the gap grows roughly like √n, but n grows much faster, so the gap as a share of all flips shrinks.

The gambler's fallacy

The law does not work by correcting streaks. A coin that just landed heads five times is not more likely to land tails next; each flip is still 50/50. Early streaks are simply swamped by the thousands of flips that follow. On 18 August 1913, black came up 26 times in a row at the Monte Carlo Casino, and gamblers lost heavily betting that red was "due".

Is a real coin flip 50/50?

Very nearly. Persi Diaconis and colleagues showed in 2007 that a flipped coin is slightly more likely to land the way it started, about 51%, and a 2023 experiment with over 350,000 flips found about 50.8%. Set the slider to 51% and see how many flips it takes before you could tell the difference.

The central limit theorem describes the shape of the wobble around the expected value, and the expected value calculator computes the number the average homes in on.

Still not clicking? Ask the tutor

An AI tutor that sees the numbers you entered above and explains them. It can make mistakes, so check anything important against the worked steps.

Questions students ask

What is the law of large numbers?

As the number of independent trials grows, the average result gets closer and closer to the expected value. For a fair coin, the proportion of heads approaches 0.5.

What is the probability of a coin flip landing heads?

For a fair coin, 1/2 on every flip, no matter what came before. A 2007 study by Diaconis, Holmes and Montgomery found real flips are very slightly biased towards the side facing up at the start, about 51%.

Does the law of large numbers mean a streak will even out?

No. That is the gambler's fallacy. The proportion converges because the huge number of later flips dilutes an early streak, not because the coin compensates. The count of heads minus tails can actually grow.

What is the difference between the law of large numbers and the central limit theorem?

The law of large numbers says the sample mean approaches the true mean. The central limit theorem describes the shape of the random variation around it: approximately normal.

Keep exploring