What is on the screen
Pick a population, pick a sample size n, and the tool draws n values, averages them, and repeats that 20,000 times (2,000 or 100,000 if you prefer). The 20,000 means are standardised by their own mean and standard deviation, so what is left is pure shape, and that shape is drawn as a histogram with the standard normal density on top. The central limit theorem says the shape tends to the bell as n grows. It does not say how fast, and it does not say the tails get there at the same time as the middle. That is what the numbers underneath are for.
- KS distance: the largest vertical gap between the empirical cumulative curve of the standardised means and Φ, the normal CDF. Zero is perfect; 0.01 is what the experiment behind this tool called “indistinguishable in practice”. Because it is computed from a finite number of means, even a perfectly normal sample scores about 0.64/√m — roughly 0.0045 for 20,000 means — so treat anything under about 0.0066, the 5% critical value, as noise. Both figures are smaller than the textbook 0.87/√m and 1.36/√m because the mean and standard deviation are estimated from the same means (the Lilliefors correction); they were measured by pushing 400 genuinely normal samples through the same code.
- Skewness: the measured third standardised moment of the means, next to the prediction γ/√n, where γ is the skewness of the population. For independent draws this identity is exact, which makes it a neat check that the simulator is honest.
- Beyond 3σ: the share of standardised means with |z| > 3. For a normal distribution it is 0.27%. This is the number a p-value or a confidence interval actually depends on, and it converges much more slowly than the picture.
Why “n = 30” is not a law
The experiment this tool grew out of ran seven populations through exactly this procedure with 20,000 means at each of twelve sample sizes. At n = 30 the KS distances were: uniform 0.004, exponential 0.027, chi-square (df = 1) 0.034, log-normal 0.061, coin flip 0.073, Cauchy 0.081, rare event with p = 0.01 0.449. The uniform case is already at the noise floor. The rare-event case is nowhere near a bell: with p = 0.01 and n = 30, three quarters of all samples contain no event at all, so the “distribution of the mean” is a spike at zero with a few bumps to its right.
Asking the other way round — what is the smallest n at which KS drops below 0.01? — gives uniform 5, exponential 1000, chi-square 1000, and for the log-normal, the rare event, the coin and the Cauchy: not within the tested range of n ≤ 1000. The pattern behind these numbers is that the leading correction to the bell shape scales as γ/√n, so pushing the KS distance under a fixed threshold needs n proportional to γ². The write-up condensed that into a rule of thumb, n ≳ 100 γ²: about 400 for the exponential (γ = 2), 800 for the chi-square (γ = 2.83), nearly 4,000 for the log-normal (γ = 6.18) and almost 10,000 for the rare event (γ = 9.85). The last readout above shows this figure for whatever population is selected.
The tails converge last
At n = 30 the shares of means beyond 3σ were: uniform 0.27% (exactly normal), exponential 0.44%, chi-square 0.60%, log-normal 1.10% — 4.1 times the normal value — and Cauchy 14.03%, 52 times. Select the log-normal preset and look at the right-hand edge of the histogram: the middle looks fine, the bump on the right is where the extra 3σ events live. If you build a 99.7% interval from those means assuming normality, it will fail four times as often as advertised. That is the practical content of the theorem being “not yet true”.
Two ways the theorem does not apply
Lattice populations. The mean of n coin flips can only take n + 1 values, so its CDF is a staircase, and the largest gap between a staircase and a smooth curve is at least half a step. That puts a floor under the KS distance of roughly 0.4/√n — 0.073 at n = 30, 0.013 at n = 1000 — even though the outline of the histogram is a perfect bell from n ≈ 20 on. The experiment measured 0.073 and 0.017 at those two sizes: the floor, plus sampling noise once the floor gets as small as the noise. Convergence “in distribution” is happening; the KS statistic just refuses to say so. The die behaves the same way with a finer lattice. Run the sweep for the coin and you will see its curve follow the 0.4/√n reference line all the way down.
The Cauchy distribution. It has no mean and no variance, so the theorem’s hypothesis fails and the mean of n Cauchy draws is itself Cauchy, whatever n is. The KS distance in the experiment sat at 0.083 for every n from 1 to 1000. Because the sample standard deviation of Cauchy means is meaningless — one draw in a thousand dominates it — the tool standardises this population by the median and the interquartile range divided by 1.349, exactly as the experiment did; otherwise the “z” axis would collapse and the histogram would be a single bar. Select it, drag n from 1 to 1000, and watch nothing change.
Reading it honestly
- The KS distance depends on how many means you draw, not only on n. Going from 20,000 to 100,000 means lowers the noise floor from about 0.0045 to 0.002; it does not make the population converge faster.
- Standardising by the sample’s own mean and standard deviation removes location and scale on purpose. The test therefore measures shape only. A one-sample KS test against a fully specified normal would be stricter and would also punish a wrong variance estimate.
- Every press of “Draw again” uses a fresh random seed, so the third decimal of the KS distance and the tail share will move. If a conclusion depends on that decimal, it is not a conclusion.