1.3.15 · D2Probability & Statistics

Visual walkthrough — Central limit theorem

2,660 words12 min readBack to topic

Before line one, three plain-word promises:

  • A random variable is just "a number you don't know yet until you look" — like the face of a die before it lands. We write it with a capital letter, e.g. .
  • The mean (Greek letter "mu") is the long-run average of — the balance point of its picture.
  • The variance ("sigma squared") measures spread — how far, on average, values sit from the balance point, squared. Its square root is the everyday "typical distance from center."

We will earn everything else as we go.


Step 1 — Start from ANY shape at all

WHAT. Pick a single random variable . We do NOT assume it is a bell. Look at the figure: on the left is a flat uniform die (six equal bars), in the middle a lopsided skewed distribution, on the right a jagged two-spike one. Each has a balance point marked by a vertical line, and a typical spread marked by a short arrow.

WHY start ugly. The whole miracle of the CLT is that the starting shape does not matter. If we only proved it for shapes that already look like bells, we would have proved nothing. So we deliberately begin with the worst-looking distributions we can.

PICTURE.

Figure — Central limit theorem

Each symbol here:

  • — one draw from the source (one die roll, one data point).
  • — the vertical balance line. Same idea in all three shapes.
  • — the horizontal spread arrow; longer arrow = more spread.

Everything from now on is: what happens when we average many independent copies of this ?


Step 2 — The averaging machine

WHAT. Take independent copies — all drawn from the same ugly shape (this is the i.i.d. assumption: independent, identically distributed). Feed them into a machine that sums and divides:

Term by term: (read "X-bar") is the sample mean — the average of this batch. The ("sigma", a capital S for Sum) just says "add through ." The turns the total into an average.

WHY average and not just sum. A raw sum keeps growing without bound as grows, so its picture drifts off to the right forever. Dividing by pins the picture in place around so we can study its shape, not its runaway position.

PICTURE. The funnel takes many draws in, and emits one number .

Figure — Central limit theorem

is itself random — run the machine again, you get a slightly different average. So has its own distribution, its own picture. Finding that picture is the whole game.


Step 3 — Where does the average sit, and how tightly?

WHAT. Two facts about the machine's output, before we ask its shape.

Its center: The averaging machine does not move the balance point. ( means "expected value" = long-run average.)

Its spread:

