← SciSim / Mathematics

Central Limit Theorem

Sums of independent random variables become Gaussian — no matter how ugly the original distribution.
🎓 Tier: Standard Undergraduate (Probability & Statistics)

📊 Section 1 — Interactive Simulation

Pick a parent distribution (uniform, Bernoulli, exponential, …). Sample $n$ values, take their mean, repeat $M$ times, watch the histogram of those means converge to a Gaussian centered at $\mu$ with std-dev $\sigma/\sqrt{n}$.

distribution plot
μ (parent mean)
σ² (parent var)
sample mean X̄
sample SE σ/√n
empirical mean of X̄
empirical SD of X̄
KS distance to N
M (replications)

Animation

Parent Distribution

Sampling Parameters

Display Options

Tips

• Press ▶ Play to keep adding replications — watch the bell curve sharpen.
• Try Cauchy: CLT fails because $\sigma^2=\infty$. The histogram never narrows.
• The standardized variable $Z=(\bar X-\mu)/(\sigma/\sqrt n)$ converges to $\mathcal{N}(0,1)$ for any finite-variance parent.

💡 Section 2 — The Idea, Step by Step

From a single everyday average up to the precise $1/\sqrt{n}$ law — the same idea told at three levels.

Roll one die and you get anything from 1 to 6 — wildly unpredictable. Roll ten dice and average them, and you almost always land near 3.5. Roll a hundred and average those, and you land even closer. Averaging many random things cancels out the chaos: the highs and lows partly erase each other, and what survives clusters around the true center. The Central Limit Theorem (CLT) is the precise statement of how much that cluster tightens and — surprisingly — what exact shape it takes: a bell curve, every single time, no matter how jagged the thing you started with.

Now name the pieces. Call the quantity you measure $X$, with a true average $\mu$ (mu) and a typical spread $\sigma$ (sigma, the standard deviation). Take $n$ independent measurements and average them into the sample mean $\bar X$. Two things always happen as $n$ grows: the long-run average of many $\bar X$ values sits right on $\mu$, and the spread of $\bar X$ shrinks. The simplest equation — the one statisticians use daily — is the standard error:

$$\text{SE} = \frac{\sigma}{\sqrt{n}}.$$

One worked number: a fair die has $\mu = 3.5$ and $\sigma \approx 1.71$. Average $n = 100$ rolls and the spread of that average is only $1.71/\sqrt{100} = 0.171$ — about ten times tighter than a single roll. Quadrupling $n$ only halves the spread, because of the square root.

The deeper claim is about shape, not just width. Standardize the sample mean by subtracting its center and dividing by its spread,

$$Z_n = \frac{\bar X - \mu}{\sigma/\sqrt{n}},$$

and as $n \to \infty$ the distribution of $Z_n$ converges to the standard normal $\mathcal{N}(0,1)$ — regardless of whether the parent was skewed, discrete, or bimodal, as long as it has a finite variance. The sliders map straight onto this: n is how many draws go into each average (larger $n$ → narrower and more Gaussian), M is how many averages you collect to build the histogram (larger $M$ → a smoother, less noisy picture), and the parent dropdown changes $\mu$ and $\sigma$ but never the limiting bell shape.

Try this in the sim above. First, pick Exponential — a hard right-skewed parent — set $n = 2$ and watch the histogram stay lopsided; then slide $n$ toward 100 and watch it straighten into a clean bell. Second, switch to Bernoulli(0.3) and confirm that even a 0/1 coin-flip parent averages into a smooth curve. Third, choose Cauchy and push $n$ as high as it goes — the histogram never narrows, a live demonstration that CLT genuinely needs finite variance.

📐 Section 3 — Statement & Proof Sketch

The classical CLT, the symbol table, the standardization, and a moment-generating-function proof sketch.

Classical (Lindeberg–Lévy) CLT

Let $X_1, X_2, \ldots$ be i.i.d. random variables with finite mean $\mu = \E[X_1]$ and finite variance $\sigma^2 = \Var(X_1) > 0$. Let $\bar X_n = \tfrac{1}{n}\sum_{i=1}^n X_i$. Then $$Z_n \;=\; \frac{\bar X_n - \mu}{\sigma/\sqrt{n}} \;\xrightarrow{d}\; \mathcal{N}(0, 1) \quad \text{as } n \to \infty,$$ in the sense of convergence in distribution: $\Pr(Z_n \le z) \to \Phi(z)$ for every $z \in \R$, where $\Phi$ is the standard-normal CDF.

