31 Years of Python | 48 Hour Sale Extension!!!
days
hours
minutes
seconds # The Classic Monty Hall Problem: A General Solution

The Monty Hall problem made the headlines in the United States in 1990 when Craig F. Whitaker asked Marilyn vos Savant, who was the woman with the highest IQ in the world, the following question: ‘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 other 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 take the switch?’

Vos Savant responded to Whitaker by saying switching double your chances of winning, but mathematicians were not having it. Some of their responses include:

• ‘May I suggest that you obtain and refer to a standard textbook on probability before you try to answer a question of this type again?’ (Charles Reid, PhD, University of Florida)
• ‘You blew it, and you blew it big! … There is enough mathematical illiteracy in this country, and we don’t need the world’s highest IQ propagating more. Shame!’ (Scott Smith, PhD, University of Florida)
• ‘You made a mistake, but look at the positive side. If all those PhD’s were wrong, the country would be in some very serious trouble.’ (Everett Harman, PhD, US Army Research Institute)

Vos Savant solution has been proved as the correct solution, and this kind of Monty Hall problem is referred to as the classic Monty Hall problem. In this article, we will go through the assumptions and solution to the classic problem asked by Whitaker, and establish a general formula for the classic Monty problem.

You may have asked why we need a general formula. The general formula does not require knowledge of Bayes theorem, which is important for solving this type of problem. In addition, the classical problem can be extended to more doors, say 100. It can be very cumbersome, maybe confusing, solving the classical problem with many doors.

## Bayes theorem

Reverend Thomas Bayes in his essay Problem in the Doctrine of Chances gave the following formula:

P(C_k|D_j) ={ {P(D_j|C_k) \cdot P(C_k)} \over P(D_j)}
P(D_j|C_k) - The probability of D_j given C_k is True
P(C_k|D_j) - The probability of C_k given D_j is True
P(C_k), P(D_j) - The independent probabilities of C_k and D_j

But P(D_j) = \displaystyle\sum_1^{k} {P(D_j|C_k) \cdot P(C_k)}

Therefore:
P(C_k|D_j) ={ {P(D_j|C_k) \cdot P(C_k)} \over \displaystyle\sum_1^{k} {P(D_j|C_k) \cdot P(C_k)}}

## Solving the classic Monty Hall problem with 3 doors

Assumptions:

• You, the participant, pick Door 1
• Monty Hall opens Door 3

### Do not switch

The equation we are trying to solve when we do not switch is:
P(C_1|D_3) ={ {P(D_3|C_1) \cdot P(C_1)} \over \displaystyle\sum_{k=1}^{k=3} {P(D_3|C_k) \cdot P(C_k)}}

When we expand the summation sign, we get:
P(C_1|D_3) ={ {P(D_3|C_1) \cdot P(C_1)} \over {P(D_3|C_1) \cdot P(C_1) + P(D_3|C_2) \cdot P(C_2)+P(D_3|C_3) \cdot P(C_3)}}

The probabilities:

• P(C_1) = P(C_2) = P(C_3) = {1 \over 3}.
This means that there is equal probability of the car been behind any of the 3 doors. So when the participant choose a door, they have a prior probability of {1 \over 3} to choose a door with the car behind
• P(D_3|C_1) = {1 \over 2}.
This is the probability of Monty opening Door 3 given that the car is behind Door 1. Remember that you chose Door 1. Monty Hall cannot open the door you have chosen. So Monty Hall has to choose between Door 2 or 3. Monty Hall can do so with a probability of {1 \over 2}
• P(D_3|C_2) = 1 .
This is the probability of Monty opening Door 3 given that the car is behind Door 2. Remember that you chose Door 1. Monty Hall cannot open the door you have chosen. Since the car is behind Door 2, Monty Hall must open Door 3 with a probability of 1.
• P(D_3|C_3) = 0 .
This is the probability of Monty opening Door 3 given that the car is behind Door 3. Obviously, if the car is behind Door 3, Monty Hall cannot open Door 3. This has a probability of 0.
• P(C_1|D_3). This is the posterior probability we are interested in. It is the probability of having the car behind the chosen Door 1 given that Door 3 is opened by Monty Hall. We have to substitute the other probabilities into this formula to calculate it.

P(C_1|D_3) = {{1 \over 2}* {1 \over 3} \over {1 \over 2}* {1 \over 3} + 1*{1 \over 3} + 0 * {1 \over 3}} = {1 \over 3}
If you do not switch, the chances of picking the car with the door is one-third.

### Make the switch

When you make the switch from Door 1 to Door 2, the formula becomes:
P(C_2|D_3) ={ {P(D_3|C_2) \cdot P(C_2)} \over {P(D_3|C_1) \cdot P(C_1) + P(D_3|C_2) \cdot P(C_2)+P(D_3|C_3) \cdot P(C_3)}}
Substituting the probabilities into the formula, you get:
P(C_2|D_3) = {1 * {1 \over 3} \over {1 \over 2}* {1 \over 3} + 1*{1 \over 3} + 0 * {1 \over 3}} = {2 \over 3}
If you switch, your chances increase to two-third.

## The General Formula

I observed the following general formula for the classic problem:
Do not switch
{{1 \over (n-1)^{n-2}} \over {1 \over (n-1)^{n-2}} + {1 \over (n-1)^{n-3}}}

Make the switch
{ {1 \over (n-1)^{n-3}} \over {1 \over (n-1)^{n-2}} + {1 \over (n-1)^{n-3}}}

Where n is the number of doors.

## Testing the General Formula

3 Door Problem
Do not switch: {{1 \over (3-1)^{3-2}} \over {1 \over (3-1)^{3-2}} + {1 \over (3-1)^{3-3}}} = {{1 \over 2} \over {1 \over 2} + ({1 \over 2})^0} = {{1 \over 2} \over {1 \over 2} + 1} = {1 \over 3}

Make the switch: {{1 \over (3-1)^{3-3}} \over {1 \over (3-1)^{3-2}} + {1 \over (3-1)^{3-3}}} = {({1 \over 2})^0 \over {1 \over 2} + ({1 \over 2})^0} = {1 \over {1 \over 2} + 1} = {2 \over 3}

The answer with Bayes theorem and the general formula are the same. Now, let us try more doors.

5 Door Problem
Do not switch: {{1 \over (5-1)^{5-2}} \over {1 \over (5-1)^{5-2}} + {1 \over (5-1)^{5-3}}} = {({1 \over 4})^3 \over ({1 \over 4})^3 + ({1 \over 4})^2} = {1 \over {1 + 4}} = {1 \over 5}

Make the switch:{{1 \over (5-1)^{5-3}} \over {1 \over (5-1)^{5-2}} + {1 \over (5-1)^{5-3}}} = {({1 \over 4})^2 \over ({1 \over 4})^3 + ({1 \over 4})^2} = {1 \over {{1 \over 4} + 1}} = {4 \over 5}

100 Door Problem
Do not switch: {{1 \over (100-1)^{100-2}} \over {1 \over (100-1)^{100-2}} + {1 \over (100-1)^{100-3}}} = {({1 \over 99})^{98} \over ({1 \over 99})^{98} + ({1 \over 99})^{97}} = {1 \over 100}

Make the switch:{{1 \over (100-1)^{100-3}} \over {1 \over (100-1)^{100-2}} + {1 \over (100-1)^{100-3}}} = {({1 \over 99})^{97} \over ({1 \over 99})^{98} + ({1 \over 99})^{97}} = {99 \over 100}

On the 5 and 100 door problems, the general formula gives us the same answer expected from Bayes theorem.

## Conclusion

We have looked at a short history of the Monty Hall problem and its solution using Bayes theorem. In addition, we introduced a general formula for calculating the Monty Hall problem using only the number of doors. Applying this general formula does not require knowledge of Bayes theorem.

## Reference

Don’t Switch! Why Mathematicians’ Answer to the Monty Hall Problem is Wrong - IMA

1 Like