"Whenever you can, share. You never know who all will be able to see far away standing upon your shoulders!"
I write mainly on topics related to science and technology.
Sometimes, I create tools and animation.
Though generally described for $3$ doors, we'll generalize it for $n$ total doors, $x$ opened doors, $t$ winning doors, and derive the equations.
In the tool given on this page, we can modify the total number of doors $n$, the doors selected by the host $y$, then the doors opened from those selected doors $x$, and the number of winning doors $t$, and ask the computer to play the game for thousands of times and compare the predicted values against the actual results.
While in Monty Hall Paradox Test Tool I focused on explaining the working of this paradox through its results, here I'll derive the equations for the generalized case (for any number of total, opened and winning doors).
But first a quick recap from Wikipedia...
The Monty Hall problem is a brain teaser, in the form of a probability puzzle, loosely based on the American television game show Let's Make a Deal and named after its original host, Monty Hall.
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 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 switch your choice?
If you look at it closely, there are actually three strategies for the player to select from.
Now let's try to first generalize and then derive the equations governing it working.
Instead of 3 doors, let's say we have \(n\) doors. And the player selects one door. Now, before opening this door, excluding the door the player has selected, the host selects a subset of doors from \(n\) (say, \(y\)) and then opens \(x\) doors from these y doors. Note that generally, \( y=n-1 \). Now the question for the player, in the general form, would be to select one from the following three strategies:
Let's find out the respective probabilities, say \(p1, \text{ } p2 \text{ and } p3\).
Note that in both strategy 2 and 3, while making the new selection, the player has to consider the fact that \(x\) doors have been opened (unless he is foolish enough to consider even the open doors in making his selection, which he could). Hence, both \(p2\) and \(p3\) bring into picture the altered probabilities \(1 \over n-x\) and \(1 \over y-x\) respectively. In \(p2\), the other catch is that when \(y\) set was identified by the host, there were no doors opened, hence the winning probability of \(y\) as a whole was \(y \over n\).
In \(p1\), the fact that a few doors (\(x\)) have been opened is not used by the player in making his new selection, hence in \(p1\), the \(x\) opened doors don't come into picture.
Sometimes I think probabilities are a window into the quantum realm from the classical world - they change very subtly, and even by the act of observing them!
So, we have these results:
If the number of winning doors $t$ is greater than $1$, $t$ simply gets multiplied to each of $p1$, $p2$ and $p3$, and we get: $p1 = {t \over n}\text{, }$ $p2 = {t \over n-x} \text{, and }$ $p3 = {y \over (y-x)} \times {t\over n}$. Wherever not stated, I'll assume $t = 1$.
For the specific values \(n=3\), \(y=2\), and \(x=1\) (these are the common values used for presenting this question), we get:
$$ \begin{align}
p1 &= {1 \over n} = {1 \over 3}, \\\\
p2 &= {1 \over (n-x)} = {1 \over 2}, \\\\
p3 &= {y \over (y-x)} \times {1 \over n} = {{2 \over 1} \times {1 \over 3}} = {2 \over 3}, \text{and} \\\\
p1 : p2 : p3 &= (n-x)(y-x) : n(y-x) : y(n-x) \\\\
&=(3-1)(2-1) : 3(2-1) : 2(3-1) \\\\
&=2 : 3 : 4
\end{align}$$
So, it is, in fact, of great advantage for the player to switch his choice!
Do validate the results of these equations by comparing them against actual results of this game, using this online tool - Monty Hall Paradox Test Tool.
There is nothing wrong if you think like this - out of any \(n\) choices having 1 winning option, removing any (non-winning) \(m\) options should not make a difference to the relative winning probabilities of the remaining choices.
E.g. if there were 10 doors, each door had a winning probability of 0.1, and now if 5 doors are removed at random (empty ones), each remaining door will have a winning probability of 0.2. So what difference does it make if I switch my selection? Every door has the same relative chance of winning.
There is a catch, a big catch here. The above logic is completely correct. But that is not what is happening in this game. The host is opening the non-winning door not from the complete set (of n=3 doors). He is opening (and thus removing) the non-winning door from a specific proper subset of \(\boldsymbol{n}\) - the set which excludes the choice initially made by the player. Because of this, the odds of all the remaining doors do not increase equally (or, in other words, the relative odds do not remain equal).
By opening (removing) a door from a specific subset (and not from the complete set), the host is giving an advantage to that subset, which makes the door(s) in that subset different from the other doors.
Hence, the advantage in moving over to that subset!
Another analogy. If a stupid person moved out of North America, the average IQ of NA goes up. But if the person specifically moved from, say Mexico, the average IQ of Mexico increases even more than that of NA. While those of Canada and the USA remain the same.
In the game, by removing the non-winning door from a set that excludes the player's initial choice, the winning probability of each remaining door goes up, but that of the set mentioned goes up even more! So, it's the subtle act of marking a set before removing the door that makes the difference! Life is fun, isn't it?