Multiple coin toss
A Monte Carlo simulation of the statistical properties
of the outcome of tosses of many coins. The probability that an individual coin is heads is p.
For each coin we generate a random number r uniformly in the interval [0, 1]. A coin is heads if r ≤ p. We simulate the toss of many coins and plot a histogram
of the number of heads on a single toss and compute the average number of heads and the standard
deviation.
- Run the simulation for p = 1/2 and N = 10, 100, and 1000 coins. Describe the qualitative dependence of the histogram
on the number of coins.
- Estimate the width of the histogram. Make a plot of the estimated width versus N. Compare your estimated values to the standard deviation σ. What is the functional form of this dependence? How does the relative fluctuations σ/<h> depend on N? (The quantity <h> is the mean number of heads in one toss.)
- Change the probability of obtaining heads in a single toss to p = 0.8. How does the histogram change? Does the
histogram have the same shape?
Updated 27 February 2007.