Skip to main content
Home/Tools/Law of Large Numbers

Law of Large Numbers

Watch the law of large numbers in action: flip a coin thousands of times and see the running proportion of heads converge to 0.5 in real time.

100% Private - Runs Entirely in Your Browser
No data is sent to any server. All processing happens locally on your device.

What the Law of Large Numbers Says

The law of large numbers (LLN) is one of the foundational results of probability theory. In plain language, it says that as you repeat a random experiment more and more times, the average of the results you observe gets closer and closer to the true expected value. The simulator above makes this concrete: each trial is a single coin flip, and the line chart tracks the running proportion of heads as the number of flips grows. Run it for 10 flips and the proportion bounces wildly between 0.2 and 0.8. Run it for 10,000 and the line settles into a tight band around 0.5.

Formally, if you flip a fair coin n times and count heads, the proportion of heads p̂ = (heads) / n converges to the true probability p = 0.5 as n grows without bound. The same logic applies to any repeated random process with a well-defined average: dice rolls converge to 3.5, a roulette wheel's red frequency converges to 18/38, and a survey's sample mean converges to the population mean.

Why the Running Proportion Converges

The intuition is about scale, not cancellation. Early on, a single lucky streak of heads can swing the proportion dramatically because you are dividing by a small number. After 10 flips, three extra heads moves the proportion from 0.5 to 0.8. After 10,000 flips, those same three extra heads barely register — you would be dividing by 10,000 instead of 10.

As the denominator grows, each new flip carries less and less weight, so the proportion stops lurching and starts hugging the true value. The deviations do not disappear; they simply become a smaller and smaller fraction of the total. This is why the chart looks like a noisy zig-zag that gradually funnels toward the horizontal target line at 0.5. Mathematically, the standard deviation of the sample proportion shrinks in proportion to 1/√n, so quadrupling the number of flips roughly halves the typical wobble.

The Most Common Misconception: the Gambler's Fallacy

Here is the trap almost everyone falls into. After seeing five heads in a row, it feels like tails is "due" — as if the coin owes the universe some tails to balance the books. This is the gambler's fallacy, and it is wrong. A fair coin has no memory. The probability of heads on the next flip is still exactly 0.5, no matter what came before.

The law of large numbers does not work by forcing a compensating run of tails. It works by dilution. The early surplus of heads is never cancelled out — it is simply overwhelmed by the sheer volume of later flips, which split close to 50/50. Five extra heads is a big deal out of 10 flips and a rounding error out of 100,000. Convergence comes from drowning the imbalance in data, not from reversing it. Watch the simulator: even when an early streak pushes the line high, it does not dive back down to "catch up" — it just gradually flattens toward 0.5 as more flips pile on.

A Worked Coin Example

Suppose your first 10 flips give 8 heads. Your running proportion is 0.80 — far from 0.5. Now flip 90 more times and get a typical 45 heads. Your totals are 53 heads out of 100, a proportion of 0.53. The early imbalance is still there (you still have those 8 early heads), but it has been diluted from "8 out of 10" down to a small piece of "53 out of 100." Flip 900 more and land near 450 heads: now you have roughly 503 / 1000 = 0.503. The same fixed surplus keeps shrinking as a share of the whole. That is the law of large numbers, flip by flip.

Using This in the Classroom

This page is built as a teaching aid. Set the run count to 10, then 100, then 10,000, and let students predict where the line will end up before each run. Use the Export PNG button to drop the converging chart straight into a slide deck or worksheet, or copy the embed code to put the live simulator on a class site. The deviation readout makes a good discussion prompt: ask why the absolute number of excess heads can keep growing even as the proportion marches toward 0.5. That single distinction — counts diverge, proportions converge — is the heart of the law of large numbers, and it is exactly the idea the gambler's fallacy gets backwards.

Loading interactive tool...

What the Law of Large Numbers Says

The law of large numbers (LLN) is one of the foundational results of probability theory. In plain language, it says that as you repeat a random experiment more and more times, the average of the results you observe gets closer and closer to the true expected value. The simulator above makes this concrete: each trial is a single coin flip, and the line chart tracks the running proportion of heads as the number of flips grows. Run it for 10 flips and the proportion bounces wildly between 0.2 and 0.8. Run it for 10,000 and the line settles into a tight band around 0.5.

Formally, if you flip a fair coin n times and count heads, the proportion of heads p̂ = (heads) / n converges to the true probability p = 0.5 as n grows without bound. The same logic applies to any repeated random process with a well-defined average: dice rolls converge to 3.5, a roulette wheel's red frequency converges to 18/38, and a survey's sample mean converges to the population mean.

Why the Running Proportion Converges