\qquad\Longrightarrow\qquad \underbrace{\text{SE}}_{\text{standard error}} \;=\; \frac{\sigma}{\sqrt{n}}$$ Term by term: $\sigma^2$ was the spread of *one* draw. Divide by $n$ and it shrinks. Take the square root to get back to everyday distance units: the **standard error** $\text{SE} = \sigma/\sqrt{n}$ — the typical distance of $\bar{X}_n$ from $\mu$. **WHY the $\sigma^2/n$ — built in pictures.** This is the load-bearing formula, so let us *see* it, not just state it. Look at the figure in three panels. *Panel A — variances add for independent things.* Picture spread as the length of a stick that points in a random direction. When two independent random draws are added, their sticks point in *unrelated* directions, so they combine like the two legs of a right triangle: the new spread-squared is $\sigma^2 + \sigma^2$, the sum of the *squares* (Pythagoras!). This is exactly the rule $\text{Var}(X_1+X_2)=\sigma^2+\sigma^2$ for independent draws. Do it $n$ times: $$\text{Var}\!\left(\sum_{i=1}^n X_i\right)=\underbrace{\sigma^2+\sigma^2+\cdots+\sigma^2}_{n\text{ terms}}=n\sigma^2$$ Each $\sigma^2$ is one draw's spread; they add because independence forbids their wiggles from lining up. *Panel B — dividing by $n$ squeezes the axis.* The sample mean is that sum divided by $n$. Squeezing a picture horizontally by a factor $n$ divides distances by $n$, hence spread-*squared* by $n^2$ (squaring the factor): $$\text{Var}(\bar{X}_n)=\text{Var}\!\left(\tfrac{1}{n}\textstyle\sum X_i\right)=\frac{1}{n^2}\,(n\sigma^2)=\frac{\sigma^2}{n}$$ Here $1/n^2$ is the squeeze factor squared, $n\sigma^2$ is the summed spread from Panel A; they cancel down to $\sigma^2/n$. *Panel C — the $\sqrt{n}$ punchline.* Take the square root to return to plain distance: $\text{SE}=\sigma/\sqrt{n}$. That is why quadrupling the sample size only *halves* the error. **PICTURE.** ![[deepdives/dd-ai-ml-1.3.15-d2-s03.png]] As $n$ grows, the picture of $\bar{X}_n$ gets taller and narrower, always centered on $\mu$. But "narrow" is not the same as "bell-shaped." A narrow triangle is still a triangle. Step 5 shows why it *must* become a bell. > [!mistake] LLN and CLT are two different guarantees > The shrinking $\text{SE}=\sigma/\sqrt{n}\to 0$ says the average *homes in on* $\mu$ — that alone is the [[Law of Large Numbers]] (LLN): **where** the average lands. The CLT is a *different, sharper* statement about **what shape** the wobble around $\mu$ has once you zoom in — a bell. LLN kills the wobble; CLT describes the wobble's shape *before* it dies. Do not conflate them: LLN needs only a finite mean, CLT needs a finite variance too. --- ## Step 4 — Rescale so the picture stops shrinking **WHAT.** If we let $\bar{X}_n$ collapse to a spike, its shape is lost in a point. So we **standardize** — subtract the center, divide by the spread — to freeze the picture at unit width: $$Z_n \;=\; \frac{\overbrace{\bar{X}_n - \mu}^{\text{shift to center on }0}}{\underbrace{\sigma/\sqrt{n}}_{\text{stretch to width }1}}$$ Term by term: subtracting $\mu$ slides the balance point to $0$; dividing by $\text{SE}=\sigma/\sqrt{n}$ stretches the horizontal axis so the spread becomes exactly $1$. Now $Z_n$ has mean $0$ and variance $1$ for *every* $n$. **WHY this exact transform.** We need a fair side-by-side comparison across different $n$. Two distributions with different centers and widths can't be compared by eye. Standardizing removes the boring differences (position, scale) so only the *shape* remains to be examined. **PICTURE.** Same underlying distribution, re-centered on $0$ and re-scaled to width $1$ — a moving camera that tracks the shrinking blob and keeps it filling the frame. ![[deepdives/dd-ai-ml-1.3.15-d2-s04.png]] This is the same standardization used everywhere in the [[Normal Distribution]] and in building [[Confidence Intervals]]. --- ## Step 5 — Watch the shape converge (the miracle) **WHAT.** Now hold the camera on $Z_n$ and turn up $n$: $n=1$, then $2$, then $5$, then $30$. Overlay the true bell curve — written $\mathcal{N}(0,1)$ — in a dashed line. First, what does $\mathcal{N}(0,1)$ *mean*? The letter $\mathcal{N}$ is just shorthand for "**N**ormal," the technical name of the perfect bell curve (its full formula lives in [[Normal Distribution]]). The two numbers in the brackets are its center and its spread: $\mathcal{N}(0,1)$ = "a bell centered at $0$ with variance $1$." So $\mathcal{N}(0,1)$ is simply *the standard bell* — nothing more. Starting from a flat die, watch: - $n=1$: flat (the die itself). - $n=2$: a triangle (summing two dice — the tent shape). - $n=5$: already rounded and humped. - $n=30$: indistinguishable from the dashed bell. **WHY it happens — the intuition.** Convolving (adding) independent shapes repeatedly *averages out* every bump. Sharp corners require fine coordination between the parts; independence forbids that coordination, so corners get sanded down. The only shape that is stable under this endless smoothing — the shape that reproduces itself when you add two copies — is the bell. It is the "fixed point" of the averaging machine, so everything flows toward it. **PICTURE.** ![[deepdives/dd-ai-ml-1.3.15-d2-s05.png]] > [!formula] What the picture is converging to > $$Z_n \;=\; \frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}} \;\xrightarrow{\;d\;}\; \mathcal{N}(0,1)$$ > The arrow $\xrightarrow{d}$ means "the *picture* (distribution) converges," not that individual numbers converge. $\mathcal{N}(0,1)$ is the standard bell just defined: center $0$, spread $1$. --- ## Step 6 — Why the bell and nothing else (the self-reproducing shape) **WHAT.** Take two independent bells, add them, standardize — you get a bell again. Add a triangle to a triangle and you get something rounder, *not* a triangle. Only the bell is reproduced by addition. **WHY this seals it.** Step 5 said "everything flows toward a stable shape." Step 6 identifies that shape uniquely: among all distributions with finite variance, the Gaussian is the *only* one closed under (standardized) addition. So the limit in Step 5 cannot be anything else. This is purely a picture-argument: repeatedly adding-and-smoothing must land on a shape that no longer changes when you add-and-smooth once more, and the bell is the only such shape. **PICTURE.** Two bells → one bell (top row, stable). Two triangles → a hump (bottom row, changed). ![[deepdives/dd-ai-ml-1.3.15-d2-s06.png]] > [!recall]- For the algebra-lovers: how the main note nails it > The picture-argument above is enough to *see* the result. If you want the airtight proof, the [[Central limit theorem|main note]] uses a tool called the **moment generating function (MGF)**: a way to summarize an entire distribution as a single function $M(t)=\mathbb{E}[e^{tX}]$, like a barcode for its shape. Two distributions with the same barcode are the same distribution. The proof shows the barcode of $Z_n$ tends to $e^{t^2/2}$, which is precisely the barcode of $\mathcal{N}(0,1)$ — so the limit *is* the bell. You do not need this machinery to trust the pictures; it just makes "flows toward the bell" mathematically exact. The key algebraic fact is that only the mean and variance of $X$ survive the $t/\sqrt{n}$ scaling — every shape-specific detail washes out, which is exactly why the starting shape is forgotten. --- ## Step 7 — The edge cases (where the machine breaks or stalls) **WHAT.** Four boundary scenarios, each with its own panel in the figure: 1. **$n=1$ (no averaging yet).** $Z_1 = (X-\mu)/\sigma$ is just your original ugly shape, standardized. No bell. The theorem is a *limit* — it says nothing at small $n$. 2. **Skew slows convergence — and by how much.** The rougher (more lopsided) the start, the larger $n$ must be before the bell appears. There is a concrete dial for this: **skewness** $\gamma$ measures lopsidedness (a symmetric shape has $\gamma=0$; the exponential shape has $\gamma=2$). The leading error of the bell approximation shrinks like $\gamma/\sqrt{n}$ (this is the first Edgeworth-correction term). So to halve the error you must *quadruple* $n$, and a source with twice the skew needs four times the samples for the same accuracy. That is why a symmetric die is nearly bell by $n=5$, while a sharply skewed source may need $n$ in the hundreds. 3. **Infinite variance ($\sigma^2=\infty$).** The machine **breaks**. Heavy-tailed sources (e.g. Cauchy) violate the assumption $\sigma^2<\infty$; averages of them do *not* become normal. The whole derivation used $\sigma$ in Step 4 — divide-by-$\sigma$ is undefined if $\sigma$ is infinite. 4. **Degenerate ($\sigma=0$).** If $X$ is a constant, there is no randomness: $\bar{X}_n=\mu$ always, a single spike. Step 4 divides by $0$ — undefined. No distribution to converge to. **WHY show these.** A theorem is only trustworthy if you know exactly when it *fails*. The two failure modes both attack the denominator $\sigma$ of Step 4: $\sigma=\infty$ and $\sigma=0$. Everything strictly between $(0,\infty)$ works; the *speed* inside that range is governed by skewness $\gamma$. **PICTURE.** Four panels: works-eventually ($n=1$ raw), works-slowly (skewed, with its $\gamma/\sqrt{n}$ error shrinking), breaks (heavy tail), degenerate spike. ![[deepdives/dd-ai-ml-1.3.15-d2-s07.png]] > [!mistake] Two classic traps > - "n=30 always guarantees normality." False — heavy skew or heavy tails need much more. Because the error falls like $\gamma/\sqrt{n}$, a big $\gamma$ demands a big $n$. The 30 rule is folklore, not the theorem. > - "The CLT makes my *data* normal." No. It makes the distribution of the **sample mean** normal. Individual data stay as ugly as ever. --- ## The one-picture summary ![[deepdives/dd-ai-ml-1.3.15-d2-s08.png]] Read it left to right: any ugly shape → average $n$ of them → center and rescale → and no matter where you started, the picture lands on the same bell. The three conditions on the arrow are the only fine print: **i.i.d.**, **finite variance**, and **$n$ large enough** (how large depends on skewness $\gamma$). > [!recall]- Feynman retelling — say it in plain words > Imagine a machine that grabs $n$ random numbers from *any* junky distribution, adds them, and divides by $n$. That output — the sample mean — barely moves off the true average $\mu$, and it gets tighter as you use more numbers, tightening like the square root of $n$. Why $\sqrt{n}$? Because independent spreads add like the legs of a right triangle (spread-squared adds up), and then dividing by $n$ squeezes it back down — the two effects leave $\sigma/\sqrt{n}$. If you now put a moving camera on that shrinking blob — sliding it to sit on zero and zooming so its width is always one — you see its shape freeze into a smooth bell, exactly the standard normal $\mathcal{N}(0,1)$. Why a bell and nothing else? Because adding independent randomness sands off every corner, and the bell is the one shape that survives being added to itself. The trick fails in only two spots: if the source has infinite spread (nothing to divide by, the tails win), or zero spread (a dead constant, no shape at all). Everywhere in between, the bell is destiny — though a lopsided (skewed) start makes you wait longer, the error dying only like $\gamma/\sqrt{n}$. And do not confuse two facts: *where* the average lands is the Law of Large Numbers; *what shape* its wobble takes is the CLT. > [!recall]- Quick self-check > Why divide the sum by $n$ instead of just summing? ::: A raw sum drifts off to infinity as $n$ grows; dividing by $n$ pins the picture around $\mu$ so we can study its shape. > Why does the standard error shrink like $\sqrt{n}$, not $n$? ::: Independent spreads add like legs of a right triangle ($\sigma^2+\sigma^2+\cdots=n\sigma^2$), then dividing by $n$ scales variance by $1/n^2$, leaving $\sigma^2/n$; the square root gives $\sigma/\sqrt{n}$. > What does standardizing (subtract $\mu$, divide by SE) accomplish? ::: It slides the center to $0$ and stretches the width to $1$, so only the shape remains to compare across different $n$. > What is the difference between LLN and CLT? ::: LLN says *where* the average lands (it homes in on $\mu$); CLT says *what shape* the wobble around $\mu$ has (a bell). LLN needs finite mean, CLT needs finite variance. > Name the two ways the CLT breaks. ::: Infinite variance ($\sigma^2=\infty$, heavy tails) and degenerate zero variance ($\sigma=0$, a constant). Both kill the divide-by-$\sigma$ step. > How does skewness affect convergence speed? ::: The bell-approximation error falls like $\gamma/\sqrt{n}$, so a more skewed source (larger $\gamma$) needs a larger $n$ for the same accuracy. --- **See also:** [[Bootstrap Methods]] (resampling leans on the same sampling-distribution idea), [[Sample Size Calculation]] (uses the $\sigma/\sqrt{n}$ shrink to pick $n$), [[Monte Carlo Methods]] (averaging random draws to estimate integrals), [[Maximum Likelihood Estimation]] and [[Bias-Variance Tradeoff]] for how estimators behave once normality kicks in.