Question: NEED TO BE WRITTEN IN C++!!! Write a function in your favorite language that simulates trials of the Monty Hall Three-Door problem. Your function should
NEED TO BE WRITTEN IN C++!!!
Write a function in your favorite language that simulates trials of the Monty Hall Three-Door problem. Your function should take two arguments: a bool indicating whether or not the contestant should switch doors when given the opportunity, and an integer N specifying the number of trials to run. You can then estimate the probability of success of a particular strategy (switching or not switching) by dividing the number of trials in which the contestant won the car by the total number of trials. Turn in a print-out of your code as well as a print-out of the results of the following experiments: (a) strategy: switch every time, for N = 100, 1000, 10000, and 100000 trials (b) strategy: never switch, for N = 100, 1000, 10000, and 100000 trials
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
