Probing The Full Monty Hall Problem

Abstract

The Monty Hall Problem is a classic brainteaser that illustrates most people's misconceptions about probability. It is similar to the one used on the gameshow Let's Make a Deal that Monty Hall hosted. There are three doors, behind one of which is a prize. The contestant picks one door, the host opens a non-winning door, and the host gives the player the option to switch to the other closed door. You actually double your chances of winning by abandoning the initially chosen door is very counter-intuitive to most people. Because I was never satisfied by explanations for this, I generalized the problem and developed an intuitive (for me) rationale for why this happens. In this tutorial, I present that idea and use it to generalize the problem further.

1. Introduction

original image
An interesting problem in probability is known as the Monty Hall Problem[1]. The scenario is best illustrated using a game show; Monty Hall was a legendary game show host. Suppose game-show contestants are shown three doors, and there is a prize behind one of them. Contestants are asked to pick a door, giving them a one in three chance of winning. The host then opens one of the losing doors and asks contestants if they would like to switch to the remaining door. Most people's intuition says that it doesn't matter if they change or not, and your likelihood of winning will still be one in three. Other people will think about it for a bit and determine that once there are only two doors from which to pick, the likelihood of winning would be one in two for each door, and switching again wouldn't matter. Others might think there is still a one in three chance of winning by not changing and a one in two chance by switching, making switching give slightly better odds.  In reality, however, contestants' likelihood of winning doubles to two in three if they change doors. This is surprising to most people, even statisticians, but it can easily be proven by simply going through all the cases as shown in the Table--I have arbitrarily picked door #2 as the winning door.
Initial Pick Host Opens Stay at Switch to
1 3 1 2 (win)
2 1 or 3 2 (win) 1 or 3
3 1 3 2 (win)
Wins 1 in 3 2 in 3

2. Generalizing the problem

I could never provide a convincing explanation to myself or others for this.  I had read some things about how the host provides contestants more information by opening a non-winning door, of which there is only one if the contestant didn’t initially pick the winning door. However, I could never understand precisely how this extra information led to doubling the chance to win. As this is always a fun bit of trivia to discuss with other people, I wanted to develop a reasonable explanation that people without a background in statistics could understand. Thus, I went about studying the problem, looking at it in different ways, and generalizing it so that there were some number of doors, N d N d N_(d)N_d, of which the player could pick one. After selecting, the host would open some number of doors, N o N o N_(o)N_o.  This would then leave N c = N d N o N c = N d N o N_(c)=N_(d)-N_(o)N_c = N_d - N_o doors remaining closed from which to switch.
Given these two numbers ( N d N d N_(d)N_d and N c N c N_(c)N_c, or N d N d N_(d)N_d and N o N o N_(o)N_o), the problem is to determine the difference in the likelihood of winning between switching doors and not. In the classic case, N d = 3 N d = 3 N_(d)=3N_d = 3, N o = 1 N o = 1 N_(o)=1N_o = 1, and N c = 2 N c = 2 N_(c)=2N_c = 2. There are obviously some limiting cases, such as when N d = 1 N d = 1 N_(d)=1N_d = 1--there is only one door--and N c = 1 N c = 1 N_(c)=1N_c = 1--the contestant picked the winning door, and the host opened all the others--in which winning is 100%. I derived the probability difference in all cases, allowing me to better explain the result.  The probability of winning by staying, i.e., not switching, is, of course, p s t = 1 / N d p s t = 1 / N d p_(st)=1//N_(d)p_{st}=1/N_d; it does not change after the host opens a door.  The probability of winning by switching is
p s w = N d 1 N d ( N c 1 ) ; p s w = N d 1 N d ( N c 1 ) ; p_(sw)=(N_(d)-1)/(N_(d)(N_(c)-1));p_{sw}=\frac{N_d-1}{N_d(N_c-1)};
I'll explain how I derived this later.
If N d = 1 N d = 1 N_(d)=1N_d = 1, the probability of winning by staying is obviously 100%, and the likelihood of winning by switching--not picking any door--is 0%.  If N c = 2 N c = 2 N_(c)=2N_c = 2 and the host leaves you one other option, the probability of winning is 1 1 / N d 1 1 / N d 1-1//N_(d)1 - 1/N_d, since the chance of the prize being behind one of the two remaining closed doors is ( 1 1 / N d ) + 1 / N d = 1 ( 1 1 / N d ) + 1 / N d = 1 (1-1//N_(d))+1//N_(d)=1(1 - 1/N_d) + 1/N_d = 1 or 100%.  Thus, when the host only leaves one other option, the more doors there are to start, the better it is to switch; as N d N d N_(d)rarr ooN_d \rightarrow \infty the chances of winning by changing goes to 100%.

