A Quincunx or "Galton Board" (named after Sir Francis Galton) is a triangular array of pegs.
Balls are dropped onto the top peg and then bounce their way down to the bottom where they are collected in little bins.
Each time a ball hits one of the pegs, it bounces either left or right.
|But this is interesting: if there is an equal chance of bouncing left or right, then the pegs collecting in the bins form the classic "bell-shaped" curve of the normal distribution.
(If the probabilities are not even, you still get a nice "skewed" version of the normal distribution.)
You can actually calculate the probabilities!
|The ball bounces k times to the left with a probability of p: pk|
|And the other bounces (n-k) have the opposite probability of: (1-p)(n-k)|
|So, the probability of following such a path is pk(1-p)(n-k)|
But there could be many such paths! For example the left turns could be the 1st and 2nd, or 1st and 3rd, or 2nd and 7th, etc.
You could list all such paths (LLRRR.., LRLRR..., LRRL...), but there are two easier ways.
How Many Paths
You can look at Pascal's Triangle. In fact, the Quincunx is just like Pascal's Triangle, with pegs instead of numbers. The number on each peg shows you how many different paths can be taken to get to that peg. Amazing but true.
Or you can use this formula from the subject of Combinations:
|This is commonly called "n choose k" and written C(n,k).
It is the calculation of the number of ways of distributing k things in a sequence of n.
|(The "!" means "factorial", for example 4! = 1×2×3×4 = 24)|
Putting it all together, the resulting formula is:
(Which, by the way, is the formula for the binomial distribution.)
For 10 rows (n=10) and probability of bouncing left of 0.5 (p=0.5), we can calculate the probability of being in the 3rd bin from the right (k=3) as:
(This means there are 120 different paths that would end
up with the ball in the 3rd bin from the right.)
So we get:
In fact we can build a whole table for rows=10 and probability=0.5 like this:
|Example: 100 balls||0||1||4||12||21||24||21||12||4||1||0|
Now, of course, this is a random thing so your results may vary from this ideal situation.
If the probability were 0.8 then the table would look like this:
|Example: 100 balls||11||26||30||20||9||3||1||0||0||0||0|
Try It Yourself
Run 100 (or more) balls through the Quincunx and see what results you get. I have done this many times myself while developing the software. I never got the perfect result, but always something surprisingly close. Good Luck!