Law of Large Numbers and Central Limit Theorem
Formal
Both theorems describe what happens to the sample mean as the number of i.i.d. observations .
(Law of Large Numbers)
Let be i.i.d. random variables with finite mean . The Weak LLN states that the sample mean converges in probability to :
That is, for any : .
The Strong LLN strengthens this to almost sure convergence:
(Central Limit Theorem)
Let be i.i.d. with mean and finite variance . Then the standardised sample mean converges in distribution to a standard Gaussian:
Equivalently: for large , regardless of the original distribution of .
Intuition
Think of running a distributed load test against your service. Each request produces a latency measurement .
- LLN says: average enough requests and the sample mean latency will converge to the true population mean. The noise in any individual measurement averages out. You can trust your benchmark.
- CLT says: not only does the average converge, but the distribution of the average becomes bell-shaped regardless of how bizarre the distribution of individual request latencies is. Even if latencies are highly skewed (Pareto-distributed), the mean of a batch of 1000 follows a Gaussian. You can build confidence intervals.
The key insight: CLT does not say individual are Gaussian. It says the aggregate (their mean) is.
ML Applications
- Justification for training loss — The empirical training loss is a sample mean. By LLN, it converges to the true expected loss as . This is the formal justification for why minimising training loss generalises.
- Stochastic gradient descent — The minibatch gradient is a sample mean of per-example gradients. LLN makes it an unbiased estimator of the true gradient; CLT characterises its noise as approximately Gaussian, justifying Gaussian noise models in SGD analysis.
- Gaussian noise assumption — Measurement errors, residuals in regression, weight perturbations — all are often modelled as Gaussian. The CLT provides the theoretical justification: errors are typically the sum of many small, independent effects.
- Bootstrap and confidence intervals — The CLT underlies the sampling distribution of estimators, enabling construction of confidence intervals for model parameters.
- Batch normalisation — Normalising activations within a minibatch uses sample mean and variance. The approximation works well because CLT ensures these are stable estimates.
Connections
- Forward Links:
- Backward Links: Expectation and Variance, Common Probability Distributions