Clever Quest Lab ← Labs

Galton Board

Drop balls through the pegs and watch pure chance build a bell curve.

Each bounce is a random left or right choice (the motion is an animation along the peg lattice, not rigid-body physics). Space = start/pause. Tap a bin to highlight the path of the latest ball that landed in it.

Board

Changing the rows or p restarts the count, because earlier balls were dropped under other settings.

Show

Statistics

Balls dropped
0
Mean bin (sample)
–
Mean n·p (theory)
–
Std dev (sample)
–
Std dev (theory)
–
Most common bin
–
Balls in the air
0

Bins

Bin kBallsObservedExpectedPaths

Law of large numbers

Largest gap now: –

Largest gap between observed and expected bin percentage (percentage points, up) against balls dropped (across). Both axes are logarithmic, so a steady slope downward means the gap shrinks like a power of N.

How to use it

A Galton board, also called a bean machine or quincunx, is a board with rows of pegs arranged in a triangle. Balls are dropped in at the top, bounce left or right at every peg and finally land in bins at the bottom. Press Start and balls fall one after another. Each bounce is a random left or right choice, and the bins slowly fill into a bell-shaped column chart. The motion on screen is an animation along the peg lattice, not a rigid-body physics simulation. What is real is the chance at every peg, drawn with a pseudo-random number generator.

Try the default first: ten rows and p = 0.5. After a few hundred balls the tallest columns sit in the middle.

Controls

How it works

Sir Francis Galton described this device in his book Natural Inheritance (1889) to show how many small independent influences add up to a bell shape. At every peg a ball goes right with probability p and left with probability 1 − p, independently of all other pegs. After n rows the bin number k is simply the number of right turns, so k follows the binomial distribution B(n, p):

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

The number C(n, k) = n! / (k! (n − k)!) counts the different left/right sequences that end in bin k. These numbers form Pascal’s triangle: 1, 6, 15, 20, 15, 6, 1 for six rows. Each peg’s number is the sum of the two above it, because a ball can arrive from either. Switch on Paths to see them. With p = 0.5 every sequence is equally likely, so the middle bins, which have the most paths, collect the most balls.

The mean bin is np and the variance is np(1 − p); the standard deviation is its square root. For large n the binomial distribution is close to the normal distribution with the same mean and standard deviation. This is the de Moivre–Laplace theorem, a special case of the central limit theorem. The green curve is the normal density times the number of balls, i.e. the expected balls per bin of width 1. In a normal distribution about 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three (the 68–95–99.7 rule).

When p is not 0.5 the whole peak moves towards np. With few rows the shape is also skewed: for p below 0.5 the mean sits near the left wall and the long tail points right. More rows make the shape more symmetric again. Real boards are only approximately binomial: a ball’s speed and spin carry over from peg to peg, pegs are never identical and balls collide, so bounces are not perfectly independent. This page assumes ideal independent choices.

The small chart shows the law of large numbers: the largest gap between observed and expected bin percentages falls roughly like 1/√N as more balls drop.

Things to try

Frequently asked questions

Why is the middle the tallest?

More left/right sequences end in the middle. With 10 rows only one reaches bin 0, but 252 reach bin 5.

Is the normal curve an exact fit?

No. The binomial is discrete and limited to bins 0 to n, while the normal curve is continuous and unlimited. The fit improves with more rows and is best when p is near 0.5.

Why do the columns still differ from the theory after many balls?

Counts are random. A bin with probability P(k) typically misses its expected count by about the square root of N · P(k) · (1 − P(k)) balls. That grows more slowly than N, so the percentages approach the theory.

Is this real physics?

No. The balls follow a smooth arc between pegs for display, while each left or right decision is drawn at random. A physical board also has friction, spin and collisions.

More free games and simulators