Block 5: The Monty Hall problem

Week 9 · Probability I · Imai §6.2.4 · about 4 min

NoteHow this works

Run each cell with Run Code, look at the output, then answer the question at the end of the block. Every cell is editable; Start Over resets it. Errors are information: read them.

Three doors, one car. You pick a door; Monty (who knows where the car is) opens a different door with a goat. Switch or stay?

Simulate it

Read the loop line by line: what are first, remain and monty?

Conclusion: What share of cars do you win if you stay? If you switch?
Staying wins when your first pick was right (1/3). Switching wins whenever the first pick was wrong (2/3), since Monty removes the other goat. Simulation: 0.295 and 0.705.