Will Code for Device – Winner


Will Code for Device – Winner
Marc Taylor

Description

This application is a demonstration of Probability Distribution. The idea came from a Mathsoft newsletter published in the Winter of 1995 that described how to implement it with the Mathcad software package.

I wrote this demo from scratch in Microsoft VB.NET using Visual Studio 2003 and its Pocket PC 2002 emulator. The demo is a screen animation of an exhibit that you can find at the Boston Science Museum’s World of Mathematics, and other science museums as well. An array of rods is set up such that when a steel ball is dropped from the top center it has a 50-50 chance of going left or right. This continues until the ball finally comes to rest in one of 11 slots at the bottom. Over time the piles of balls will form an approximation to the binomial distribution.

To run the demo you simply click on the Begin key and watch the path of the first ball. Then you click Continue for as many more balls as you would like. Figure 1 below shows a screen shot after 20 clicks. It’s interesting because that particular path went to the left every time. The odds of that happening are 1 out of 1024. Of course the odds of any given path are also 1 out of 1024, but this one somehow seems special.

In Figure 2 you can see the path from the 200th click. You can also see that the ball fell into slot five which has 44 total balls. You can see that slot zero still has the one ball from click number 20, and that slots one and ten have none. The bar graphs also show that this demo does in fact yield results that are close to the binomial distribution which is shown by the bell shaped curve in red.

Figure 1

Figure 2

Show me the code

Comments (0)

Skip to main content