Answered step by step
Verified Expert Solution
Question
1 Approved Answer
computer science major, data sci and applied mach learn class. please need help, answer questions 1, 2, and 3. using python. Originating from the American
computer science major, data sci and applied mach learn class. please need help, answer questions 1, 2, and 3. using python.
Originating from the American TV program, "Let's Make a Deal," the Monty Hall problem gives a contestant a chance to win a car. There are three doors and behind one is a brand new car. The other two doors are hiding goats. The contestant chooses a door: the first, second, or third. Then the host Monty Hall opens up one of the other two doors remaining to reveal a goat. There are now two unopened doors, the one the contestant originally chose and the other un-opened door. Behind one is a goat and behind the other is a car. The contestant is given the option to stay with their originally-chosen door or to switch to the other door. Which should they do? Or does it not matter? Create a python simulation to answer this question. You may use the following seven steps as a guide, or you may develop your own. What matters is that you - Create a computer simulation that follows the Monty Hall problem, - Generate a Monte Carlo probability of winning a car for each of the choices of staying and switching doors, and - Provide a recommendation of whether the contestant should stay or switch doors. Step 1. (5 Points) Create a numpy array doors with the three possibiliites: goat one, goat two, and car. The contestant randomly chooses a door; simulate this by randomly choosing one of these three using np.random.choice () and calling it original_choice. [ ] Step 2. (5 Points) Now the host reveals a goat behind one of the two un-chosen doors. If the contestant had chosen a door with a goat behind it, then there is only one other door with a goat and that one will be opened by the host. If the contestant had chosen the door with the car behind it, then both un-chosen doors contain goats and the host will randomly decide which one to open. Simulate this. Call the goat-door the host reveals revealed_door. Hint: Use if statements. Step 3. (5 Points) Copy your code from Step 2 and modify it to assign what is left behind the third (un-chosen and un-revealed) door within the if statements, so as to be more computationally concise. Call this door the other_doorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started