Central Limit Theorem

Draw any distribution. Watch the means become normal.

Central Limit Theorem

The Most Important Theorem in Statistics

Draw any probability distribution on the top canvas—as weird and asymmetric as you like. The bottom canvas shows the distribution of sample means: repeatedly draw n values from your distribution, compute their average, and plot the result. As n grows, this histogram converges to a bell curve, regardless of what you drew. This is the Central Limit Theorem.

Select a preset distribution or draw your own on the top canvas. Increase the sample size n and watch the histogram become Gaussian. The orange curve is the theoretical normal distribution $\mathcal{N}(\mu, \sigma^2/n)$.

Source Distribution — draw here
Distribution of Sample Means (n = 2)
Steps: 1, 2, 3, 5, 10, 30, 100
Total samples: 0 Source $\mu$: Source $\sigma$: Mean of means: Std of means: Theoretical $\sigma/\sqrt{n}$:
Draw on the top canvas to create any distribution. The simulation repeatedly draws n samples, computes their mean, and builds the histogram below. The CLT predicts this histogram converges to a Gaussian.

What to Try

  • Exponential: Highly skewed right. With n = 2 the histogram is still clearly skewed. At n = 30, it looks normal.
  • Bimodal / Trimodal: Multiple distinct peaks. The means fill in the gaps and form a single bell curve.
  • U-Shaped: Highest at the edges, nothing in the middle. The means pile up in the center and become Gaussian.
  • Spike: Nearly a delta function. With n = 1 the histogram is a sharp spike. As n grows, it stays narrow but becomes Gaussian-shaped.
  • Comb: Five equally-spaced peaks. A striking example—the means blend into a single bell curve.
  • Draw your own: Click “Clear Drawing” and draw directly on the top canvas. Create the weirdest, most asymmetric distribution you can imagine. The CLT still works.
  • n = 1 vs n = 100: At n = 1, the histogram matches the source distribution exactly. At n = 100, everything is a bell curve.

How It Works

The simulation samples from your drawn distribution using the inverse CDF method. Your drawing is interpreted as a probability density function (PDF), which is normalized so the area under it equals 1. The CDF is computed by numerical integration, and random samples are generated by inverting the CDF with a uniform random number.

For each point in the histogram, n values are drawn from this distribution and averaged. The histogram bins these averages. The theoretical normal curve $\mathcal{N}(\mu, \sigma^2/n)$ is overlaid for comparison, where $\mu$ and $\sigma^2$ are the true mean and variance of the source distribution.