Problem 2¶
The Monty Hall Problem
Note that the problem statements are adapted from the problem sheets.
Problem statement - canonical variation (a)¶
In a game, you can pick one of three doors, labelled A, B, and C. Behind one of the three doors lies a highly desirable prize, such as the solutions to next summer’s exams. After you have chosen, but not opened, one door (e.g., door A) the person who is presenting the game opens one of the remaining two doors so as to reveal that there is no prize behind it (e.g., door C might be opened). Notice that the gameshow presenter knows that the door he opens has no prize behind it. At this point you can either stick with your original choice (door A) or switch to the door which remains closed (door B). At the end, all doors are opened, at which point you will only win if the prize is behind your chosen door. Should you stick with your choice or is it better to switch? Justify your answers.
Tasks¶
Define a function which ‘plays’ the game (as defined above) once with an option to switch or stay.
Using the above function, ‘play’ the game multiple times without switching, and produce a bar chart showing the relative occurrence of wins and losses.
Repeat the above, this time playing with switching. Are the results any different?
Problem statement - variation (b)¶
In a variation, after you have chosen door A, you are given the choice to open one of the remaining doors B or C. Notice that this time, the person opening the door does not know whether the prize is behind it or not. You pick door C, and upon opening it you discover there is nothing behind it. At this point you are again free to either stick with door A or to switch to door B. Are the probabilities different from the previous scenario? Justify your answers.
Tasks¶
Define a function which ‘plays’ the game (as defined above) once with an option to switch or stay.
Using the above function, ‘play’ the game multiple times without switching, and produce a bar chart showing the relative occurrence of wins and losses.
Repeat the above, this time playing with switching. Are the results any different this time?