ScratchData LogoScratchData
Back to crkcity's profile

Coin flip distribution (Galton's box model of binomial distribution)

CRcrkcity•Created May 28, 2022
Coin flip distribution (Galton's box model of binomial distribution)
18
11
113 views
View on Scratch

Instructions

Drops 150 balls down a board with ten rows of triangle pegs. Balls happen to line up in stacks in the shape of a "binomial" probability distribution. It's like flipping a coin ten times recording the result, and repeating that 150 times. If you set probability bouncing left (vs. right) to 50%, each ball hitting a peg has a 50% chance going left, just as flipping a coin has a 50% chance of ending up tails. See what happens too when you adjust the probability, like biasing the coin towards heads or tails.

Description

150 balls drop, bounce off pegs and stack up at the bottom (called a Galton box). The resulting stacks of balls tend to have a bell-shaped curve, as in coin tossing experiments. Ten rows of pegs are like flipping the same coin ten times, then recording the result (by putting red ball). There's many chances for a ball to end up near the middle, but few chances to end up at far left or right. What's the chance a ball hits first peg, bounces right, then bounces right again, then again right, and so on through ten rows of pegs? That's a rare occurence and so the stack on the far right (and far left) is not very high. Then we repeat that trial 150 times (150 balls, like 150 coins each flipped ten times). What do you expect happens when you bias the balls left or right (like biasing a coin to heads or tails)? The code sends balls left or right based on picking random numbers then sending balls left or right by a fixed amount, then repeating that ten times. So the pegs are props, and took a while to draw in the right places, just for illustration purposes.

Project Details

Project ID697999859
CreatedMay 28, 2022
Last ModifiedMay 2, 2023
SharedMarch 28, 2023
Visibilityvisible
CommentsAllowed