Central Limit Theorem
Why can we use normal and t-distributions for means even when the data itself is not normal? Because of the Central Limit Theorem (CLT), one of the most remarkable results in mathematics.
The theorem
Take random samples of size n from any population with mean μ and finite standard deviation σ. Then, as n grows, the distribution of the sample mean x̄ approaches a normal distribution:
x̄ ≈ Normal(mean = μ, standard deviation = σ / √n)The standard deviation of x̄, σ / √n, is the standard error of the mean. Three facts are hidden in this statement:
x̄is centred on the trueμ(it is unbiased).- Its spread shrinks like
1 / √n. - Its shape becomes normal, whatever the shape of the population.
Seeing it happen
Waiting times at a help desk follow a strongly right-skewed exponential distribution with mean 4 minutes (and σ = 4). We draw 10,000 samples for several sample sizes and plot the distribution of the sample means:
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng(1810)
fig, axes = plt.subplots(1, 4, figsize=(11, 2.8))
for ax, n in zip(axes, [1, 2, 10, 50]):
means = rng.exponential(4, size=(10_000, n)).mean(axis=1)
ax.hist(means, bins=40, color="#2a78d6", edgecolor="white", linewidth=0.3)
ax.set_title(f"n = {n}")
ax.set_yticks([])
fig.tight_layout()
plt.show()
print("Histograms of 10,000 sample means for n = 1, 2, 10 and 50")Histograms of 10,000 sample means for n = 1, 2, 10 and 50
With n = 1 we just see the skewed population itself. By n = 10 the means already look roughly bell-shaped, and at n = 50 they are close to normal, with only a slight right skew left.
Checking the numbers
The CLT predicts the mean and standard error exactly. Let's compare the prediction with the simulation and track how the skewness disappears:
import numpy as np
from scipy import stats
rng = np.random.default_rng(1810)
mu = sigma = 4.0
print(" n mean of x̄ sd of x̄ σ/√n skewness")
for n in [1, 2, 10, 50, 200]:
means = rng.exponential(4, size=(10_000, n)).mean(axis=1)
print(f"{n:3d} {means.mean():8.3f} {means.std():7.3f} {sigma / np.sqrt(n):5.3f} {stats.skew(means):7.3f}") n mean of x̄ sd of x̄ σ/√n skewness
1 4.048 4.099 4.000 2.316
2 3.990 2.801 2.828 1.406
10 3.992 1.252 1.265 0.634
50 3.988 0.562 0.566 0.289
200 3.998 0.284 0.283 0.166
The simulated standard deviation of x̄ matches σ/√n closely at every n, and the skewness (2 for the exponential population) falls towards 0.
It works for discrete data too
Even yes/no data is covered: a sample proportion is just the mean of 0s and 1s. Here are 10,000 simulated proportions from samples of 100 customers, where the true conversion rate is 8%:
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
rng = np.random.default_rng(8)
p, n = 0.08, 100
props = rng.binomial(n, p, size=10_000) / n
se = np.sqrt(p * (1 - p) / n)
fig, ax = plt.subplots(figsize=(6, 3))
ax.hist(props, bins=np.arange(-0.005, 0.2, 0.01), density=True, color="#86b6ef", edgecolor="white")
x = np.linspace(0, 0.2, 200)
ax.plot(x, stats.norm.pdf(x, p, se), color="#2a78d6", linewidth=2)
ax.set_xlabel("sample proportion")
plt.tight_layout()
plt.show()
print(f"sd of simulated proportions = {props.std():.4f}, theory √(p(1-p)/n) = {se:.4f}")sd of simulated proportions = 0.0265, theory √(p(1-p)/n) = 0.0271
The normal curve fits reasonably, although with n × p = 8 the distribution is still visibly lumpy and a little skewed. That is why the proportion tests require enough expected successes and failures.
How large is "large enough"?
There's no single answer. It depends on how non-normal the population is:
| Population shape | Typical n for a good approximation |
|---|---|
| already normal | any n (the mean is exactly normal) |
| mildly skewed | about 15–30 |
| strongly skewed or heavy-tailed | 50, 100 or more |
The CLT needs a finite variance. For extremely heavy-tailed distributions (for example the Cauchy distribution), averages never settle down, though such data is rare in practice.
Why the CLT matters
- It justifies confidence intervals and t-tests for means of non-normal data.
- It explains why sums of many small, independent effects (measurement errors, heights, test scores) tend to be normal.
- It explains why precision improves only with
√n: four times the data gives twice the precision.
Test yourself
According to the CLT, what is the standard deviation of the sample mean for samples of size n?
- σ
- σ / n
- σ / √n
- σ × √n
A population is strongly right-skewed. What does the CLT say about sample means of n = 100?
- They are also strongly right-skewed
- They are approximately normally distributed
- They are uniformly distributed
- They equal μ exactly
Does the CLT say that a large *sample* of data looks normal?
- Yes, large datasets are always normal
- No, it is about the distribution of the sample *mean*, not of the individual values
- Only for n > 1000
- Only for discrete data