Each tick the engine draws a fresh sample of n values from the chosen population — a flat uniform range, a heavily right-skewed exponential-like distribution, or a two-humped bimodal mix — computes that sample's mean x̄, and drops it into the lower histogram. No matter how lopsided the population is, the histogram of sample means piles up into a bell shape as more samples accumulate, and it narrows as n grows. That is the Central Limit Theorem: the sampling distribution of the mean tends toward normal, centered on the population mean μ, with spread shrinking as √n.
x̄ = Σxᵢ / n
SE(x̄) = σ / √n (standard error — theoretical spread of x̄)
- Population shape — the raw distribution each sample is drawn from; try the skewed or bimodal ones to see the theorem hold even when the source is far from bell-shaped.
- Sample size n — how many raw draws go into each mean; small n leaves the mean histogram wide and irregular, large n collapses it into a tight, smooth bell.
- Draw speed — how many new samples are taken per animation frame, so the histogram fills in faster without changing the underlying statistics.
Real-world relevance: this is why a poll of 1,000 people can estimate a national average with a small, predictable margin of error even though individual opinions vary wildly — the sampling distribution of the average is well-behaved even when individuals are not.