📊 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}$.
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.
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
| Symbol | Meaning | Type |
|---|---|---|
| $X_i$ | Independent identically distributed random sample | Random 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)
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/SD | statistics 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).}$
❓ Section 4 — Frequently Asked Questions
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.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.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.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.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.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.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.