2. The Monty Hall Problem: Here we will investigate this famous probability phenomenon. Sup- pose you're on a game show,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

2. The Monty Hall Problem: Here we will investigate this famous probability phenomenon. Sup- pose you're on a game show,

Post by answerhappygod »

2 The Monty Hall Problem Here We Will Investigate This Famous Probability Phenomenon Sup Pose You Re On A Game Show 1
2 The Monty Hall Problem Here We Will Investigate This Famous Probability Phenomenon Sup Pose You Re On A Game Show 1 (103.15 KiB) Viewed 36 times
**USE STARTER CODE**
2. The Monty Hall Problem: Here we will investigate this famous probability phenomenon. Sup- pose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?" Write a simulation in python of the Monty Hall problem based on two strategies. One where you always switch and one where you always stay at your first choice door. Do this for 10,000,000 (10 million) trials. What is the experimental probability in each case? Does the outcome agree with your calculation of the theoretical probability?
# # Monty Hall Problem Simulation import numpy as np from numpy.random import randint countsWin 0; countsLose num Trials = 100000 = # = for i in range(numTrials): L = [1, 2, 3] carDoor = randint(1, 4) yourDoor = randint(1, 4) # use conditionals to check if your door is = car door and keep a running tally
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply