Download ModelDownload Sourceembed


Galton Board

Galton Board

A Galton board is a vertical board with N rows of pegs onto which a ball is dropped. Each time a ball hits a peg, it has a probability p of bouncing to the left and a probability of 1-p of bouncing to the right.The simulation's histogram shows the distribution of final x-coordinates as each ball leaves the board and is collected into bins.

The simulation gives rise to the binomial distribution if the probabilities of left and right bounces are equal. At first there does not seem to be any pattern but after many trials the familiar "bell curve" shape begins to emerge.


  1. When there are N pegs on the bottom row, the probability of the ball landing at the nth peg (where the 0th peg is located to the far left in the diagram and the Nth peg is at the far right) is given by the Binomial distribution:
    PN(n) = (N!/n!(N-n)!)pn (1-p)N-n.

    Run the simulation on "high speed" for a while to build the histogram and compare the fraction of balls that arrive at a given peg with the probability given by the Binomial distribution.
  2. If you have EJS installed, add an additional custom method to display the results of the Binomial distribution on the histogram for comparison. Note that for large values of the factorial (greater than 10!), you should use the Stirling approximation (or some other way of handling the large values of factorials since 25! uses 26 digits: see Computer Science wiki):
    lnN! = NlnN - N + ln(2πN)1/2
    Compare the simulation to the Binomial distribution.




The Galton Board Model was created by Wolfgang Christian using the Easy Java Simulations (EJS) version 4.1 authoring and modeling tool.The exercises were written by Anne Cox.

You can examine and modify a compiled EJS model if you have Easy Java/JavaScript Simulations (EjsS) installed. Information about EjsS is available at: <> and in the OSP comPADRE collection <>.



Code Language Translator Run

Software Requirements


Android iOS Windows MacOS
with best with Chrome Chrome Chrome Chrome
support full-screen? Yes. Chrome/Opera No. Firefox/ Samsung Internet Not yet Yes Yes
cannot work on some mobile browser that don't understand JavaScript such as.....
cannot work on Internet Explorer 9 and below



Wolfgang Christian; Loo Kang Wee

end faq

Sample Learning Goals


For Teachers

This is a simulation of a Galton Board, a vertical board with n rows of pegs onto which a ball is dropped. Every time the ball hits a peg, it has a probability p of bouncing to the left, and a probability 1-p of bouncing to the right.

Once at the bottom of the board, the balls are collected into bins, with the frequency of the balls entering each bin represented by a histogram.
If p and 1-p are of equal values, then over repeated iterations of the Galton Board simulation, the binomial distribution should form.




 The Galton Board by D!NG


  1. improved version with joseph chua's inputs
  2. original simulation by lookang

Other Resources


end faq

1 1 1 1 1 1 1 1 1 1 Rating 0.00 (0 Votes)