Equivalent forms: $\bar X_n \approx \mathcal{N}(\mu, \sigma^2/n)$ for large $n$; or $\sum_{i=1}^n X_i \approx \mathcal{N}(n\mu, n\sigma^2)$.

Symbol Table

SymbolMeaningType
$X_i$ Independent identically distributed random sampleRandom variable on probability space
$\mu$ Common mean of each $X_i$ Real, $\mu = \E[X_1]$
$\sigma^2$ Common variance of each $X_i$ Real, $0 < \sigma^2 < \infty$
$n$ Sample size — number of $X_i$'s averaged Positive integer
$\bar X_n$ Sample mean $\tfrac1n\sum X_i$ Random variable, mean $\mu$, variance $\sigma^2/n$
$Z_n$ Standardized: $(\bar X_n - \mu)/(\sigma/\sqrt n)$Random variable, mean 0, variance 1
$\Phi(z)$ Standard normal CDF $\R \to [0,1]$, increasing
$\xrightarrow{d}$Convergence in distribution CDFs converge pointwise at continuity points of limit

Proof Sketch (via MGF / Characteristic Functions)

Step 1 · Reduce to mean-zero, unit-variance
Set $Y_i = (X_i - \mu)/\sigma$, so $\E[Y_i] = 0$, $\Var(Y_i) = 1$. Then $Z_n = (1/\sqrt n)\sum Y_i$. We show $Z_n \xrightarrow{d} \mathcal{N}(0,1)$.
Step 2 · Characteristic functions
Let $\varphi(t) = \E[e^{itY_1}]$ be the characteristic function of $Y_1$. Independence gives $\varphi_{Z_n}(t) = \E[e^{it\sum Y_i/\sqrt n}] = \prod \E[e^{itY_i/\sqrt n}] = \varphi(t/\sqrt n)^n$.
Step 3 · Taylor-expand $\varphi$ near 0
Since $\E[Y_1]=0$ and $\E[Y_1^2]=1$, $\varphi(s) = 1 + i\cdot 0\cdot s - \tfrac12\cdot 1\cdot s^2 + o(s^2) = 1 - s^2/2 + o(s^2)$ as $s\to 0$.
Step 4 · Substitute $s = t/\sqrt n$ and take $n$-th power
$\varphi(t/\sqrt n) = 1 - t^2/(2n) + o(1/n).$ Therefore $\varphi_{Z_n}(t) = \big(1 - t^2/(2n) + o(1/n)\big)^n \to e^{-t^2/2}$ as $n\to\infty$.
Step 5 · Identify the limit
The function $e^{-t^2/2}$ is the characteristic function of $\mathcal{N}(0,1)$. So $\varphi_{Z_n} \to \varphi_{\mathcal{N}(0,1)}$ pointwise.
Step 6 · Apply the Continuity Theorem (Lévy)
Pointwise convergence of characteristic functions to a function continuous at 0 implies convergence in distribution. So $Z_n \xrightarrow{d} \mathcal{N}(0,1)$.
Step 7 · Where does each hypothesis go?
Independence: needed for $\varphi_{Z_n} = \prod\varphi(t/\sqrt n)$. Identically distributed: gives the same $\varphi$ for every $i$. Finite variance: needed in Step 3 for the Taylor expansion to second order. Cauchy ($\E[X^2]=\infty$) violates this — the CLT fails (sample mean of Cauchy is again Cauchy, never Gaussian). $\boxed{Z_n \xrightarrow{d} \mathcal{N}(0,1).}$

Simulation ↔ Symbol Mapping

dropdown parent distribution from which $X_i$ are drawn — fixes $\mu$ and $\sigma^2$
slider n (log scale) sample size — number of $X_i$'s averaged in each replication of $\bar X_n$
slider M (log scale) number of replications — how many independent $\bar X_n$'s we collect to build the histogram
slider seed seed for the deterministic Mulberry32 PRNG (so simulations are reproducible)
readout μ, σ² theoretical mean and variance of the parent distribution (closed form)
readout SE = σ/√n theoretical standard error of $\bar X_n$ — what CLT predicts as the histogram's width
readout empirical mean/SDstatistics of the $M$ collected $\bar X_n$ values — should match $\mu$ and $\sigma/\sqrt n$
readout KS distance $\sup_z \abs{F_{\hat Z_n}(z) - \Phi(z)}$ — Kolmogorov–Smirnov distance to standard normal; shrinks like $1/\sqrt n$

Worked Example — Uniform[0,1], $n=12$

