This is an example of the famous Monty Hall problem. The answer in short is that it is always
better to change as this increases the likelihood that you will win the prize. Many people find this
counter intuitive when they first encounter this result so it is worth taking some time to think
about why this is the result.
Lets begin by thinking of all the way the game can play out. We begin by introducing a Bernoulli
random variable, $X$, that equals one if you select the door with the prize and zero otherwise.
Now obviously we know that:
$$
P(X=1)=\frac{1}{3} \qquad \qquad \textrm{and} \qquad \qquad P(X=0)=\frac{2}{3}
$$
Lets now introduce a second random variable, $Y$, that describes which door the host opens. This is
the critical part of the problem. The random variable $Y$ is not independent of the random variable
$X$ . This is intuitively obvious - the host will not open the door that has the prize behind it and
he/she will not open the door that you picked - consequently the value of $X$ affects the value of $Y$ so
these variables are not independent. The reason people go wrong is connected to the fact that it is difficult
to work out what implication this intuitively obvious realization has on the mathematics.
To make the nomenclature simpler in what follows we note that $Y$ - the random variable that describes
the door the host opens - can only take one of two values, $0$ or $1$. This is the case because the host
cannot open the door the contestant selected - there are thus only two doors remaining for him/her to choose from. Now,
given that $X$ and $Y$ are not independent we must work out values for the conditional probabilities:
$P(Y=1|X=0)$, $P(Y=0|X=0)$, $P(Y=1|X=1)$ and $P(Y=0|X=1)$. These conditional probabilities are:
$$
P(Y=1|X=0)=1 \qquad P(Y=0|X=0)=0 \qquad P(Y=1|X=1)=\frac{1}{2} \qquad P(Y=0|X=1)=\frac{1}{2}
$$
The values of $P(Y=1|X=1)$ and $P(Y=0|X=1)$ are as we expect. There are two doors and the host is free
to open either of them so the classical interpretation of probability tells us that the probability here is
$\frac{1}{2}$. The host is only free to open either door, however, because $X=1$. That is to say the host is only
free to open either door because prize is behind the door the contestant selected initially. When this is not the case (i.e. when $X=0$) the host
is forced to open one particular door as doing otherwise would reveal the prize. This is why we have
$P(Y=1|X=0)=1$ and $(Y=0|X=0)=0$. We are now in a position to work out absolute probabilities for all the various
(mutually exclusive) ways the game could play out using the definition of conditional probabilty. This gives us the following:
$$
\begin{aligned}
P(Y=0 \wedge X=0 ) & = P(Y=0|X=0)P(X=0) = 0 \times \frac{2}{3} = 0 \\
P(Y=1 \wedge X=0 ) & = P(Y=1|X=0)P(X=0) = 1 \times \frac{2}{3} = \frac{2}{3} \\
P(Y=0 \wedge X=1 ) & = P(Y=0|X=1)P(X=1) = \frac{1}{2} \times \frac{1}{3} = \frac{1}{6} \\
P(Y=1 \wedge X=1 ) & = P(Y=1|X=1)P(X=1) = \frac{1}{2} \times \frac{1}{3} = \frac{1}{6}
\end{aligned}
$$
We are not quite there in terms of solving this problem. The next step we have to take is to recognise from the above
probabilities what the probability of winning if we change our selection for the doors. I think the easiest way of solving
this part is to work out how the game could transpire if we always change. If we chose to change we always win if the first
door we selected does not have the prize behind it (i.e. if $X=0$). If by contrast $X=1$ we will loose when we change. We are
thus two times more likely to win if we change.
What the above explanation shows is that the Monty Hall problem is equivalent to the following question.
You get through to the final round of a television game show. The host offers you three boxes one of which contains a fabulour prize.
You are offered the opportunity to select one box or two boxes. If you pick one box you win if the prize is in it. If you pick two
boxes you win if the prize is in either of the two boxes you selected. What is the best thing to do? The logic here is similar to the
logic we used in the first worked example where we looked at the queue of people and the prize.