2.1. Evening the odds

For the chances of winning by switching to be greater than 50%, it must be true that
N c < 3 2 N d . N c < 3 2 N d . N_(c) < 3-(2)/(N_(d)).N_c < 3 - \frac{2}{N_d}.
Since N d N d N_(d)N_d and N c N c N_(c)N_c are integers and if N d > 2 N d > 2 N_(d) > 2N_d > 2 and N c > 1 N c > 1 N_(c) > 1N_c > 1--for a non-trivial game-- N c N c N_(c)N_c must be equal to two for this to be the case.  Thus, the player's chances of winning are only greater than 50% if the host only leaves two doors closed.

3. Should the player always switch?

The probability of winning by switching divided by the chance of winning by not changing is
(1) p s w p s t = N d 1 N c 1 = N d 1 N d ( N c 1 ) . (1) p s w p s t = N d 1 N c 1 = N d 1 N d ( N c 1 ) . {:(1)(p_(sw))/(p_(st))=(N_(d)-1)/(N_(c)-1)=(N_(d)-1)/(N_(d)(N_(c)-1)).:}\begin{equation} \frac{p_{sw}}{p_{st}}=\frac{N_d-1}{N_c-1}=\frac{N_d-1}{N_d(N_c-1)}. \label{eq:0} \end{equation}
Since N d N d N_(d)N_d will always be greater than N c N c N_(c)N_c, this will always be greater than one (100%), and it is always better to switch doors whatever the circumstances.
We know that for the classic case ( N d = 3 N d = 3 N_(d)=3N_d = 3, N o = 1 N o = 1 N_(o)=1N_o = 1), the chances of winning by switching is double that of winning by staying.  It's interesting to explore when switching at least doubles the player's chance of winning in the general case.  It turns out that if
N o N d 1 2 , N o N d 1 2 , N_(o) >= (N_(d)-1)/(2),N_o\ge \frac{N_d-1}{2},
then the player at least doubles their chances of winning by switching.  As N d N d N_(d)N_d gets large, this approaches N d / 2 N d / 2 N_(d)//2N_d/2, so the host needs to open at least half the doors.
original image
The image above shows the cases in which one would double their chances of winning by switching. Of course, the host cannot open more doors than those left after the contestant has chosen. Thus, the upper-left region of the chart represents unfeasible games. Because all values need to be integers, the valid scenarios occur at the intersection of grid lines--why you actually need not assume integer values is discussed later. Of these cases, those that double the chances of winning by switching are indicated by yellow dots. The traditional situation is shown by the dot on the orange line at coordinate (3,1), i.e., the odds of winning by switching is precisely twice that of staying. This is also the case whenever there are an odd number of doors, and the host opens N o = ( N d 1 ) / 2 N o = ( N d 1 ) / 2 N_(o)=(N_(d)-1)//2N_o=(N_d-1)/2 of them. The blue line gives situations where the player always wins, i.e., if the host opens all but the winning door. If there are more than five doors, intermediate results where contestants more than double their chances of winning are possible. Again, players are always more likely to win by switching no matter what the circumstances.
original image
The image above shows the same information as the previous figure but in more detail and a slightly different way. In this case, I have used the number of doors remaining closed, N c N c N_(c)N_c. This shows the contours of increased chances of winning for various situations. Again, the classic case is at (3,2), and it should be clear that switching always increases the player's chances of winning. As the number of doors remaining closed decreases, it becomes better and better to switch. If there are four doors and only two remain closed after the host's actions, changing triples the player's chances. If there are six doors and only two remain closed, switching is fives times better than staying.

4. My simplest explanation

All that being said, the simplest explanation I could develop for the classic game goes as follows. Consider a second contestant. The first contestant picks one of the three doors. The host opens one non-winning door, and the second contestant is given the remaining door. We know that since the host does not open the winning door, one of the two contestants must win. Because the first contestant still has a one in three chance of winning, the second contestant must have a two in three. In the original problem, nothing prevents the first contestant from playing the role of the second contestant, and thus, switching doubles the probability of winning.
Generalizing to four doors with the host opening one after the first contestant picks, the first contestant has a one in four chance of winning should they not switch. The second contestant then has two doors from which to choose. If this second contestant could pick both doors, they would have a three in four chance of winning. However, because they can only choose one door, their actual chances of winning are three in eight, giving them a 50% greater chance of winning than the original contestant. Thus, in this scenario, it is 50% better to switch doors.
You can see how this percentage continues to drop as there become more and more doors--but the host still only opens one--by considering the dashed line in the second figure. In these cases, the number of doors remaining closed is always one less than the total number of doors, which is the 45 o 45 o 45^("o")45^\text{o} degree line on the chart starting from the point (2,1). E.g., when there are seven initial doors, switching increases the contestant's chances of winning by only 20%.

5. Generalizing further

Non-integer values for the door counts are useful when scaling the scenarios. For example, if there are six doors, the contestant picks two, and the host opens two, the situation is identical to the classic case. Likewise, having nine doors with the player and host each choosing three would be equivalent to the classic game. However, having seven doors, the contestant picks two, and the host picks two, would be the same case as if there were 3.5 doors and the contestant and host each pick one.
These scenarios all assume that the player either keeps all the initially picked doors or switches them to the remaining unopened doors. We can, however, remove this assumption, and I will go through the details of how I used the understanding described above to determine how this works.
For example, assume there are six doors, the player can pick two, the host selects one, and the player can then switch any number of the doors. Initially, each door has a one in six chance of containing the prize. Picking two gives the player a one in three (1:3) chance of winning. After the host opens one door, there are three remaining. Let's now consider a second contestant. Since one of the two contestants must win, the second contestant has a two in three (2:3) chance of winning by picking the remaining three doors. That means these doors now have a two in nine (2:9) chance of containing the prize. Thus, if the initial player switches both doors, their odds of winning will increase to four in nine (2:9 + 2:9 = 4:9), i.e., winning increases from 33% to 44%. If the player only switches one door, the odds are seven in 18 (2:9 + 1:6 = 7:18), and the odds of winning increase to 39%.
Let's now generalize this to N d N d N_(d)N_d doors with the player picking N p N p N_(p)N_p, the host opening N o N o N_(o)N_o, and the player switching N s w N p N s w N p N_(sw) <= N_(p)N_{sw} \le N_p doors. The initial chances of winning are then N p / N d N p / N d N_(p)//N_(d)N_p/N_d, which is also the final chances when N s w = 0 N s w = 0 N_(sw)=0N_{sw}=0. Each initial door has a one in N d N d N_(d)N_d (1: N d N d N_(d)N_d) chance of containing the prize. The fictitious second contestant then has a 1 N p / N d = ( N d N p ) / N d 1 N p / N d = ( N d N p ) / N d 1-N_(p)//N_(d)=(N_(d)-N_(p))//N_(d)1 - N_p/N_d = (N_d-N_p)/N_d chance to win. However, they only have N d N p N o N d N p N o N_(d)-N_(p)-N_(o)N_d-N_p-N_o doors from which to choose. The chance that one of these remaining doors contains the prize is then
(2) N d N p N d × 1 N d N p N o . (2) N d N p N d × 1 N d N p N o . {:(2)(N_(d)-N_(p))/(N_(d))xx(1)/(N_(d)-N_(p)-N_(o)).:}\begin{equation} \frac{N_d-N_p}{N_d}\times\frac{1}{N_d-N_p-N_o}. \label{eq:1} \end{equation}
Every door the player switches then changes from a probability of having the prize of 1 / N d 1 / N d 1//N_(d)1/N_d to the chance given by 2. Since the host will open at least one door ( N o 1 N o 1 N_(o) >= 1N_o \ge 1), N d N p < N d N p N o N d N p < N d N p N o N_(d)-N_(p) < N_(d)-N_(p)-N_(o)N_d-N_p < N_d-N_p-N_o, and the doors the player did not initially pick have a probability of winning greater than the ones they chose. Thus, it is always beneficial to switch as many doors as possible. The new chance of winning is then
(3) p = N s w ( N d N p ) N d ( N d N p N o ) + N p N s w N d = N d N p N o N p N p 2 + N o N s w N d ( N d N o N p ) . (3) p = N s w ( N d N p ) N d ( N d N p N o ) + N p N s w N d = N d N p N o N p N p 2 + N o N s w N d ( N d N o N p ) . {:(3){:[p=(N_(sw)(N_(d)-N_(p)))/(N_(d)(N_(d)-N_(p)-N_(o)))+(N_(p)-N_(sw))/(N_(d))],[=(N_(d)N_(p)-N_(o)N_(p)-N_(p)^(2)+N_(o)N_(sw))/(N_(d)(N_(d)-N_(o)-N_(p))).]:}:}\begin{equation} \begin{split} p& =\frac{N_{sw}(N_d-N_p)}{N_d(N_d-N_p-N_o)}+\frac{N_p-N_{sw}}{N_d}\\ & =\frac{N_d N_p - N_o N_p-N_p^2+N_o N_{sw}}{N_d(N_d -N_o-N_p)}. \label{eq:2} \end{split} \end{equation}
While it would not always be possible for a player to switch all the initially chosen doors--e.g., there are five doors, the player picks two, and the host opens two--if N s w = N p N s w = N p N_(sw)=N_(p)N_{sw}=N_p then ??? becomes
(4) p = ( N p N d ) ( N d N p N d N o N p ) . (4) p = N p N d N d N p N d N o N p . {:(4)p=((N_(p))/(N_(d)))((N_(d)-N_(p))/(N_(d)-N_(o)-N_(p))).:}\begin{equation} p =\left(\frac{N_p}{N_d}\right)\left(\frac{N_d - N_p}{N_d -N_o-N_p}\right). \label{eq:3} \end{equation}
Since the first term in parentheses is the probability of winning by staying, the ratio between the chances of winning by switching all doors to keeping the initial choices is
p s w p s t = N d N p N d N o N p . p s w p s t = N d N p N d N o N p . (p_(sw))/(p_(st))=(N_(d)-N_(p))/(N_(d)-N_(o)-N_(p)).\frac{p_{sw}}{p_{st}}=\frac{N_d - N_p}{N_d -N_o-N_p}.
In the case where not all doors are switched, because it's not possible or the player chose to keep some initially picked doors, this ratio is
p s w p s t = N d N p N o N p N p 2 + N o N s w N p ( N d N o N p ) p s w p s t = N d N p N o N p N p 2 + N o N s w N p ( N d N o N p ) (p_(sw))/(p_(st))=(N_(d)N_(p)-N_(o)N_(p)-N_(p)^(2)+N_(o)N_(sw))/(N_(p)(N_(d)-N_(o)-N_(p)))\frac{p_{sw}}{p_{st}}=\frac{N_d N_p - N_o N_p-N_p^2+N_o N_{sw}}{N_p(N_d -N_o-N_p)}
and can be shown to always be greater than one if N s w > 0 N s w > 0 N_(sw) > 0N_{sw}>0. Thus, it is still best to switch as many doors as possible in these other generalized scenarios.
Playing around with these last equations will establish how many of these more general scenarios are included 1 if non-integer numbers are considered. For example, the case with seven doors, the player selecting two, the host opening two, and the player switching two, is identical to the situation of 3.5 doors, the player picking one, the host opening one, and the player changing. In both cases, the win probability is 47.6% (up from 28.6%).
There are even more generalizations one could consider. For example, what if more than one door contains a prize? Another variable, say N $ N $ N_($)N_\$, becomes part of the problem. What happens if the host is allowed to open some, but not all, doors with prizes? Would it still always be better to switch? When there is more than one prize, and the player can pick more than one door, what does it mean to win? Does picking one winning door constitute a win? Should picking both winning doors count as two wins? Is there an optimal number of doors that should be switched?
The host's behavior also needs to be defined more carefully. In the one-prize game, either the host can know where the winning door is and never choose it, or the host game picks randomly and possibly opens the winning door. When there are multiple prizes, the host could be unaware of one or more winning doors. If there is more than one winning door and the host can only choose one, the player could still win at least one prize if the host is unaware of which doors contain prizes. It also could be the case that the host knows and will not choose some, but not all, of the winning doors. Finally, it could be possible that the host makes sure to select non-winning doors but is not required to only select doors the player has not. I will leave the analysis of these generalizations--and whatever others can be considered[2]--to the reader. Appendix: Pseudo-Code implements some of these other scenarios for the reader to explore by simulating games.

