Probability
5. Inequalities & Limit Theorems
Law of Large Numbers

The Law of Large Numbers (LLN)

The Law of Large Numbers is a fundamental theorem in probability that describes the result of performing the same experiment a large number of times.

It mathematically proves what our intuition already tells us: over the long run, random events balance out to their expected averages.

Core Concept

There are two versions of the Law of Large Numbers (Weak and Strong), but both share the same practical application:

As the number of identically distributed, randomly generated variables increases, their sample mean (average) approaches their theoretical expected value (true mean).

Let Xˉn\bar{X}_n be the average of nn independent trials, and let μ\mu be the true expected value. As nn \to \infty, we have:

Xˉnμ\bar{X}_n \to \mu

Why Does This Matter?

  1. Casinos & Insurance: A casino doesn't know if the next person to play roulette will win or lose. But because of the LLN, they know with absolute mathematical certainty that if 100,000 people play, the casino will keep exactly 5.26% of the money bet.
  2. Machine Learning: We train neural networks over thousands or millions of iterations (epochs) because we rely on the LLN to average out noisy gradients and converge on a true optimal solution.

The Gambler's Fallacy

The LLN only applies to large numbers. It does not mean a small sample will perfectly balance out. If you flip a coin and get 5 Tails in a row, the LLN does not say that the next flip is "due" to be Heads. The coin has no memory. The LLN simply says that if you keep flipping 10,000 more times, those 5 initial Tails will be mathematically drowned out by the massive volume of new 50/50 flips.

Interactive Visualization: The Drunkard's Walk to the Mean

In this simulation, we are flipping a fair coin where the True Mean (Expected Value) is exactly 0.5. Click "Start Flipping Coin" to simulate flipping the coin rapidly.

Notice how wildly the running average swings in the beginning when the sample size is small. But as the number of flips crosses 100, 500, and 1000, the jagged line flattens out and stubbornly locks itself to the red dashed line (the true mean).

Law of large numbers

Flip a fair coin and watch the running average converge to 0.5.

Expected value
0.5
Running average after 0 flips: 0.0000

Test Your Knowledge

Example: Law of Large Numbers (Casino)

A roulette wheel has an expected value of -0.05perspinfortheplayer.Youplay10timesandsomehowwin0.05 per spin for the player. You play 10 times and somehow win 50. The casino owner isn't worried. Why does the LLN explain the casino's confidence?

View Step-by-Step Solution

The Law of Large Numbers states that as the number of trials (nn) approaches infinity, the actual sample average converges strictly to the theoretical Expected Value.

You only played n=10n=10 times. In small samples, variance rules and extreme outcomes (like you winning 50)arecommon.However,overthecourseofayear,thecasinowillsee50) are common. However, over the course of a year, the casino will see n = 1,000,000spins.TheLLNguaranteesthattheirprofitwillconvergeexactlytospins. The LLN guarantees that their profit will converge exactly to0.05 per spin, cementing their edge regardless of short-term anomalies.