The 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 x-coordinates as the balls leave the board and are collected into bins.