Imagine you roll a pair of dice 36 times, and get a seven 6 times; the fraction of sevens is 6/36. You roll the dice 36 more times and this time get 4 sevens, for a fraction of 4/36. In this exercise you will simulate repeating this process 1000 times and display the fraction of sevens that came up for each repetition. The minimum, unlikely, fraction is 0/36 and the maximum is an unlikely 36/36. You will also see that other number of rolls for different numbers of repetitions of the sets of rolls are available.
You should try all of the above possibilities enough times to get a feeling for how they come out.
For other than exactly 36 repeated rolls, a few words about how the fractions are computed may be helpful. Say you choose to simulate rolling the dice 360 times and in one trial a seven comes up 60 times; this gives a fraction of 6/36. If a seven comes up 50 times, the fraction if 5/36. If a seven comes up 46, 47, 48, 49, 50, 51, 52, 53 or 54 times this is closest to a fraction of 5/36. The program also rounds a result of 55 sevens to a fraction of 5/36. Similarly if a seven comes up any of 56, 57, 58, 59, 60, 61, 62, 63, 64 or 65 times that is closest to a fraction of 6/36.
At the end of this exercise, you should answer the following questions:
This document and the Perl code to generate the simulation were written by David M. Harrison, January 2001.
This is $Revision: 1.5 $, $Date: 2001/09/28 13:05:09 $ (year/month/day) UTC.