Monty Hall problem is an interesting paradox. It first appeared in 1975 and the original version of this questions is following1:

“Suppose 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?”

If you have never heard this question you might guess the chance for winning is 12. All in all, there are 3 doors, you pick one, host opens second door which—as he knows—hides goat. So there are two doors left, one hides goat, other one prize. You now have to decide whether to keep your original choice, or switch doors which you want to open.

Problem is, this would be only correct if the host would not know which doors wins. In that case, he would open single doors by random with probability of 13 that he wins (and not you). If he opens a doors with goat, you then have a chance to win of 12. It would not matter then which doors you pick.

But because the host knows, situation is different. You first pick one door (call them A) from all three. Your chances for winning are now 13. Two doors are left (B and C) and the probability that prize is behind one of these two remaining doors is 23. Host will then open one door, either B or C, that hide goat (this means they are not winning). So lets say that host will now open door B which reveal a goat.

And now is the catch. Probability that prize is behind door A is 13 all the time. Probability that prize is behind doors B or C (together) is 23. But door B is now opened and you can clearly see a goat behind them. So the probability that prize is behind door B is now 0. This means that prize is behind door C with probability of 23. Don’t trust me and see for yourself below.

First, there is a table showing all possible states (blatantly copied from Wikipedia1).

Door “A” Door “B” Door “C” Result if you stay on door “A” Result if you switch doors
Goat Goat Prize Loss Win
Goat Prize Goat Loss Win
Prize Goat Prize Win Loss

Table above might be enough but pictures are better. I have decided to create a computer simulation in Python to really test this problem.

The program first initiates many rounds (that is 3 doors) with randomly chosen prize position. There are 3 functions for 3 different situations: player keeps his initial choice, player randomly decides whether to keep or switch his choice, and the last one, player switches his answer everytime. Program will run 1000 iterations.

You can view the full Python source code in my GitHub gist or see an exported Jupyter Notebook page.