6. Simulations

It is not difficult to simulate these games with a computer. The algorithm is simple enough that you can run millions of simulations to get a very accurate estimation of the win rate--pseudo-code is contained in an Appendix. The animated image below[3] shows how a win rate converges as the number of games simulated grows. The scenario simulated here is that N d N d N_(d)N_d varies from three to 20 doors, N o = 1 N o = 1 N_(o)=1N_o=1, and N p N p N_(p)N_p varies in the feasible range. The red surface is simply a plot of equation 4 and the blue dots are the simulation results. The first frame shows the results of four simulated games, and there is clearly much variation from the expected win rate. As the number of simulations doubles up to 2 20 = 1 , 048 , 576 2 20 = 1 , 048 , 576 2^(20)=1,048,5762^{20}=1,048,576, the simulated win rate converges to the expected value.
image

7. Psychological aspects

While the mathematics of the generalized Monty Hall problem is fascinating, there is also an interesting psychological aspect to this game when played with actual people. One finds that most people will not switch their selection given a chance, which is because most people fear regret. In the classic game, once the host reveals whether they picked the right door after switching or not, they will know what is behind all the doors and thus know if switching costs them the prize. They know they would feel terrible if they had initially picked the winning door to only realize that switching cost them the award.
Given more doors such that contestants are not ultimately aware of the ramifications of switching might prompt more contestants to switch. However, other psychological aspects would likely make most contestants stay with the same door. First, they feel that they picked the original door for a reason--they had a hunch--and switching would mean the original reason must have been wrong. Second, it is simply easier to not have to choose again. When I tried this with students, not a single person decided to switch even after playing a few rounds when it should have been clear that switching was better. The prizes, however, were not significant, so they did not put much thought into how they played.

