Question: Exercise 3 Probability and Statistics [15 points] If you toss a coin three times, these are the possible outcomes xi : xi {000, 001, 010,
Exercise 3 Probability and Statistics [15 points] If you toss a coin three times, these are the possible outcomes xi : xi {000, 001, 010, 011, 100, 101, 110, 111}, where 0 stands for "head" and 1 for "tail". Write a program that simulates a random coin toss (you can use numpy.random to generate random numbers). Let your program generate N = 10000 independent samples for xi (i.e. let it perform a sequence of three coin tosses N times and store these sequences). (i) Plot a histogram of the eight possible outcomes. You should find that each of the eight outcomes occurred approximately the same number of times. (ii) Now calculate the total number of tails ti for each sampled xi . This is the same as summing the digits in the sequence: for example in the sequence 101 there are 2 tails. Altogether you have four possibilities: ti {0, 1, 2, 3} Plot a histogram of the ti . Are the different outcomes still equally frequent? Explain why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
