Mean of the means
Spread of the means
Skewness of the means
Samples

More information about the central limit theorem

Central limit theorem

Start with a distribution that looks nothing like a bell: exponential waiting times, a die, a coin that lands on 1 one time in ten, or a U shape. Draw a sample of n values, take its mean, and do it again thousands of times. The histogram of those means grows into a bell curve centred on the true mean μ, and the larger the sample, the narrower and more symmetric it gets, exactly as the normal curve N(μ, σ²/n) predicts. Watch every sample land on the source and its mean drop into the histogram, compare the mean, the spread and the skewness of the means with the theory, and standardise to see every source against the same N(0, 1). Draw samples of n values from a strange distribution and keep the mean of each one. The left panel shows the source with its mean μ and the values of the current sample; the right panel the histogram of all the sample means so far, with the normal curve N(μ, σ²/n) over it. Press Play to draw samples one by one, faster and faster, or Skip to draw them all at once. Raise the sample size and watch the histogram turn into a narrower bell, even for a die, a biased coin or a U-shaped source. Standardise plots z = (x̄ − μ)/(σ/√n) against the standard normal curve, Reset clears the means and New run draws different samples.

How it works

  1. Pick a source distribution: exponential, uniform, a die, a biased coin, U-shaped, two humps or log-normal.
  2. Set the sample size n from 1 to 100 and how many sample means to collect, from 100 to 20,000.
  3. Press Play to draw samples one by one, faster and faster, or Skip to draw them all; Reset clears the means and New run draws new samples.
  4. Read the mean, spread and skewness of the means beside the theory, tick Standardise to compare with N(0, 1), and save the picture or open it in the editor in layers.

Means pile up into a bell

Each sample of n values has a mean x̄. One mean tells you little, but thousands of them form a distribution of their own, the sampling distribution of the mean. The central limit theorem says that, for any source with a finite variance, this distribution approaches a normal curve with the source's mean μ and a standard deviation of σ/√n. The left panel shows the source with μ and the current sample as dots; the right panel the histogram of the means so far, on a density scale so that it can be laid over the normal curve.

Narrower by the square root of n

The spread of the means is σ/√n, the standard error. For a die, σ = √(35/12) ≈ 1.708: means of 4 rolls have a spread of 0.854, means of 25 rolls 0.342 and means of 100 rolls 0.171. Four times as many values halve the spread. The Spread tile shows the standard deviation of the means you have drawn beside σ/√n, and the histogram visibly narrows as you raise the sample size. Tick Standardise to plot z = (x̄ − μ)/(σ/√n) instead: the narrowing is divided out and every source and sample size is compared with the same N(0, 1).

Skewed sources take longer

A symmetric source such as the uniform or a die gives a good bell for n = 5. A skewed one takes longer, because the skewness of the means is the source's skewness divided by √n. The exponential distribution has skewness 2: means of 5 values still lean to the right with skewness 0.89, means of 30 have 0.37 and means of 100 only 0.20. The biased coin, with skewness 2.67, is the slowest of all. The Skewness tile compares the skewness of your means with that theory, so you can see for yourself that n = 30 is not always enough.

Frequently asked questions

What is the central limit theorem?

It says that the mean of n independent values from almost any distribution is approximately normal when n is large, with the source's mean μ and a standard deviation of σ/√n. Abraham de Moivre found it for coin tosses in 1733, Laplace extended it, and Aleksandr Lyapunov proved a general version in 1901. The only real condition is a finite variance.

What do the two panels show?

The left panel is the source distribution, a density curve or bars for the die and the coin, with its mean μ dashed and the values of the current sample as dots; the tick marks that sample's mean x̄. The right panel is the histogram of all the sample means so far, on a density scale, with the normal curve N(μ, σ²/n) over it and μ dashed.

Why is the histogram still lopsided for the exponential source?

Because the exponential distribution is strongly skewed, with skewness 2, and the skewness of the means only falls as 1/√n: it is 0.89 for n = 5, 0.37 for n = 30 and 0.20 for n = 100. The bell gets more symmetric as you raise the sample size; the Skewness tile shows the theory beside your result.

What does Standardise do?

It plots z = (x̄ − μ)/(σ/√n) instead of the means themselves, against the standard normal curve N(0, 1). That divides out the narrowing, so every source and every sample size is compared with the same bell, and only the remaining difference in shape shows.

Will I get the same samples again?

Yes. Reset clears the means and Play draws exactly the same samples again, because every run uses a fixed random seed. New run picks a new seed for different samples. Changing the distribution or the sample size starts over.

Can I use the picture?

Yes. Save gives a PNG, and the pencil opens it in the PictorX photo editor with the background, the chart axes, the source distribution, the sample means, the current sample, the normal curve, the mean markers and the labels on layers of their own. Everything is simulated in your browser.

Central Limit Theorem: how do I record a video?

Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device. Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner. The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF. You can add one of three music tracks: calm, bright or beat.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Go to Editor