Why does the Central Limit Theorem matter for ML and statistics?
Written by the mlprep team · Updated
Explain the Central Limit Theorem in plain terms. Why does it matter for A/B testing, confidence intervals, and building ML systems? When does it break down?
What CLT says#
Take any distribution with mean μ and finite variance σ². Draw samples of size n and compute the sample mean X̄. As n → ∞, the distribution of X̄ approaches:
X̄ ~ N(μ, σ²/n)
This holds regardless of the shape of the original distribution — uniform, exponential, bimodal, whatever. The sampling distribution of the mean becomes normal.
Why this is powerful#
It decouples "what distribution is my data?" from "can I do inference?". You don't need to know the true data distribution. If your sample is large enough, the sample mean is approximately normally distributed, which means you can:
- Construct confidence intervals: X̄ ± 1.96 · σ/√n covers 95% of sample means
- Run z-tests and t-tests
- Compute p-values using normal or t-distribution tables
This is why essentially all classical frequentist inference works: it relies on CLT as its foundation.
In A/B testing#
When you compare conversion rates between control and treatment, you're comparing two sample means (or proportions — which are means of 0/1 variables). CLT lets you assume those means are normally distributed, enabling the z-test:
z = (X̄_treatment - X̄_control) / SE_diff
Without CLT, you'd need to know the exact distribution of your metric to do hypothesis testing. With CLT, you only need a large enough sample.
Standard error = σ/√n#
The CLT tells you the spread of the sampling distribution: σ/√n. This is the standard error — how much sample means vary from sample to sample. Key implication: doubling sample size halves the standard error (not halves the variance — halves the SE). Precision grows slowly.
When CLT breaks down#
Heavy-tailed distributions: if σ² is infinite (Pareto with α ≤ 2, Cauchy), CLT doesn't apply. Sample means don't converge to normal. Revenue metrics, session length, and file sizes are often heavy-tailed — this is why median-based tests or log transforms are used for these metrics.
Small n: "n=30 is enough" is a myth. For symmetric, light-tailed distributions, n=30 is often fine. For skewed distributions (binary events with p=0.001), you may need n=10,000+ before the normal approximation is reasonable.
Correlated samples: CLT assumes i.i.d. samples. Time series data, spatially correlated data, and clustered data violate this. Standard error estimates are wrong — typically underestimated, inflating false positive rates.
ML connection#
- Loss functions averaged over a mini-batch are approximately normally distributed by CLT — this is why stochastic gradient estimates have manageable variance
- Ensemble methods (bagging, random forests) work partly through variance reduction: averaging n predictions reduces variance by σ²/n per CLT
- Evaluation metrics on a test set are estimates subject to CLT-driven standard errors — a 0.1% accuracy improvement with no error bars is meaningless
Interview red flags#
- Saying the CLT makes the data itself normal. It is about the sampling distribution of the mean.
- Applying it blindly to heavy-tailed metrics like revenue, where convergence can need far larger samples.
- Ignoring correlated observations, such as multiple sessions from the same user, which break the independence assumption.
- Forgetting that standard error scales with 1/√n, so halving it takes four times the data.
The key takeaway unlocks after you reveal an expert answer.
Key Takeaway
CLT: sample means of any finite-variance distribution converge to N(μ, σ²/n) as n grows. This is why z-tests, t-tests, and confidence intervals work without knowing the true data distribution. Standard error = σ/√n — halving it requires 4× more data. Breaks down for heavy-tailed distributions (revenue, session time), very small n on skewed data, and correlated observations. Foundation of all frequentist inference and A/B testing.
Follow-up Questions to Test Yourself
Interviewers often pivot here once you cover the core concept.
- Why does averaging predictions in an ensemble reduce variance, and what does CLT have to do with it?
- When would you use a bootstrap confidence interval instead of a CLT-based one?
- How does the CLT break down when your metric has a heavy tail, and what alternatives exist?
How confident do you feel explaining this?
Track your understanding or flag it to revisit before your next loop.
Related Questions
What happens step-by-step inside an LLM during token generation?
How does continuous batching work and why does static batching waste GPU utilization?
How does prefix caching (RadixAttention) speed up multi-turn and agentic LLM workloads?
Walk me through post-training quantization for LLM serving: INT8, INT4 (AWQ/GPTQ), and FP8 trade-offs