Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Flip a coin many times
Flip a coin 10 times and you might get 7 heads: 70%. Flip it 10,000 times and you’ll get very close to 50% heads. It’s never exact, but closer and closer the more you flip. This is the law of large numbers: the average of many independent tries settles down to the true average.
It’s why casinos always win in the long run, why insurance works, and why a robot can learn how long a task takes by averaging many attempts.
Monte Carlo simulation, training a network on a dataset, estimating a robot policy’s success rate from trials, and calibrating a sensor by repeated measurements all rest on one promise: averages of many samples approach the true expectation. The LLN is that promise, and its conditions tell you when it breaks.
- 1. After 10,000 fair coin flips, the fraction of heads is…
- 2. Averaging more independent measurements makes the average…
- 3. The LLN is about the average of…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Statement
Let be iid with mean , and let .
- Weak LLN: for every , . This is convergence in probability.
- Strong LLN: . Each run’s average converges, almost surely.
How fast? Like 1/√n
If , then and . The typical error is the standard error . Ten times more accuracy costs a hundred times more samples. This holds in any dimension, which is why Monte Carlo beats grids in high dimensions.
Monte Carlo integration
Estimating by throwing darts at a square is the classic example.
- 1. Var(X̄ₙ) =
- 2. To halve a Monte Carlo error you need about…
- 3. The strong LLN is about convergence…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Proof of the weak law (finite variance)
Chebyshev’s inequality (A4.3-6) gives
That’s the whole proof. It also gives a (loose) sample size: guarantees . Only uncorrelated samples with bounded variance are needed, not full independence.
When averaging fails
- No mean. For the Cauchy, has the same distribution as one sample (A4.3-3). Averaging gives you nothing.
- Infinite variance. A Pareto with still obeys the LLN, but convergence is slow and erratic, because rare huge values dominate. Heavy-tailed costs (rare catastrophic failures) are exactly where naive averaging misleads.
- Dependence. Correlated samples, such as consecutive frames or MCMC chains, reduce the effective sample size to .
What it justifies in ML
Empirical risk for each fixed . Learning theory needs this uniformly over a class of . The simplest uniform LLN is Glivenko–Cantelli, a.s., with the explicit DKW rate (Practice Code 5).
- 1. The weak LLN follows in one line from…
- 2. The mean of 1000 standard Cauchys is…
- 3. Correlated samples have an effective sample size that is…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Proof of the strong law (finite fourth moment)
Assume , and centre so . Let .
- Fourth moment of the sum. Expand . Terms with any index appearing once vanish. What’s left is .
- Markov’s inequality. .
- Borel–Cantelli. , so with probability 1 only finitely many of the events occur.
- Conclude. Take for every (a countable intersection of probability-1 events): almost surely. ∎
Etemadi (1981) proved the strong law assuming only and pairwise independence. Kolmogorov’s version says that for iid variables, is also necessary.
Borel–Cantelli lemma
If then . Proof: . Conversely, if the are independent and , then .
Weak vs strong
The weak law allows each path to make rare excursions forever, as long as they become less likely at each fixed . The strong law forbids that: eventually every path stays within . A4.3-8 gives an example that converges in probability but not almost surely.
Exercise 3.1: Show Var(X̄ₙ) = σ²/n needs only uncorrelated samples
when all covariances are 0. Divide by .
- 1. Borel–Cantelli: if Σ P(Aₙ) < ∞ then…
- 2. The 4th-moment proof bounds P(|X̄ₙ| > ε) by…
- 3. For iid samples, the strong LLN needs…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Stochastic approximation: averaging online
A robot learns the expected energy of a mission by updating after each rollout . With this is exactly the running mean, so the strong LLN applies. Robbins and Monro (1951) showed convergence whenever (you can always move far enough) and (the noise eventually averages out). A constant step size never converges: it settles into a noise floor with variance . That’s a feature when the environment drifts. These are the same conditions behind SGD, TD learning and Q-learning (Sutton and Barto, 2018).
The LLN in AI, robotics and aerospace
- Policy evaluation. Monte Carlo returns averaged over episodes converge to the value function (first-visit MC). TD learning is a stochastic-approximation version of this.
- Empirical risk minimization is justified by uniform laws of large numbers over the hypothesis class (Vapnik, 1998). Without uniformity, overfitting breaks the link between training and test error.
- Particle filters approximate posterior expectations with weighted averages over particles. The LLN for interacting particle systems makes them consistent as the particle count grows (Del Moral, 2004).
- Reliability demonstration. Estimating a failure rate from trials converges, but slowly for rare events: you need on the order of trials just to see one failure. That motivates importance sampling (A4.3-1).
- MCMC relies on ergodic theorems, LLNs for dependent Markov-chain samples (A4.4-1). The effective sample size quantifies how much the dependence costs.
References
- R. Durrett (2019). Probability: Theory and Examples, 5th ed., Ch. 2. Cambridge University Press.
- J. Bernoulli (1713). Ars Conjectandi. Basel.
- A. N. Kolmogorov (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung. Springer.
- N. Etemadi (1981). “An elementary proof of the strong law of large numbers.” Z. Wahrscheinlichkeitstheorie, 55.
- H. Robbins, S. Monro (1951). “A stochastic approximation method.” Annals of Mathematical Statistics, 22(3).
- A. Dvoretzky, J. Kiefer, J. Wolfowitz (1956). “Asymptotic minimax character of the sample distribution function.” Annals of Mathematical Statistics, 27(3); constant fixed by P. Massart (1990), Annals of Probability, 18(3).
- V. Vapnik (1998). Statistical Learning Theory. Wiley.
- R. Sutton, A. Barto (2018). Reinforcement Learning: An Introduction, 2nd ed. MIT Press.
- P. Del Moral (2004). Feynman–Kac Formulae: Genealogical and Interacting Particle Systems. Springer.
- H. Kushner, G. Yin (2003). Stochastic Approximation and Recursive Algorithms and Applications, 2nd ed. Springer.