Parent stats: If $X \sim \text{Uniform}(0,1)$, then $\mu = 1/2$, $\sigma^2 = 1/12$, $\sigma = 1/\sqrt{12}$.

Sample-mean stats by CLT: $\bar X_{12} \approx \mathcal{N}(1/2,\, \sigma^2/12) = \mathcal{N}(1/2,\, 1/144)$. So SD$(\bar X_{12}) = 1/12 \approx 0.0833$.

Probability calculation: $\Pr(\bar X_{12} > 0.55) \approx \Pr\!\left(\frac{\bar X_{12} - 0.5}{1/12} > \frac{0.05}{1/12}\right) = \Pr(Z > 0.6) = 1 - \Phi(0.6) \approx 0.2743$.

Famous identity: $\sum_{i=1}^{12} U_i - 6$ where $U_i \sim \text{Uniform}(0,1)$ has mean 0, variance 1, and is approximately $\mathcal{N}(0,1)$. This is one of the oldest tricks for generating standard normals. $\boxed{\bar X_{12} \approx \mathcal{N}(1/2, 1/144).}$

Reference: Ross, S. — A First Course in Probability, 10th ed., Ch. 8 §8.3 "The Central Limit Theorem"; Grimmett, G. & Stirzaker, D. — Probability and Random Processes, 4th ed., §5.10; Feller, W. — An Introduction to Probability Theory, Vol. I, Ch. X (CLT for sums); Durrett, R. — Probability: Theory and Examples, 5th ed., §3.4 (rigorous CLT proof).

❓ Section 4 — Frequently Asked Questions

🧮Conceptual Why is the normal distribution the universal limit, and not some other shape?

It comes down to two structural facts. First, the normal is the unique distribution that is stable under sums in the right normalization: a sum of independent normals (after rescaling by $1/\sqrt n$) is again normal. Second, the normal maximizes entropy among all distributions with a given mean and variance — so when you average many independent contributions, the limiting distribution shouldn't add information beyond what's preserved (mean, variance), and entropy maximization picks the Gaussian. The proof reveals it: the Taylor expansion of any characteristic function up to second order is captured by the Gaussian's $e^{-t^2/2}$ — third and higher cumulants get washed out by the $1/\sqrt n$ scaling.

Key takeaway: the Gaussian is the unique distribution determined by mean and variance alone — and sums forget everything else.
🔬Simulation What exactly does the simulation compute when I press ▶ Play?

For each replication, it draws $n$ independent samples from the parent distribution using a deterministic Mulberry32 PRNG (so results are reproducible from the seed), computes their arithmetic mean $\bar X_n$, and stores it. After $M$ replications, you have $M$ values of $\bar X_n$, which it bins into a histogram and overlays the theoretical $\mathcal{N}(\mu,\sigma^2/n)$ density. The Kolmogorov–Smirnov readout is the supremum gap between the empirical CDF of those $M$ values and the predicted normal CDF — by CLT it shrinks at rate $1/\sqrt M$ for fixed $n$, plus a finite-$n$ bias that shrinks at rate $1/\sqrt n$ (Berry–Esseen).

Key takeaway: the simulation is empirical CLT verification — Monte Carlo on top of Monte Carlo.
🌍Applied Where does CLT get used in practice?

It's the foundation of nearly all classical statistics. Confidence intervals: $\bar X \pm z_{\alpha/2}\sigma/\sqrt n$ assumes the CLT-normal sampling distribution. Hypothesis testing via $z$-tests and (with Slutsky's theorem) $t$-tests. A/B testing: companies decide whether button color matters by computing CLT-based $p$-values. Polling and surveys: margin of error $\propto 1/\sqrt n$ — that's why doubling sample size only halves uncertainty by $\sqrt 2$, not 2. Quality control: control charts use $\pm 3\sigma/\sqrt n$ Gaussian limits. Diffusion in physics: Brownian motion is the continuous limit of random walks — that's also CLT in disguise. Finance: option-pricing models assume log-returns are normal (debatable for tails, but CLT-based for averaged returns).

Key takeaway: every "average behaves normally" claim in stats, polling, finance, physics is CLT in action.
💡Non-Obvious When does CLT fail?

