Simulated Coin Tossing Experiments and the Law of Large Numbers

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

Perhaps the simplest way to illustrate the law of large numbers is with coin flipping experiments. If a fair coin (one with probability of heads equal to 1/2) is flipped a large number of times, the proportion of heads will tend to get closer to 1/2 as the number of tosses increases. This Demonstration simulates 1000 coin tosses. Increasing the repetitions, you can compare the paths taken in repeated experiments. Also, varying the random seed shows the results for further experiments. The law of large numbers works as well for a biased coin. In this case, the proportion of heads converges to the probability of getting heads that is indicated by the solid gray horizontal line.


To view a large number of paths, set the number of repetitions to 20 and then click the play button for the random seed.


Contributed by: Ian McLeod (March 2011)
Open content licensed under CC BY-NC-SA



This Demonstration was inspired by Fig. 10.1 in [1] but it provides a more dynamic visualization.

[1] D. S. Moore, The Basic Practice of Statistics, New York: W. H. Freeman and Company, 2010.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.