8. Appendix: Pseudo-Code

Pseudo-code (Mathematica) for simulating a number of games, nGames, with total doors, nDoors, total winning doors, nPrizes, doors selected by the player, nSelected, the number of doors the player switches, nSwitch, and whether the host makes sure to pick a losing door, hostLoses. Without loss of generality, it is assumed the winning doors are at the start of the range of doors.
doors = Range[1,nDoors];
prizes = Range[1,nPrizes];
wins = 0;
losses = 0;
Do[
	selected = RandomSample[doors, nSelected]; 
 	remainingDoorsHost = Complement[doors, selected]; 
 	If[hostLoses, 
  		remainingDoorsHost = Complement[remainingDoorsHost, prizes]
  	];
  	numberToOpen = Min[Length[remainingDoorsHost], nOpened]
 	hostOpens = RandomSample[remainingDoorsHost, numberToOpen]; 
 	remainingDoorsPlayer = Complement[doors, Join[selected, hostOpens]]; 
 	If[nSwitched>0, 
  		nDoorsToSwitch = Min[Length[selected], nSwitch];
  		doorsToSwitch = RandomSample[selected, nDoorsToSwitch];
  		doorsToSwitchTo = Complement[remainingDoorsPlayer, 
			Join[selected, doorsToSwitch]];
		nDoorsToSwitchTo = Min[Length[doorsToSwitchTo], nSwitch];
		doorsSwitchedTo = RandomSample[doorsToSwitchTo, nDoorsToSwitchTo];
  		playerDoors = Join[Complement[selected, doorsToSwitch], 
			doorsSwitchedTo],
        (* else *)
		playerDoor = selected]; 
 	If[ContainsAny[playerDoors, prizes], wins++, losses++];
{nGames}]

9. Appendix: Other Simulations

9.1. Convergence with Two Prizes