The intuition is about scale, not cancellation. Early on, a single lucky streak of heads can swing the proportion dramatically because you are dividing by a small number. After 10 flips, three extra heads moves the proportion from 0.5 to 0.8. After 10,000 flips, those same three extra heads barely register — you would be dividing by 10,000 instead of 10.

As the denominator grows, each new flip carries less and less weight, so the proportion stops lurching and starts hugging the true value. The deviations do not disappear; they simply become a smaller and smaller fraction of the total. This is why the chart looks like a noisy zig-zag that gradually funnels toward the horizontal target line at 0.5. Mathematically, the standard deviation of the sample proportion shrinks in proportion to 1/√n, so quadrupling the number of flips roughly halves the typical wobble.

The Most Common Misconception: the Gambler's Fallacy

Here is the trap almost everyone falls into. After seeing five heads in a row, it feels like tails is "due" — as if the coin owes the universe some tails to balance the books. This is the gambler's fallacy, and it is wrong. A fair coin has no memory. The probability of heads on the next flip is still exactly 0.5, no matter what came before.

The law of large numbers does not work by forcing a compensating run of tails. It works by dilution. The early surplus of heads is never cancelled out — it is simply overwhelmed by the sheer volume of later flips, which split close to 50/50. Five extra heads is a big deal out of 10 flips and a rounding error out of 100,000. Convergence comes from drowning the imbalance in data, not from reversing it. Watch the simulator: even when an early streak pushes the line high, it does not dive back down to "catch up" — it just gradually flattens toward 0.5 as more flips pile on.

A Worked Coin Example

Suppose your first 10 flips give 8 heads. Your running proportion is 0.80 — far from 0.5. Now flip 90 more times and get a typical 45 heads. Your totals are 53 heads out of 100, a proportion of 0.53. The early imbalance is still there (you still have those 8 early heads), but it has been diluted from "8 out of 10" down to a small piece of "53 out of 100." Flip 900 more and land near 450 heads: now you have roughly 503 / 1000 = 0.503. The same fixed surplus keeps shrinking as a share of the whole. That is the law of large numbers, flip by flip.

Using This in the Classroom

This page is built as a teaching aid. Set the run count to 10, then 100, then 10,000, and let students predict where the line will end up before each run. Use the Export PNG button to drop the converging chart straight into a slide deck or worksheet, or copy the embed code to put the live simulator on a class site. The deviation readout makes a good discussion prompt: ask why the absolute number of excess heads can keep growing even as the proportion marches toward 0.5. That single distinction — counts diverge, proportions converge — is the heart of the law of large numbers, and it is exactly the idea the gambler's fallacy gets backwards.

Need help shipping something?

Productized MVP development for founders. 9 SaaS apps shipped — yours could be next, in 6 weeks.

Frequently Asked Questions

Common questions about the Law of Large Numbers

It says that the more times you repeat a random experiment, the closer the average of your results gets to the true expected value. Flip a fair coin a handful of times and the share of heads can be anything; flip it tens of thousands of times and that share settles tightly around 0.5. The simulator on this page shows the running proportion of heads converging to 0.5 in real time.

No. That belief is the gambler's fallacy. A fair coin has no memory, so after any streak the next flip is still 50/50. The law of large numbers does not force a compensating run to balance things out. Instead, an early imbalance gets diluted: it becomes a smaller and smaller fraction of the total as more flips accumulate. Convergence happens by drowning the surplus in data, not by reversing it.

Because the proportion divides by the number of trials, which keeps growing. The absolute number of excess heads can actually drift further from zero over time, yet when you divide it by an ever-larger denominator it shrinks toward zero. Counts can diverge while proportions converge. The standard deviation of the sample proportion falls off like 1 over the square root of n, so more trials mean a tighter band around the true value.

The law of large numbers tells you WHERE a sample average lands as the sample grows: on the true mean. The central limit theorem tells you the SHAPE of the distribution of that average: approximately normal (a bell curve), regardless of the underlying distribution. LLN is about convergence to a single value; CLT is about the bell-shaped spread of sample means around it. See our central limit theorem demo for the companion idea.

There is no fixed cutoff, but the typical wobble shrinks like 1 over the square root of the number of trials. To halve the expected error you need about four times as many trials. For a fair coin, a few hundred flips usually keeps the proportion within a few percent of 0.5, while tens of thousands pin it down tightly. Try the 100, 1,000, and 10,000 presets in the simulator to see the band narrow.

The simulator illustrates the practical content shared by both. The weak law says the sample average is very likely to be close to the true mean for large samples; the strong law says the running average will, with probability one, eventually settle on the true mean and stay near it. For an intuitive coin demo the distinction rarely matters; both predict the line converging to 0.5 that you see on screen.

ℹ️ Disclaimer

This tool is provided for informational and educational purposes only. All processing happens entirely in your browser - no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results. Use at your own discretion.