The classical CLT requires finite variance. Heavy-tailed distributions like Cauchy ($f(x)=1/(\pi(1+x^2))$) have $\E[X^2]=\infty$, so Step 3 of the proof breaks. Try Cauchy in the simulation: the histogram of sample means stays Cauchy-shaped and as wide as a single observation — averaging doesn't help. (In fact, $\bar X_n \sim \text{Cauchy}$ exactly for any $n$.) For such distributions, generalized CLT applies: properly normalized sums converge to $\alpha$-stable distributions, with $\alpha < 2$. Independence also matters: dependent sequences need mixing conditions or martingale CLTs. And "identically distributed" can be relaxed (Lindeberg–Feller) but you need a uniform bound on contributions.

Key takeaway: CLT needs finite variance; heavy tails go to stable laws, not Gaussians.
📐Computational How fast does the sample-mean distribution converge to normal — what's the rate?

The Berry–Esseen theorem quantifies it: $\sup_z \abs{\Pr(Z_n \le z) - \Phi(z)} \le \tfrac{C\,\rho}{\sigma^3 \sqrt n}$, where $\rho = \E[\abs{X_1 - \mu}^3]$ is the third absolute central moment and $C \approx 0.4748$ (current best constant). So the KS distance goes to zero at rate $1/\sqrt n$. For $n=30$ with skew-symmetric distributions, the bound is around $0.05$–$0.1$; for symmetric distributions like Uniform, the constant is much smaller in practice. The "rule of thumb" $n \ge 30$ is loosely tied to this — but for highly skewed parents (exponential, log-normal), $n=100$ may still show visible non-normality in the tails. The simulation's KS-vs-$n$ graph shows this $1/\sqrt n$ decay directly.

Key takeaway: convergence rate is $1/\sqrt n$ (Berry–Esseen) — skewed parents need bigger $n$ to look normal.
🎓Deep / Advanced What's the connection between CLT and the diffusion equation?

If you take a random walk on $\Z$ (each step $\pm 1$ with probability 1/2), the position after $n$ steps is a sum of i.i.d.\ Rademacher variables. By CLT, after $n$ steps the position $S_n \approx \mathcal{N}(0, n)$ — the spread grows as $\sqrt n$. Take the limit of small steps and small time intervals, scaling space by $\sqrt{\Delta t}$, and you get Brownian motion, whose density at time $t$ solves the heat equation $\partial_t u = \tfrac12 \partial_{xx} u$ with delta initial condition. The fundamental solution $\tfrac{1}{\sqrt{2\pi t}} e^{-x^2/(2t)}$ is exactly the CLT Gaussian with variance $t$. So CLT is the discrete-to-continuous bridge: random walks $\Rightarrow$ Brownian motion $\Rightarrow$ heat equation. The same Gaussian appears in Wiener integrals, stochastic differential equations, and Itô calculus.

Key takeaway: Brownian motion = continuous-time CLT; the heat-equation Gaussian is the same Gaussian.
🧮Conceptual Does CLT say individual $X_i$ are normal? Why is the Bernoulli sample mean normal-looking even though Bernoullis are 0/1?

No — CLT is about the distribution of the average, not the original variables. The $X_i$ stay exactly as they are: a Bernoulli is still 0 or 1. The sample mean $\bar X_n$ takes values in $\{0/n, 1/n, 2/n, \ldots, n/n\}$ — discrete, not continuous. But as $n$ grows, those discrete values get dense and the histogram of $\bar X_n$ looks like a continuous Gaussian density. The De Moivre–Laplace theorem (1733) is the special case of CLT for binomial — it predates the general CLT and is what gave us the Gaussian shape originally.

Key takeaway: CLT is about $\bar X_n$, not $X_i$. Discrete parents give discrete-but-dense histograms that mimic Gaussians.
Best resource: 3Blue1Brown — "What's the Central Limit Theorem? A visual proof"; Khan Academy — Statistics & Probability, "Central Limit Theorem" series; Seeing Theory (Brown University) — Frequentist Inference, https://seeing-theory.brown.edu; MIT OCW 18.05 — Introduction to Probability and Statistics; Wolfram MathWorld — Central Limit Theorem.

⚠️ Section 5 — Misconceptions & Common Errors