The two images below show the convergence--if your browser supports animated PNGs--of the simulations in two cases where there are two prizes, and winning is defined as finding one or both prizes. The host always opens a non-winning door. The number of doors switched is always the maximum possible. The lighter dots in each case show the actual values for the case in which the contestant does not exchange any doors, which is
p s t = 1 N l C N p N d C N p p s t = 1 N l C N p N d C N p p_(st)=1-(_(N_(l))C_(N_(p)))/(_(N_(d))C_(N_(p)))p_{st}=1-\frac{{}_{N_l}C_{N_p}}{{}_{N_d}C_{N_p}}
with N l = N d N $ N l = N d N $ N_(l)=N_(d)-N_($)N_{l}=N_d-N_\$ the number of losing doors and
n C r = n ! r ! ( n r ) ! n C r = n ! r ! ( n r ) ! _(n)C_(r)=(n!)/(r!(n-r)!){}_n C_r = \frac{n!}{r!(n-r)!}
the number of combinations of r r rr elements picked from a possible n n nn.
image
image

9.2. Two Prizes, One Opened, Up to Two Switched

The next image (below) shows cases in which there are two prizes, the host opens one losing door, and the contestant switches zero (red), one (green), or two (blue) doors. The total number of doors and the number the player choses vary according to the figure. Again, winning is finding one or both prizes. For a given number of chosen doors, lines connect cases in which the total number of doors are the same. As these lines have a positive slope, it should be clear that it is always better to switch in these scenarios.
image

9.3. Host Does Not Necessarily Lose

The following image shows the same scenarios as above, except in these games, the host does not know what doors contain prizes and picks a door at random. The lines connecting cases with the same number of total doors are all horizontal in all these cases. Thus, as one should expect, there is no benefit to switching doors since the host is essentially another player with no additional knowledge.
image

9.4. Two Prizes, Two Opened, Up to Two Switched

These cases are the same as those in section 9.2, except the host now opens two losing doors. Comparing this chart to the one in that section shows that it is even more prudent to switch as many doors as possible with the hosting opening two doors.
image

9.5. Two Prizes, One Opened, Up to Two Switched, Must Find Both

These cases are identical to those in section 9.2, except the contestant must now find both prizes to win. Obviously, the chances of winning are now much lower, but it is still always better to switch as many doors as allowed.
image

9.6. Cases When Switching is Bad

You might think that it is always better to switch regardless of the scenario. However, it's not challenging to develop situations where switching decreases the player's chances of winning. For example, consider the case in which there are five doors and one prize, the player picks three doors, the host opens two of the losing doors the contestant chose and one additional losing door. Switching decreases the chances of winning from 60% to 40%. The simulations below show below generalize this scenario for more total doors and more doors selected. It's then clear that when the host chooses doors in this way, it is very often, but not always, best to not switch. Note: The pseudo-code does not cover this case, and I leave it to the reader to modify it to reproduce the below results.
image

10. Appendix: Online Simulator

Please note that this simulator does not currently validate all inputs to make sure they constitute a viable game.
I wrote this simulator in Javascript using D3. It runs in your browser, which can typically simulate one million games in a few seconds. The top chart shows the outcome of the last simulation run, i.e. the doors, the prizes, the doors selected, the doors opened, and the doors switched. It lists how many of the simulations resulted in the player winning and losing, and gives the win rate.
The bar chart shows the win rate for up to the last ten simulated games. This is allows you to make comparisons for different scenarios you run. The blue dots show the convergence of the after 10 N 10 N 10 ^(N)10^N simulations.
If the simulator does not appear in the frame below, click here to access it directly.
I wrote this simulator using Mathematica and the Wolfram Language--these were used to run the simulations for the charts in the paper. It's hosted on Wolfram Research's servers and does the simulations server-side. It simulates three scenarios one million times and generates a plot showing the convergence of three. The three cases consist of the one the user submits as well as two other cases with the player switching more or fewer doors.

11. References


  1. The Monty Hall Problem, Wikipedia ↩︎
  2. If your browser supports animated PNGs. ↩︎

Recommended for you

Srishti Saha
Text Generation Models - Introduction and a Demo using the GPT-J model
Text Generation Models - Introduction and a Demo using the GPT-J model
The below article describes the mechanism of text generation models. We cover the basic model like Markov Chains as well the more advanced deep learning models. We also give a demo of domain-specific text generation using the latest GPT-J model.
26 points
0 issues