Monday, August 19, 2013

Monty Hall problem with 3 doors and more ...

The Monty Hall problem is a famous probability puzzle, which received a lot of attention because the solution of the puzzle seems counterintuitive. This is the puzzle:

"
Imagine that you are a contestant on a television game show. You are shown three large doors. Behind one of the doors is a new car, and behind each of the other two is a goat. To win the car, you simply have to choose which door it is behind. When you choose a door, the host of the show opens one of the doors you have not chosen, and shows you that there is a goat behind it. You are then given a choice; you may stick with your original choice, or you may switch to the remaining closed door. What should you do to maximize your chances of winning the car?" (1) 

Many people that didn't hear of the Monty Hall problem before believe that switching makes no difference, and argue that if the host reveals a door with a goat, the chance that you win the car becomes fifty-fifty. As a result, many people stick to their original choice. However, this path of reasoning is incorrect. The right answer is explained elaborately on wikipedia (2), and there are also some nice youtube videos about it (3,4).

Basically, the answer goes as follows:

"Contestants who switch have a 2/3 chance of winning the car, while contestants who stick have only a 1/3 chance. One way to see this is to notice that there is a 2/3 chance that the initial choice of the player is a door hiding a goat. When that is the case, the host is forced to open the other goat door, and the remaining closed door hides the car. "Switching" only fails to give the car when the player had initially picked the door hiding the car, which only happens one third of the time." (2)


More doors!


Using this knowledge, I was curious what would happen if you would extent the problem with more than 3 doors.

If there are 4 doors, the chance of winning if you stick is 1/4. The chance of winning if you switch is 1/2 in 3 cases (the cases where you picked a door with a goat), and 0/2 in 1 case (when you picked the door hiding the car). In total, this is 3/8.
In short:
P(winning|stick)= 1/4
P(winning|switch)= 3/8 


In case there are 5 doors, the chances of winning are 1/5 if you stick and 4/15 if you switch, respectively.

If you now compare the row of chances of winning if you stick with the chances of winning if you switch, you can see a certain pattern if you equalize the denominators for each game:


"stick": 1/3, 2/8, 3/15          (instead of 1/3, 1/4, 1/5)
"switch": 2/3, 3/8, 4/15

It appears that, for each puzzle, you have to add 1 to the numerator of "stick" to get the chances of winning if you switch. A general formula for n doors can then be deduced:


Making a simulation with n doors in excel, you can generate following output:




















In this graph you can see the chances of winning if you switch vs the chances of winning if you stick for different numbers of doors (n, logarithmic scale). I also added the "intuïtive answer" of winning if you stick (*), where the non-random act of the host is perceived as being random, which as such can be described with the formula 1/(n-1).

Using this graph it becomes clear that the chance of winning if you switch converges to the chance of winning if you stick very quickly as the number of doors continue to rise (notice that this is a logarithmic scale, where the "quickness" is stretched out). When the conditional probability caused by the act of the host is ignored, the chances of winning if you stick are being overestimated ("intuïtive answer"), but the "negative" effect of such an overestimation diminishes with the number of doors used for the Monty Hall problem.

So changing doors still makes a difference when you include doors with goats behind them, but the difference becomes smaller very quickly.

More doors & more losing doors!


You can also change the number of doors the host opens (= losing doors). I've read that this has already been studied by someone called D.L.Ferguson. According to Ferguson, the chance of winning if you switch in this variant can be calculated with this formula (5):







Where n = number of doors, and p = number of opened doors.


"If the host opens even a single door, the player is better off switching, but, if the host opens only one door, the advantage approaches zero as
 n grows large. At the other extreme, if the host opens all but one losing door the advantage increases as n grows large (the probability of winning by switching approaches 1 as n grows very large)." (2)

I'll illustrate this with a simulation of Monty Hall problems with 50, 500 and 5000 doors:


















Regarding the shape of the curves, the number of opened doors has a similar effect on the chances of winning in the 3 examples showed. A remarkable trend is that, regardless of the number of doors (50, 500 or 5000), the chances of winning if you switch rises quickly from ca. n-5 opened doors. From then on, the chances are above 0.2.

Theoretically, it is always advantageous to switch. The chances of winning if you switch boom when the number of opened doors are very close to the total number of doors.

Note:
I used "", because I'm not sure whether intuition depends on the number of doors that are used to play with. If there are more doors, it might become more clear that the act of the host is non-random, and should be taken into account. However, after reading Thinking, fast & slow of Daniel Kahneman I believe that when answering fast (intuitively) the brain won't give much about conditional probabilities, unless the brain is trained to recognize them. 

Sources: 

1. 
http://philosophy.hku.hk/think/stat/aode1.php
2. http://en.wikipedia.org/wiki/Monty_Hall_problem

No comments:

Post a Comment