Toolyard

The Binomial Distribution, the Bell Curve and the Galton Board

The board

A Galton board, or bean machine, is a board of pegs in staggered rows above a row of bins. A ball dropped in at the top hits a peg in every row and goes left or right, and lands in the bin that matches how many times it went right. Francis Galton built one in the 1870s to show how order arises from chance: each ball's path is unpredictable, but thousands of balls always build the same bell-shaped pile.

The binomial formula

With n rows and a chance p of going right at each peg, the chance of landing in bin k (k rights out of n) is

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

C(n, k) = n! ÷ (k! (n − k)!) counts the paths that end in bin k, and pk(1 − p)n − k is the chance of any one of them.

Worked example: 12 rows, p = 0.5. The middle bin, k = 6, has C(12, 6) = 924 paths, each with chance 0.512 = 1 ÷ 4,096, so P(6) = 924 ÷ 4,096 = 22.6%. An end bin has one path: 1 ÷ 4,096 = 0.024%. Of 1,000 balls, expect about 226 in the middle and none, or perhaps one, at either end.

Mean and standard deviation

μ = n p and σ = √(n p (1 − p))

For 12 rows at p = 0.5, μ = 6 and σ = √3 = 1.73. For a normal distribution 68% lies within one σ of the mean and 95% within two; on this board bins 5 to 7 hold 61% of the balls, because the bins are whole numbers and one σ does not quite reach bins 4 and 8. σ grows only as √n, so a board with four times as many rows has a pile twice as wide, but relative to the width of the board it is half as wide.

The normal approximation

For large n the binomial is close to the normal curve with the same mean and standard deviation, f(x) = e−(x − μ)²/2σ² ÷ (σ√(2π)). A common rule is that it works when n p and n (1 − p) are both at least 5 (some books say 10). With p = 0.1 and 12 rows, n p = 1.2: the pile is piled against the left edge and lopsided (skewness (1 − 2p) ÷ σ = 0.77), and the symmetric bell fits it badly.

The central limit theorem

Each bounce adds a small random step, and the bin is their sum. The central limit theorem says the sum of many independent random amounts approaches a normal distribution whatever each amount's own distribution is, provided it has a finite spread. Dice show it well. One die is flat: each face 1 in 6. Two dice make a triangle peaking at 7. The sum of n dice has mean 3.5 n and variance 35 n ÷ 12, and by five or six dice it is hard to tell from a bell. This is why heights, measurement errors and test scores, each the sum of many small influences, so often look normal.

Testing a pile: chi-square

Is a pile consistent with the binomial, or is the board biased? Compare observed counts O with expected counts E = N × P(k) using

χ2 = Σ (O − E)2 ÷ E

Merge neighboring bins until each expects at least 5 balls, then use bins − 1 degrees of freedom. The p-value is the chance of a χ2 this large if the board is fair. Worked example: 200 balls on a 4-row board at p = 0.5 expect 12.5, 50, 75, 50, 12.5. Observed 15, 44, 80, 47, 14: χ2 = 0.50 + 0.72 + 0.33 + 0.18 + 0.18 = 1.91 with 4 degrees of freedom, p = 0.75, entirely consistent with chance.

Using the simulation

The Galton Board Simulator drops balls continuously. The bars show the share in each bin, the dashed line the exact distribution and the green curve the normal one. Under the picture are the sample mean and standard deviation beside the expected ones, and the chi-square test. Things to try:

  • Watch the sample mean on the chart over time: it wanders at first and settles toward μ, its error shrinking as σ ÷ √N.
  • Set p to 0.15 with 6 rows: the pile is lopsided and the normal curve misses it. Raise the rows to 20 and it becomes a bell again.
  • Switch to dice and step n from 1 to 6: flat, triangle, then bell.
  • Leave it running and note the p-value: for a fair board it moves anywhere between 0 and 1 and dips below 0.05 about one time in twenty.

What the model assumes

  • Independent bounces with the same p. Each peg is a fresh coin flip, unaffected by the last one. That is the definition of a binomial process.
  • Exactly one bounce per row. The ball always hits the next peg and moves half a peg spacing left or right; it never skips a row or bounces twice.
  • Balls do not interact. They pass through each other and never jam or knock others aside.
  • Fair dice, each face exactly 1 in 6, in the dice mode.
  • A pseudorandom number generator stands in for chance. It is far more uniform than any real board needs.

Edge cases

  • One row is a single coin flip: two bins, with shares 1 − p and p, and the bell curve is meaningless.
  • p near 0 or 1: almost every ball takes the same edge path; the distribution is lopsided and closer to a Poisson distribution with mean n p.
  • Few balls: with under a few dozen the pile is ragged and the chi-square test has too few balls per bin to run; it waits for at least two bins of 5 expected.
  • One die gives a flat distribution with no peak, the opposite of a bell, which is the starting point the central limit theorem works from.

Where the model stops being right

  • Real Galton boards are not ideal. A ball has momentum: after going right it is a little more likely to go right again, so bounces are correlated and the pile comes out wider than the binomial. Balls can also skip pegs or jam.
  • Not everything is a sum. Quantities that come from multiplying many factors, such as incomes or particle sizes, are lognormal, skewed with a long tail; the central limit theorem applies to their logarithms.
  • Heavy tails. If the individual steps have no finite variance (a Cauchy distribution, for example), their sum never becomes normal.
  • Dependence. Stock price moves, epidemics and other processes where one event changes the next do not follow the binomial; treating them as independent coin flips underestimates the extremes.
  • The normal curve is continuous and unbounded, but bins are whole numbers from 0 to n; far out in the tails it gives small but impossible chances below 0 or above n.

Related tools

Work out the mean, standard deviation and standard error of your own data with the Standard Deviation Calculator (and Standard Deviation vs Standard Error), flip real coins with the Coin Flip, and roll dice with the Dice Roller; Dice Probability: The Odds of Every Roll works out the chances by hand.

Tools in this guide

More guides