1. Coin tossing simulation to study probability by counting the relative frequency of a type of event. The matrix on the next page summarizes the required output.Use the random module to simulate the experiment of tossing a fair coin n times, for n = 5,10,20,50.
Simulate repeating the above experiment M times. For each value n above, use M = 1000n , 10000n, 100000n.
For each combination of M and n( there are 12 cases) compute the probability that there are nH heads and (n- nH) tails, for 0 <= nH <= n. This will be the relative frequency of nH head and (n – nH) tails within an experiment.
Repeat the above computations using an unfair coin with probability of a head pH = 0.52,0.55,0.60).
For each of the 48 cases, write out a file with your results, neatly organized and labeled & using a format identical to the file sample shown at the end of this writeup.

Leave a Reply

Your email address will not be published. Required fields are marked *