Question: python3 problem Part 5: Variability of Monte Carlo We now want to investigate the variability of the results of our numerical experiment as we change

python3 problem Part 5: Variability of Monte Carlo We now want topython3 problem

Part 5: Variability of Monte Carlo We now want to investigate the variability of the results of our numerical experiment as we change the number of games N. Similar to the previous part, the setup code gives you the following functions: For each numerical experiment, we want to determine the probability that the starting hand will win. Write a function monteCarlosimulation that takes as arguments the number of numerical experiments m, the number of games N, the number of players nplayers and the starting hand starting_hand. The function must return the 1d numpy array win_prob of shape (M3), which contains the probability of winning for each numerical experiment. def monteCarloSimulation (M,N,n_players, starting_hand ) : \# do stuff here return win_prob Your code snippet should define the following variable(s) and/or function(s): Note: since we provided you with all the functions and variables that require any randomness, you should not make any calls to np. random in your function, or it might mess with the autograder. To help you debugging your code, the first test uses fixed inputs for a random seed equals to 42 , and M=2,N=10,n_players=1, starting_hand =[ ' Th' , ' 5d]. The output of the function should be [0.6,0.2] if you deal the player cards first, or [0.4,0.4] if you deal the dealer cards first

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!