Day 7. The Law of Large Numbers & Central Limit Theorem
Why sample means settle down, and why their errors are approximately normal.
- ●Compute the mean, variance and standard error of a sample mean.
- ●Prove Markov's and Chebyshev's inequalities and the weak law of large numbers.
- ●Apply the central limit theorem to sample means, proportions and totals.
- ●Explain how clustering and fat tails change these results.
Theory
The sample mean
Let be independent and identically distributed (iid) with mean and variance . The sample mean has
The standard error shrinks like : to halve it, you need four times the data.
Two inequalities
- Markov: if , then for .
- Chebyshev: .
Law of large numbers (LLN)
For every , as . We write ("converges in probability"). This is why a large experiment's group means are close to the population means.
Central limit theorem (CLT)
Whatever the shape of the distribution of (as long as is finite),
For moderate , . Almost every confidence interval and p-value in applied work rests on this approximation, including those for regression coefficients, which are weighted averages.
When things go wrong
- Dependence. With units per cluster and intra-cluster correlation , the variance of the mean is inflated by the design effect .
- Infinite variance. For very fat-tailed data (e.g. Cauchy), neither the LLN nor the CLT applies.
Part 1 · Warm-up
Exercise 1 · Standard error
Test scores have . What is the standard error of a mean from students?
Show solution
.
Exercise 2 · Diminishing returns
How many students are needed to cut the standard error to 1?
Show solution
: four times as many for half the error.
Exercise 3 · A probability for the mean
has and . For , approximate .
Show solution
, , so .
Exercise 4 · A proportion
The true employment rate is 0.3. For a sample of 400, find the standard error of the sample proportion and an interval containing it with about 95% probability.
Show solution
Step 1. A proportion is the mean of 0/1 variables with .
Step 2. Standard error: .
Step 3. By the CLT, about 95% of samples fall within of 0.3.
Answer: SE ≈ 0.023; the sample employment rate lands in about 95% of the time.
Exercise 5 · A total
An insurer has 100 independent claims with mean $500 and sd $300. Approximate the probability that total claims exceed $55,000.
Show solution
Step 1. Total has mean .
Step 2. Independent claims, so variances add: and .
Step 3. By the CLT, . Standardise: .
Step 4. .
Answer: about a 5% chance that total claims exceed $55,000.
Part 2 · Proofs
Exercise 6 · Unbiasedness of the sample mean
Prove .
Show solution
By linearity, . (Identical distribution is needed; independence is not.)
Exercise 7 · Variance of the sample mean
Prove for iid data.
Show solution
because independence makes every covariance zero. Exercise 13 shows what happens when it does not.
Exercise 8 · Markov's inequality
Prove for and .
Show solution
Step 1. Since , always holds.
Step 2. Take expectations: .
Step 3. Divide by .
Exercise 9 · Chebyshev's inequality
Derive Chebyshev's inequality from Markov's.
Show solution
Apply Markov to the non-negative variable with :
Exercise 10 · The weak law of large numbers
Prove when .
Show solution
Apply Chebyshev to , whose variance is :
Part 3 · Applied
Exercise 11 · Budgeting an RCT
An outcome has in both arms. (a) With 225 per arm, what is the standard error of the difference in means? (b) How many per arm are needed for a standard error of 2?
Show solution
(a) SE with 225 per arm
Step 1. Each arm mean has variance .
Step 2. The arms are independent, so the variance of the difference is and .
(b) Sample size for SE = 2
Step 3. Solve : square both sides, , so per arm.
Answer: SE ≈ 2.83 with 225 per arm; 450 per arm are needed for SE = 2 (twice the sample for a 29% smaller SE).
Exercise 12 · How sure is a survey mean?
A statistics office estimates mean household income from a random sample of households. Bound the probability that the sample mean misses the true mean by at least two standard errors, , using Chebyshev's inequality, and compare with the CLT approximation. Why might the office prefer the Chebyshev figure for very skewed incomes in a small sample?
Show solution
Step 1. Chebyshev with and :
Step 2. CLT: , so the probability is about .
Answer: at most 25% (Chebyshev) versus about 4.6% (CLT). Chebyshev holds for any distribution and any , so it is a safe worst case when incomes are very skewed and the sample small; the CLT figure is sharper but only an approximation.
Exercise 13 · Clustered samples
A school survey samples 100 schools with 20 pupils each. The intra-class correlation is 0.05. Find the design effect and the effective sample size.
Show solution
Step 1. Design effect: .
Step 2. Effective sample size: independent pupils.
Step 3. Standard errors that ignore clustering are too small by .
Answer: DEFF = 1.95; the 2,000 pupils carry the information of about 1,026 independent ones.
Exercise 14 · When the LLN fails: very fat tails
Suppose the profits of start-ups in a venture-capital portfolio follow a Cauchy distribution (no finite mean or variance). Explain why the average profit across more and more start-ups does not settle down, and what this suggests for heavy-tailed economic outcomes such as wealth or firm revenue.
Show solution
Step 1. The LLN and CLT both need a finite mean (and the CLT a finite variance). The Cauchy has neither.
Step 2. A known property: the average of independent Cauchy draws is itself Cauchy with the same spread, so averaging never reduces uncertainty.
Step 3. Intuition: every so often one start-up has a gigantic gain or loss that dominates the whole average (see the running means in the code).
Answer: the portfolio average does not converge. Real outcomes such as wealth have finite but huge variances, so convergence is slow and a few extreme units drive the mean; analysts use logs, winsorising, medians or quantiles.
Exercise 15 · Seeing the CLT in hospital stays
Hospital length of stay is strongly right-skewed: suppose it is exponential with mean 1 week. A health authority audits random samples of 50 patients and records each sample's mean stay. If you simulate 10,000 such audits, what mean, variance and shape should the sample means have?
Show solution
Step 1. For the exponential with mean 1, and .
Step 2. week.
Step 3. , so sd ≈ 0.141 weeks.
Step 4. Shape: by the CLT, approximately normal. The skewness shrinks from 2 for one patient to about for the mean.
Answer: mean 1, variance 0.02, nearly bell-shaped despite the skewed stays (see the code and the CLT simulator).
Verify in Python
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
means = rng.exponential(1.0, size=(10_000, 50)).mean(axis=1)
print(f"mean of means {means.mean():.3f} (theory 1), var {means.var():.4f} (theory 0.02)")
print(f"skewness of draws ~2, of means {stats.skew(means):.2f} (theory 2/sqrt(50) = 0.28)")
print("P(Xbar > 53):", round(stats.norm.sf(53, 50, 2), 4))
print("Total claims tail:", round(stats.norm.sf(55_000, 50_000, 3_000), 4))
print("Chebyshev bound 0.25 vs CLT:", round(2 * stats.norm.sf(2), 4))
# Cauchy: running mean never settles
c = rng.standard_cauchy(1_000_000)
print("Cauchy running means:", [round(float(c[:k].mean()), 2) for k in (10**3, 10**4, 10**5, 10**6)])
Key takeaways
- Sample means are unbiased with standard error .
- The LLN says they converge to ; the CLT says their errors are approximately normal.
- Dependence (clusters) and fat tails weaken both results.
Simulation Lab: Central Limit Theorem Simulator
Open full screen →Draw thousands of sample means from skewed or bimodal parents and watch the normal shape appear.
4,000 samples of size n. Even when the parent is skewed or lumpy, the sample mean's distribution approaches N(μ, σ²/n). Skewness shrinks like 1/√n.