Question: **** PLEASE ANSWER USING THE CODE GIVEN AND FOR EACH M VALUE**** DO NOT IMPORT RANDOM, JUST CONTINUE THE CODE IN THE PICTURE. Write a
**** PLEASE ANSWER USING THE CODE GIVEN AND FOR EACH M VALUE**** DO NOT IMPORT RANDOM, JUST CONTINUE THE CODE IN THE PICTURE.
Write a script that uses the randint function from the numpy.random package and calculate the probabilities for the coin flip problem with 2 coins. Show that the experimental probability con- verges to the theoretical probability by taking the number of trials M = 100, 1000, 10000, 100000, 1000000.

import numpy as np from numpy.random import randint counts = np.zeros(3) Ntrials = 100 countHeads = np.zeros(3) for i in range (Ntrials): coins = randint(0, 2, size=2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
