Law Of Large Numbers Demo

Simulate dice rolls or coin flips and watch the running average converge to the expected value as trials increase.

Use the Law Of Large Numbers Demo

Simulation Settings

500
10 1,000 2,000
Trials
0
Running Avg
—
Expected
3.50
Deviation
—

Running Average vs. Expected Value

Running avg Expected

Press "Run Simulation" or "Step (+1)" to begin.

Summary

The law of large numbers is a fundamental theorem in probability that states as the number of trials increases, the sample average converges to the expected (theoretical) value. This interactive demo lets you roll dice or flip coins and watch the running average plotted in real time against the expected value, making the concept tangible and intuitive.

How it works

  1. Choose an experiment: a six-sided die (expected average 3.5) or a fair coin (heads = 1, tails = 0, expected average 0.5).
  2. Set the number of trials per run using the slider (up to 2,000).
  3. Click "Run Simulation" to instantly generate all trials and plot the running average.
  4. The chart shows each trial on the x-axis and the cumulative average on the y-axis.
  5. A dashed line marks the theoretical expected value so you can see convergence visually.
  6. Use "Step" to add one trial at a time, or "Reset" to start over.

Use cases

  • Teaching probability and statistics to students.
  • Demonstrating why casinos always win in the long run.
  • Illustrating why sample size matters in research.
  • Showing how insurance risk pools become predictable at scale.
  • Understanding why poll averages become more accurate with more respondents.
  • Exploring the difference between short-run randomness and long-run predictability.

Frequently Asked Questions

Last updated: 2026-05-28 · Reviewed by Nham Vu