A · Conceptual Misconceptions
❌ Misconception: "By CLT, anything you measure in the real world is normally distributed." ✅ Correction: CLT is about sums or averages of many independent contributions, not about individual measurements. Heights and IQ scores are roughly normal because they arise from many small genetic and environmental additive effects — that's CLT applied to nature. But income, city sizes, file sizes, and word frequencies are heavy-tailed (often power-law); they aren't averages and they aren't normal. CLT predicts the shape of $\bar X_n$, not $X_1$ itself. 📖 Reference: Feller — Introduction to Probability Theory, Vol. I, Ch. X (CLT scope and limits).
❌ Misconception: "The sample mean $\bar X_n$ is normally distributed for all $n$, by CLT." ✅ Correction: CLT is an asymptotic statement: $\bar X_n \to \mathcal{N}$ as $n\to\infty$. For small $n$, $\bar X_n$ inherits the shape of the parent — averaging only 3 exponentials gives a noticeably right-skewed distribution. The "rule of thumb $n\geq 30$" is just a rough guideline; for highly skewed parents you may need $n\geq 100$ or more. The exact distribution of $\bar X_n$ for finite $n$ depends on the parent (a sum of $n$ exponentials is Gamma$(n, \lambda)$, exact, not normal). 📖 Reference: Ross — A First Course in Probability, 10th ed., §8.3 (asymptotic nature, Berry–Esseen rate).
❌ Misconception: "If I sample $n$ values, I can use them to estimate $\sigma$ and CLT still says the standardized statistic is $\mathcal{N}(0,1)$." ✅ Correction: When $\sigma$ is replaced by the sample standard deviation $s$, the standardized statistic $T = (\bar X - \mu)/(s/\sqrt n)$ follows Student's $t$-distribution with $n-1$ degrees of freedom, not exactly $\mathcal{N}(0,1)$. The $t$ has heavier tails — using normal critical values gives anti-conservative confidence intervals when $n$ is small. As $n\to\infty$, $t_{n-1} \to \mathcal{N}(0,1)$ (Slutsky's theorem), so for large $n$ they coincide. 📖 Reference: Casella & Berger — Statistical Inference, 2nd ed., §5.3 (Student's $t$ vs CLT).
B · Common Procedural Errors
❌ Error: "$\Var(\bar X_n) = \sigma^2$ — by linearity." ✅ Correct: Linearity gives $\Var(\sum X_i) = n\sigma^2$ (using independence). Then $\Var(\bar X_n) = \Var(\sum X_i / n) = (1/n^2) \cdot n\sigma^2 = \sigma^2/n$. The variance of an average shrinks as $1/n$. This is the source of the $\sigma/\sqrt n$ standard error — the headline result of CLT. The student forgot the $1/n^2$ factor that comes out of $\Var$ when you scale by $1/n$. 🔍 Why students do this: confuse $\Var(cX) = c^2\Var(X)$ with $\Var(cX) = c\Var(X)$ — variance scales with the square of the constant.
❌ Error: "$\Pr(\bar X_n > c) \approx \Pr(Z > (c - \mu)/\sigma)$." ✅ Correct: Standardize using the SE of $\bar X_n$, not of $X_1$: $\Pr(\bar X_n > c) \approx \Pr\!\left(Z > \frac{c - \mu}{\sigma/\sqrt n}\right)$. The denominator is $\sigma/\sqrt n$, not $\sigma$. Forgetting the $\sqrt n$ wildly underestimates how concentrated the sample mean is — for $n=100$, you're off by a factor of 10 inside the normal CDF. 🔍 Why students do this: copy the standardization rule for $X_1$ rather than for $\bar X_n$.
❌ Error: "$X_i \sim \text{Cauchy}(0, 1)$ for $i=1,\ldots,n$, so by CLT $\bar X_n \to \mathcal{N}(0, 1/n)$." ✅ Correct: Cauchy has $\sigma^2 = \infty$ (the integral $\int x^2 / (\pi(1+x^2))\,dx$ diverges). The classical CLT doesn't apply. Remarkable fact: $\bar X_n$ for i.i.d.\ Cauchy is exactly Cauchy(0, 1) for every $n$ — averaging doesn't help at all. Justifying rule: CLT requires finite variance; check $\E[X^2] < \infty$ before invoking it. 🔍 Why students do this: assume CLT is universal — but it's a theorem with hypotheses, and "finite variance" is one of them.
Education research: delMas, R., Garfield, J. & Chance, B. — "A model of classroom research in action: Developing simulation activities to improve students' statistical reasoning", JSE 7(3) (1999); Chance, B., delMas, R. & Garfield, J. — "Reasoning about sampling distributions", in Ben-Zvi & Garfield (eds.) The Challenge of Developing Statistical Literacy, Reasoning and Thinking, Springer (2004); Garfield, J. & Ben-Zvi, D. — Developing Students' Statistical Reasoning, Springer (2008); Watkins, A., Bargagliotti, A. & Franklin, C. — "Simulation of the sampling distribution of the mean can mislead", JSE 22(3) (2014).