Coin Toss Simulation

This simulates the repeated tossing of a coin.  Press Setup to begin.  The Go command will produce one coin toss, and then add a small black box if the result is a heads or a small white box if the result is tails.  The Sim100 repeats the Go command up to the next multiple of 100 tosses..  The Sim1000 repeats the Go command up to the next multiple of 1000 tosses.

The number of trials and number of successes (i.e., Heads) are monitored, and the ratio of successes to trials determines the relative frequency of success.  The graph shows the change in relative frequency as the number of trials increases.

Finally, the Probability_of_Heads slider changes the probability of getting a "Heads" in a single flip of a coin.   You should press the SetUp command after you change the slider.

created with NetLogo

view/download model file: CoinToss.nlogo