The normal distribution shows up everywhere — in measurement error, in test scores, in sampled means. It is worth a careful look, because the shape of the curve controls the intuitions we form about uncertainty.
The density function
The probability density function is:
Two parameters control the shape. The mean slides the peak left and right. The standard deviation stretches or tightens the curve around the peak.
Each animation here is a Svelte component from @s4mple/math, imported directly into the post. Dropping a new visualization into a post is a one-line affair.
Meet the contributors
Before we build up a normal from many samples, it helps to know the cast. The simulation below uses a handful of shapes, and each one is defined by only a couple of parameters. Try moving the sliders and watching the shape respond.
Beta — two dials for every shape
The Beta distribution lives on and is controlled by two shape parameters and . Crank up and the mass slides to the right; crank up and it pulls left. Set them equal and the curve is symmetric. Set them both below 1 and the mass flees to the corners.
Uniform — everything is equally likely
The uniform density puts equal weight on every point of its support. It is the simplest distribution with positive width, and it is a convenient stress test for the central limit theorem because even a flat input produces a bell-shaped sum.
The central limit theorem, piece by piece
The demo below concatenates samples from a row of different-shaped distributions. Each colored stick is one sample. Press Sample and the stick endpoint drops into the histogram below. Keep sampling and a bell curve starts to emerge — no matter how jagged the input shapes. Add or remove contributors with the per-distribution counters to watch how N controls the convergence.
Notice what happens as you grow N. With a single contributor the histogram simply traces that distribution’s shape. Add a few more and the peaks round out. Past roughly N = 10 the bell fit (the blue overlay) glides right onto the histogram for almost any combination of contributing shapes.