SimulatorEducationEntertainmentBrain

Galton Board Simulator

Drop physically simulated balls through a triangle of pegs and watch a bell curve build itself in the bins below. Real gravity, real bounces, real ball-on-ball collisions — and a perfect demo of how the binomial distribution approaches the normal.

Rows of pegs12
Drop rate8/sec
Gravity0.18
Settled 0In flight 0μ 6.00σ 1.73

A bell curve built from coin flips

The Galton board (or bean machine) was invented by Francis Galton in the 1870s to make the normal distribution physically visible. Each ball bouncing through n rows of pegs makes n independent left-or-right choices. The number of rights it ends up with — i.e. the bin it falls into — is a Binomial(n, p) random variable.

As more balls drop, the histogram approaches the Binomial probability mass function. Because the physics is symmetric — vertical gravity, identical pegs left and right — each bounce is effectively a fair coin flip and the bell is centered at n / 2. The shape is Binomial(n, 0.5) and the central-limit theorem makes it indistinguishable from a Gaussian once n is large.

The math behind the picture

P(bin = k) = C(n, k) · pk · (1 − p)n − k

μ = n · p

σ = √(n · p · (1 − p))

The amber curve overlaid on the histogram is exactly this PMF, scaled to the total number of dropped balls. As you drop more balls the histogram and the curve match more closely — a live illustration of the law of large numbers.

The Central Limit Theorem in one image

The Central Limit Theorem says: sums of many independent random variables, regardless of their individual distributions, tend toward a normal distribution. The Galton board is the cleanest demo: each peg is one tiny coin flip (a Bernoulli trial). The bin number is the sum of n of them. Increase rows from 4 to 18 and watch the discrete Binomial smooth out into something indistinguishable from a Gaussian.

This is why so many real-world measurements — heights, errors, exam scores — are roughly normally distributed even when their underlying causes are not.

Things to try

  • Raise restitution near 0.8: balls become bouncy and pile up slowly with chaotic interactions.
  • Drop gravity to 0.06: slow-motion Galton — every collision is visible.
  • Push rows to 16: 17 bins and a smooth, broad Gaussian emerge.
  • Compare run lengths: at 100 balls the histogram is jagged; let it run to 500+ and it locks into the bell curve.