Galton board
About this app
Watch balls bounce through pegs and form a histogram. Adjust row count and probability and compare the result with the theoretical binomial distribution.
Randomness that falls into order
In a Galton board a ball falls through n rows of pegs and is deflected left or right at every peg, to the right with probability p. The bin where it lands equals the number of right bounces. That number follows a binomial distribution: P(b) = C(n, b) · pᵇ · (1 − p)ⁿ⁻ᵇ, with expected value n·p. More balls end up in the middle because far more paths lead there: bin b can be reached via C(n, b) routes, the outer bins via a single one. For large n the distribution approaches the normal distribution.
What you see
The app drops balls one at a time or as a continuous stream through the field of pegs. A histogram of the bins builds up at the bottom, overlaid with the exact binomial distribution as a thin line and a marker for the expected value n·p. The values panel shows the empirical and theoretical mean side by side, plus the total number of balls. The number of rows ranges from 4 to 16, the probability of bouncing right from 0.1 to 0.9, and speed has six steps.
Things to try
Start with p = 0.5 and turn on the stream: after a few balls the histogram is still ragged, after a few hundred it sits close to the theory. Then set p to 0.2 or 0.8 and watch the peak move and the distribution become skewed. Also compare 4 and 16 rows: the more rows, the wider and more bell-shaped the picture becomes, just as the central limit theorem predicts.
Frequently asked questions
- What does a Galton board demonstrate?
- A Galton board shows how many independent random choices add up to a regular distribution. Each ball makes a left-or-right choice at every peg, and the number of right bounces follows a binomial distribution. With many rows, the pile of balls looks like a bell curve.
- Why do most balls land in the middle of a Galton board?
- No ball is pulled towards the centre; every individual path is equally likely. But many more paths lead to the middle bins than to the edges, where there is only one. The number of paths to bin b is the binomial coefficient C(n, b).
- How is the Galton board related to the central limit theorem?
- A ball’s final position is the sum of many independent steps. The central limit theorem says that such sums are approximately normally distributed when the number of steps is large. The Galton board makes this transition from the binomial to the normal distribution visible.
- What can I adjust in this app?
- You choose the number of peg rows from 4 to 16, the probability p of bouncing right and the speed. Balls can be released one by one or as a stream. The histogram is compared continuously with the exact binomial distribution and the expected value n·p.
Subject: Probability & statistics
More from Probability & statistics
- Curve-fitting playground
- Covariance & Regression
- Covariance & regression 2.0
- Coin flips: law of large numbers
- Spray a Point Cloud
- Regression & R²
- Monty Hall problem
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps