# Monty Hall Problem

### Problem Statement

There are 3 doors behind which are two goats and a car. You pick door 1 hoping for the car but don’t open it right away. Monty Hall, the game show host who knows what's behind the doors, opens door 3, which has a goat. Here's the game: do you want to pick door No. 2? Is it to your advantage to switch your choice?

Key takeaway: The Monty Hall problem is one of the exciting puzzles to learn the application of probability in algorithmic problem-solving. This helps us to understand that: sometimes our statistical intuition or assumptions are incorrect!

### Solution Idea: Monty Hall Problem

Here most people will assume that both doors are equally like to have the prize, and there is no reason to change. So, most of them stick with their initial choice. But the solution is just the opposite: if we switch doors, we double our probability of winning! But the critical question is — how? Let’s think.

If our initial choice is incorrect, then Monty will always open any remaining doors that do not have the prize. In this situation, the only closed door will have the award, and changing the choice will be lead us to the award. So the conclusion is: if our initial choice is incorrect, then switching the door will ensure 100% chances of success! Think!

• The probability of choosing the incorrect door in the first choice = 2/3, and the “Don’t Switch” strategy always leads to failure. Or in other words, the “Switch” strategy always leads to success.
• Similarly, The probability of choosing the correct door in the first choice = 1/3, and the “Switch” strategy always leads to failure.
• In different words, the probability of choosing the incorrect door is high in the first choice. So our best thought would be: we should "Switch" because our initial choice can be wrong with 2/3 probability! Think!

We will get a clear picture by analyzing and preparing the list of different choices and outcomes: there are only nine different combinations! In the following table, each row shows a different combination of initial door choice, prize door, and the results for the two options — “Don’t Switch” and “Switch.” There could be three doors for the first choice, and for each door, there could be three possibilities: either prize will be present in the same door or any one of the other two doors.

The above table shows all possible situations, and we need to count the number of wins for each door strategy. It is visible that out of 9 choices, if we “switch,” then we win 6 times (2/3 probability), and if we “Don’t switch,” then we win 3 times(1/3 probability). I hope this table convinces you that the probability of winning doubles when you switch doors. But again, the critical question is: why this happens? Let's think!

To understand the solution, we first need to know why your brain gets the incorrect solution that is 50/50. Actually, we are using false assumptions, and that’s why we can’t trust our answers.

Mostly we think of probabilities for independent, random events. Flipping a coin is a good example. The probability of heads is 0.5, and we obtain that simply by dividing the specific outcome by the total number of outcomes. That’s why it feels so right that the final two doors each have a probability of 0.5. However, to produce the correct answer for this method, the process must be random and have probabilities that do not change. Unfortunately, the Monty Hall problem does not satisfy either requirement.

The only random portion of the process is your first choice. When you pick one of the three doors, you truly have a 0.33 probability of picking the correct door. The “Don’t Switch” column in the table verifies this by showing you’ll win 33% of the time if you stick with your initial random choice.

The process stops being random when Monty Hall uses his knowledge about the prize’s location. It’s easiest to understand if you think about it from Monty’s point of view. When it’s time for him to open a door, there are two doors he can open. If he chose the door using a random process, he’d do something like flip a coin. However, Monty is constrained because he doesn’t want to reveal the prize. Monty very carefully opens only a door that does not contain the award. The end result is that the door he doesn’t show you, and lets you switch to, has a higher probability of containing the prize. That’s how the process is neither random nor has constant probabilities.

### Here’s how the solution to the Monty Hall Problem works?

The probability that your initial door choice is wrong is 0.66. The following sequence is deterministic when you choose the wrong door. Therefore, it happens 66% of the time:

1. You pick the incorrect door by random chance. The prize is behind one of the other two doors.
2. Monty knows the prize location. He opens the only door available to him that does not have the award.
3. By the process of elimination, the award must be behind the door that he does not open.

Because this process occurs 66% of the time and always ends with the prize behind the door that Monty allows you to switch to, the “Switch To” door must have the prize 66% of the time. That matches the table!

Our mental assumptions were based on independent, random events. However, Monty knows the prize location and uses this knowledge to affect the outcomes in a non-random fashion. Once you understand how Monty uses his knowledge to pick a door, the results make sense.

Enjoy learning, Enjoy thinking!