# Puzzles/Decision puzzles/Monty Hall/Solution

Puzzles | Puzzles/Decision puzzles | Monty Hall | Solution
There is a prior 1/3 chance of the door you picked being the door with the prize, and a 2/3 chance of a different door being the door with the prize.
Therefore, if you want the prize, it is better to switch, and if you want a nice goat, it is better to stick with the door you chose.

## Reasoning

There are three doors: the door you first chose, the door that Monty opened, and the third door. Because there are two doors left, one with the prize, then one might want to believe that there is a 1/2 chance of obtaining the prize either way.
However, before Monty opened any door, there was a 1/3 chance that the door contained the prize. When Monty opens a different door, you learn nothing about the door that you first chose. Thus, the chance of the door you first chose containing the prize remains 1/3, not 1/2.
However, when Monty opens a door with the goat, the probability of that door containing the prize drops to 0. As the probabilities must sum to 1, and the probability of a prize at the door you first chose remains 1/3, the probability of a prize at the third door rises to 2/3. This rise in probability results only because you learned that Monty decided not to open that particular door.

## Calculations

Let $D_{p}$ be the door you first picked; let $D_{o}$ be the door which Monty opened; let $D_{r}$ be the third and remaining door. $C$ is a car or other prize and $G$ is any goat. Suppose you choose the third door $D_{r}$, then what is the probability $p$ that this door contains the prize?
${\begin{matrix}p&=&P(D_{r}=C|D_{o}=G)\\&=&P(D_{r}=C,D_{p}=C|D_{o}=G)+P(D_{r}=C,D_{p}=G|D_{o}=G)\\&=&P(D_{r}=C|D_{p}=C,D_{o}=G)P(D_{p}=C|D_{o}=G)\\&&+P(D_{r}=C|D_{p}=G,D_{o}=G)P(D_{p}=G|D_{o}=G)\\&=&\underbrace {P(D_{r}=C|D_{p}=C,D_{o}=G)} _{=0}\underbrace {P(D_{p}=C)} _{={\frac {1}{3}}}\\&&+\underbrace {P(D_{r}=C|D_{p}=G,D_{o}=G)} _{=1}\underbrace {P(D_{p}=G)} _{={\frac {2}{3}}}\\&=&0*{\frac {1}{3}}+1*{\frac {2}{3}}={\frac {2}{3}}\end{matrix}}$
Line-by-line, these equations state:
* $p$ is equal to the probability that your door $D_{r}$ contains a goat on condition that Monty opens a door with a goat.
* We partition $p$ into two cases, one where the door you first picked $D_{p}$ has a prize $C$, and one where it has a goat $G$. Now $p$ is the probability that both $D_{r}$ and $D_{p}$ have prizes on condition that Monty reveals a goat, plus the probability that $D_{p}$ has a prize and $D_{p}$ has a goat, on condition that Monty reveals goat.
* Using the formula $P(A,B)=P(A|B)P(B)$, we state for the second partition that the probability of $D_{r}$ having a prize and $P_{p}$ having a goat, on condition that Monty reveals a goat, is equal to the probability of $D_{r}$ having a prize on condition that both other doors have goats, times the probability that that $D_{p}$ has a goat on condition that Monty reveals a goat. We act likewise for the first partition.
* Monty always reveals a goat, and never a prize, so $D_{o}=G$ is a condition that is always true. We remove that condition from the equations. We then make some substitutions: the probability of door $D_{p}$ (or any door) is 1/3 for a prize, and 2/3 for a goat. We know that door $D_{r}$ cannot contain a prize if door $D_{p}$ already has it, so that probability is 0. But if doors $D_{p}$ and $D_{o}$ both contain goats, then $D_{r}$ must contain the prize for probability one.
* We calculate zero times 1/3 plus one times 2/3, giving $p={\frac {1}{3}}$.
Intuitively this means that in 2/3 of the cases we initially pick a goat and the entertainer shows us where the car is by revealing the other goat. Only in 1/3 of the cases we picked the car initially and by changing our decision we pick a goat.