โ† lisson.co
peg rows ยท n12
drop rate ยท balls/s20
source distribution

CLT โ€” a Galton board

Constantin Lisson

Each ball is a sum of many small random steps. The Central Limit Theorem says such sums become Gaussian once you add enough of them โ€” nearly whatever the steps look like.

Quincunx

A ball falls through n peg rows, going left/right with probability ยฝ. Its slot counts the rights: k ~ Binomial(n, ยฝ), mean n/2, variance n/4 โ€” a bell as n grows.

Sum of i.i.d.

Pegs only add ยฑ1 steps, so this mode drops them and sums n draws from a source you pick. Each draw uses inverse-transform sampling: U ~ Uniform(0,1), then X = Fโปยน(U) (shown in the inset). The standardized sum z = (S โˆ’ nฮผ)/(ฯƒโˆšn) still lands on the same bell.

The curves

  • Histogram โ€” empirical density over time.
  • KDE โ€” Gaussian kernel density estimate.
  • Normal โ€” the N(0,1) the CLT predicts.

CDF & KS test

The CDF view shades the gap between the empirical and normal CDFs. D is the largest gap; the p-value comes from the Kolmogorov distribution at โˆšNยทD. We standardize with the known ฮผ, ฯƒ, so the test is valid. (The quincunx is discrete, so for small n, D settles above zero โ€” use more rows.)

Controls

Space pause ยท R reset ยท V board โ‡„ CDF ยท F full-screen ยท H help.

Constantin Lisson ยท 2025