Skip to content
mlmentorship

Central limit theorem

Sums of many independent random variables become Gaussian. Why nearly every error bar in ML and statistics is computed from a normal distribution.

Published · 4 min read ·Core ·Foundation

Visual quick review

Visual first · depth when needed

Distinguish the distribution of individual observations from the sampling distribution of the mean, and see why the latter becomes more Gaussian and narrows at rate 1/sqrt(n).

Preparing the visual…

Summary

If are i.i.d. with mean and finite variance , then as :

The standardized sample mean converges in distribution to a Gaussian, regardless of the original distribution’s shape (as long as variance is finite).

Learning objective: distinguish the unchanged distribution of individual observations from the sampling distribution of the mean, which becomes more Gaussian and narrows at rate .

What becomes Gaussian?

Repeated sample means change shape; the original observations do not.

A skewed population compared with sampling distributions of its mean Three aligned schematic density plots share the same population mean. The top row shows a right-skewed distribution for one observation X. The middle row shows the less skewed distribution across means of repeated samples of size four. The bottom row shows an approximately Gaussian and narrower distribution across means of repeated samples of size twenty-five. A vertical dashed line marks the unchanged mean mu, while the row labels state that standard error shrinks as sigma divided by the square root of n. same center μ ONE OBSERVATION X still skewed REPEATED MEANS X̄, n = 4 SE = σ / √4 REPEATED MEANS X̄, n = 25 SE = σ / √25 possible values of X or X̄
Read it this way: compare rows at the dashed mean. The top distribution remains skewed because it describes individual observations. Each lower curve describes means from many hypothetical samples of the stated size: it becomes more bell-shaped while its spread shrinks from σ to σ/√n. The curves are schematic and assume independent observations with finite variance. Definitions checked against OpenStax Introductory Statistics; the graphic is original.

The CLT is why we can:

  • Build Gaussian-based confidence intervals for almost any estimator (sample mean, regression coefficients, A/B test deltas).
  • Use -tests and -tests on data that isn’t itself Gaussian.
  • Trust that with enough samples, our reported metric ± std is approximately calibrated.

It also explains the prevalence of Gaussian assumptions in ML. Many quantities are sums or averages, and so naturally trend Gaussian.

What “enough samples” means

The Berry–Esseen theorem bounds how fast convergence happens:

with . For symmetric, light-tailed distributions, already gives an excellent Gaussian approximation. For heavy-tailed or skewed distributions you may need or more.

Heuristic check: plot a histogram of bootstrap means; if it looks Gaussian, the CLT has kicked in.

Variants

  • Multivariate CLT: for a vector-valued sum with covariance matrix .
  • Lyapunov / Lindeberg CLT: relaxes the i.i.d. assumption to independent (not identical) with mild moment conditions.
  • Martingale CLT: extends to dependent data forming a martingale; used in online learning regret analysis.
  • CLT for U-statistics, M-estimators: extends to functions of multiple samples.

When CLT fails

  • Infinite variance (e.g., Cauchy distribution): CLT does not apply; sample means do not concentrate. Use stable distributions instead.
  • Strong dependence: highly correlated samples violate the i.i.d. assumption; effective sample size is much less than .
  • Discrete distributions on small support: CLT applies but the discrete approximation may be visibly bad until is large.

Common pitfalls

  • Treating as universally enough. It is not for skewed or heavy-tailed data.
  • Using CLT on small sample sizes for inference. Below , prefer the -distribution (which uses the sample-estimated variance) rather than .
  • Using parametric CLT confidence intervals on data that isn’t independent. A/B tests with user-level dependence (one user, multiple events) have effective much smaller than event count; cluster-bootstrap or use mixed-effects models.
  • Confusing “the mean is normally distributed” with “the data is normally distributed.” The CLT is about the mean, not individual samples.