Statistics ยท medium
Explain the Central Limit Theorem and why it matters.
Asked in Data Scientist interviews, in the Statistics round.
Short answer
Sample means approach normality as n grows, enabling inference regardless of population shape.
How to answer it
Definition
The average of many independent draws is approximately normally distributed, whatever the shape of the population it came from, once the sample is large enough. The mean of that bell curve is the population mean, and its standard deviation is the standard error.
The subtle part, and the part interviewers listen for, is what the theorem is about. It is not a claim that data becomes normal. It is a claim about the distribution of a statistic computed from the data.
Formula
mean(sample mean) = mu the population mean
sd(sample mean) = sigma / sqrt(n) the standard error
The sqrt(n) is the practical headline: to halve your uncertainty you need four times the data, not twice. That single fact drives most sample-size conversations.
Example
import numpy as np
rng = np.random.default_rng(0)
pop = rng.exponential(scale=50, size=1_000_000) # heavily skewed
means = [rng.choice(pop, 200).mean() for _ in range(5_000)]
print(round(np.mean(means), 2), round(np.std(means), 2))
Output
50.02 3.53 # centred on the population mean of 50, and
# 50 / sqrt(200) = 3.54, exactly as predicted
The population here is exponential, which looks nothing like a bell. The 5,000 sample means do.
Why it matters
This is the licence to use normal-theory tools on data that is not normal. A confidence interval, a t-test, a z-score and the standard error behind every A/B test all assume the estimate is normally distributed, not that the raw values are. The theorem is what makes that assumption safe.
Revenue per user is the example worth having ready. It is wildly skewed: most users spend nothing and a few spend enormously. You still compare average revenue per user between two groups with a t-test, and it is valid, because the average across thousands of users is close to normal even though no individual user is.
When it does not save you
- The sample is too small for the skew. Thirty is the textbook number and it is far too small for something long-tailed like revenue or session length.
- The variance is not finite. For genuinely heavy-tailed quantities the standard error is not trustworthy at any n.
- The draws are not independent. Repeated measurements of one user, or users inside the same account, break the assumption and shrink the effective sample well below the row count.
- You care about an extreme rather than an average. The theorem says nothing useful about a 99th percentile.
Key points
- It applies to the sample mean, not to the raw data. The population stays exactly as skewed as it always was.
- Standard error is
sigma / sqrt(n), so precision improves only with the square root of sample size. - It is why an interval on a mean is valid without knowing the population distribution.
- Independence matters as much as sample size, and is violated far more often in real data.
FAQ
- How large is large enough? It depends entirely on skew. Symmetric data settles by about 30; strongly skewed data can need thousands.
- Does it make my data normal? No. It makes the distribution of the mean normal.
- How does it differ from the law of large numbers? That one says the mean converges to the truth. This one describes the shape and the spread around it.
- Does it apply to a proportion? Yes, a proportion is a mean of zeros and ones. Other statistics have their own results.
The 30-second answer
The central limit theorem says the average of a large enough sample is approximately normally distributed, whatever the underlying data looks like. Its mean is the population mean, and its spread is the standard error, sigma over root n.
Why it matters is that it is what lets me put a confidence interval on a mean, or run a t-test, without knowing the population's distribution. Revenue per user is the example I would give: it is heavily skewed, most users spend nothing, but the average across ten thousand users is close to normal, so a t-test on that average is valid.
The two caveats I would flag are that thirty observations is far too few for something that skewed, and that it assumes independent draws, which repeated measurements of the same user break.
In the interview
- What they are checking: that you connect the theorem to why the standard A/B test is valid on skewed metrics.
- Common mistake: stating that "the data becomes normal". The data stays skewed, it is the sample mean that becomes normal.