Law of Large Numbers (LLN)

Watch sample averages stabilize towards the true expected value as trials grow

Mathematical Statement

Let $X_1, X_2, \dots, X_n$ be independent and identically distributed (i.i.d.) random variables with finite expected value $\mathbb{E}[X] = \mu$. Then the sample average $\bar{X}_n = \frac{1}{n} \sum_{i=1}^n X_i$ converges to $\mu$:

$$\lim_{n \to \infty} P(|\bar{X}_n - \mu| \ge \varepsilon) = 0 \quad (\text{Weak Law})$$ $$P\left(\lim_{n \to \infty} \bar{X}_n = \mu\right) = 1 \quad (\text{Strong Law})$$

In Plain English

As you repeat an experiment more and more times, the average of your results will get closer and closer to the theoretical expected value.

Interactive Simulation

Expected Value (μ) —
Final Average (Path 1) —
Absolute Error (|X̄ - μ|) —
Total Trials (n) —

LLN vs. Central Limit Theorem: What's the Difference?

Aspect Law of Large Numbers (LLN) Central Limit Theorem (CLT)
Question Answered Where does the sample average converge? How is the error distributed around the target?
Core Result $\bar{X}_n \to \mu$ (converges to a single point) $\sqrt{n}(\bar{X}_n - \mu) \to N(0, \sigma^2)$ (bell-shaped distribution)
Visualization A line chart funneling towards $\mu$ over time A histogram forming a bell curve
Rate of Convergence Guarantees convergence Gives the exact rate ($1/\sqrt{n}$)

Key Insights & Pitfalls

🎯 The Funnel Effect

Early on ($n < 50$), individual streaks can cause wild fluctuations in the running average. As $n$ reaches hundreds or thousands, individual deviations get "diluted" by the massive denominator, forcing the line to hug $\mu$.

⚠️ The Gambler's Fallacy: LLN does NOT "compensate"

If you flip 10 heads in a row, the next flip is still 50%. The Law of Large Numbers does not work by "making tails more likely to balance things out." It works through dilution: adding 10,000 more fair flips makes those first 10 heads completely negligible in the average.

❌ When LLN Fails: The Cauchy Distribution

Select the Cauchy distribution in the dropdown above. Because Cauchy random variables have heavy tails and no defined finite mean, the running average will violently jump whenever an extreme value is encountered — it will never settle down!

← Central Limit Theorem 🏠 All Experiments