# Experimental design: Monty Hall

Regarding the infamous Monty Hall problem:

I’ve sketched out all the possible answers on paper, and still can’t see how switching doors would have any effect. Rather than revel in ignorance, I’ve decided to take Cecil’s advice and play the game myself. I propose the following experiment:

1. Take three unmarked playing cards from the same deck: two jokers and one king. The cards will represent the doors–jokers are doors with no prize; the king is the door with the prize.

2. Shuffle cards and place face-down.

3. Roll a single six-sided die. If I roll a 1 or a 4, I choose the first card on the left. If I roll a 2 or a 5, I choose the middle card. If I roll a 3 or a 6, I choose the card on the right.

4. I move the chosen card to the side.

5. I flip a single fair coin once. This represents Monty. If it lands heads, I turn over the remaining card on the left. If it lands tails, I turn over the remaining card on the right.

6. If the turned card reveals the king, it is declared “no game.” Monty wouldn’t do that in real life; but as we are relying on random chance to make our moves, this sequence of events will pop up.

7. Assuming Monty turns over a non-prize door, I flip the coin again. Heads, I keep my original card. Tails, I switch for the remaining unturned card.

8. I turn over my final chosen card to finish the game.

9. Repeat.

Now, before I spend an afternoon flipping and rolling, I’d like some feedback. Does this seem like an accurate representation of the game? I wanted to remove all possible bias and make all the moves purely random. So the die chooses my original “door,” the coin chooses Monty’s door, and then the same coin chooses whether I keep or switch. Is that good, or am I missing a subtlety somewhere?

Second, how many iterations would be required to make a reliable test? I’m thinking at least 100. I figure 1/3rd of the runs will end in a “no game,” and I want enough good runs to have some confidence in the results.

B.

No. Because Monty knows where the Jokers and the King are. He isn’t guessing when he shows you a Joker.

OK, then how to revise the experiment to reflect that?

(I thought removing the “no game” situations accomplished that. Monty knows where the King is. If the experiment shows you the King, then that obviously isn’t Monty, but some inexperienced stage hand. We discard it, and count only those runs that behave in a manner consistent with the game.)

Just look at the two remaining cards after you use a die to pick a card. You can’t eliminate the king, you have to eliminate a joker. So you have two remaining cards, either two jokers, or a joker and a king. If it’s two jokers, it doesn’t matter which one. If it’s a joker and a king, eliminate the joker.

You should be able to see that whenever its two jokers, switching doesn’t help. But whenever its a joker and a king, switching does work because you will get the king. The remaining cards will be a joker and king more often than two jokers. That’s why you’re better off switching.

You’re discarding half the cases where switching would have helped you (and none of the cases where it would have hurt you). Thus you will conclude, falsely, that switching does not increase your probability of winning, when in fact it makes you twice as likely to win.

Perhaps this point will allow you to gain the understanding you’re seeking.

Here’s how you should do it:

1. Take three unmarked playing cards from the same deck: two jokers and one king. The cards will represent the doors–jokers are doors with no prize; the king is the door with the prize.

2. Shuffle cards and place face-down.

3. Roll a single six-sided die. If I roll a 1 or a 4, I choose the first card on the left. If I roll a 2 or a 5, I choose the middle card. If I roll a 3 or a 6, I choose the card on the right.

4. I move the chosen card to the side.

5. Turn over the remaining two cards.

6. If the remaining two cards are a king and a joker, discard the joker.

7. If the remaining two cards are both jokers, discard one of them at random.

8. Turn the remaining card back face down.

9. Flip the coin again. Heads, I keep my original card. Tails, I switch for the remaining unturned card.

10. I turn over my final chosen card to finish the game.

11. Repeat.

If you play this game 3000 times, and keep track of the four possible results - switch and win, switch and lose, hold and win, hold and lose - you should come up with results approximately like this:

switch and win - 1000
switch and lose - 1000
hold and win - 500
hold and lose - 500

So if you look to the actions which led to a win, you see that switching led to twice as many wins as holding.

To make it clearer, change step #9.

Play the game 3000 times and always switch. Then play it 3000 times and always hold.

The first time, you should get approximately 2000 wins and 1000 losses. The second time, you should get approximately 1000 wins and 2000 losses.

This. Rather than go ahead with the Monte Carlo solution, would this proof convince you? Your mistake is in Step 5 - Monty doesn’t choose which door to open at random. Monty knows which door is correct, and NEVER opens it.

Failing that, I second Little Nemo’s “two part” Monte Carlo solution. Run once, always switching, and another time, never switching. Then you never have to deal with additional dice and coins -

Step 1: Shuffle
Step 2: Deal cards face up. Set aside first card as your first choice, discard one of the jokers from the second and third cards.
Step 3: [Switch/No switch]

Record if you won, repeat.

Yep, the reason your experimental design is wrong co-incides precisely with why you don’t understand why switching works. When you understand one, you will understand the other.

Change step 6 to “If the turned card reveals the king, then switch to the king. Goto step 8”

No, the game is never played like that. That would be the equivalent of you picking a door and then Monty opening another door to reveal the prize and handing it to you.

Is there a reason not to simplify this by dividing the trials into two runs, one where you always switch and one where you never switch?

1. Take three unmarked playing cards from the same deck: two jokers and one king. The cards will represent the doors–jokers are doors with no prize; the king is the door with the prize.

2. Shuffle cards and place face-down.

3. Roll a single six-sided die. If I roll a 1 or a 4, I choose the first card on the left. If I roll a 2 or a 5, I choose the middle card. If I roll a 3 or a 6, I choose the card on the right.

4. I move the chosen card to the side.

5. Turn over the remaining two cards.

For the first “total number of trials”/2 trials it’s a win if one of the two is a king. For the second “total number of trials”/2 trials it’s a loss if one of the two is a king. Compare the number of wins between switching and not switching.

If he can understand why this is a fair demonstration, he doesn’t need to run the test to understand the results.

I like either variant of Little Nemo’s game. Essentially, you use chance where chance would play a role in the real game, and play the role of Monty by the algorithm where Monty would act.

The first example let’s chance decide if you switch or stay, and you keep track of which the coin tells you. The second example you set a consistent strategy and record results, then run a same number of trials with the opposite consistent strategy.

Beruang, TriPolar’s post should illustrate without actually running numbers.

I put together a results table that lists the probabilities - I’ll see if I can replicate it here:

``````

You pick     Car Location     Host Opens     Total Prob.     Stay     Switch
(prob)          (prob)          (prob)
____________________________________________________________________________
Door 1          Door 1          Door 2          1/18         car      goat
1/3             1/3             1/2
______________________________________________
Door 3          1/18         car      goat
1/2
_______________________________________________________________
Door 2          Door 2          0             -        -
1/3              0
______________________________________________
Door 3          1/9          goat      car
1
_______________________________________________________________
Door 3          Door 2          1/9          goat      car
1/3              1
______________________________________________
Door 3          0             -        -
0
____________________________________________________________________________
Door 2          Door 1          Door 1          0             -        -
1/3             1/3             0
______________________________________________
Door 3          1/9          goat      car
1
_______________________________________________________________
Door 2          Door 1          1/18         car      goat
1/3             1/2
______________________________________________
Door 3          1/18         car      goat
1/2
_______________________________________________________________
Door 3          Door 1          1/9          goat      car
1/3              1
______________________________________________
Door 3          0             -        -
0
____________________________________________________________________________
Door 3          Door 1          Door 1          0             -        -
1/3             1/3              0
______________________________________________
Door 2          1/9          goat      car
1
_______________________________________________________________
Door 2          Door 1          1/9          goat      car
1/3              1
______________________________________________
Door 2          0             -        -
0
_______________________________________________________________
Door 3          Door 1          1/18         goat      car
1/3             1/2
______________________________________________
Door 2          1/18         goat      car
1/2
____________________________________________________________________________
Sum of Prob =   1
Prob strategy wins =  1/3      2/3

``````

First column is your first choice, and the probability you pick each door = 1/3 in each case.

Second column shows the location of the car and probability, 1/3 each case. That is presented for each of the 3 initial door choices.

Third column shows the host’s choice. Here is the key: if you pick the door with the car, the host has a 1/2 probability of picking either door; otherwise, the host has a probability of 1 of picking the specific door without the car and a prob of 0 of picking the door you picked.

Column 4 shows the total probability of that option given the door you picked, the door with the car, and the door the host picks. It will either show 1/18 or 1/9, depending on your initial choice, which constrains the host.

Column 5 and 6 show the outcome if you use the listed strategy - column 5 is Stay and column 6 is switch.

At the bottom, I have summed the probability column, which sums to 1 - as it should. This shows that all the situations are accounted for.

I then sum the probabilities associated with each strategy. Take column 5, count the number of "car"s and their associated probabilities, sum. Take column 6, count the number of "car"s and their associated probabilities, and sum.

If you do you will see you win the car 1/3 of the time when you stay and 2/3 of the time when you switch.

With this problem, I’ve found that different people respond to different explanations. At the risk of complicating it even more, here’s mine:

The key point is, Monty knows where the winner is, so right after your first selection he knows if you’ve already won (drawn the king) or lost (drawn one of the jokers). He always offers the chance to switch because, well, he can (i.e. he can always show you a joker was one of the two cards you didn’t pick.

But this demonstration is irrelevant; the odds of winning on the first draw were and are always one in three. To see this, suppose Monty hadn’t revealed one of the cards, but instead offered you the following equivalent trade: “You can keep your card, or you can trade it for the two that haven’t been shown; if either of these two is a winner, you win.” Would you keep your first selection, or make the trade? If it’s still not clear, imagine the came involved 100 cards, you pick one, and Monty asks you a similar question (“do you keep the one you picked, or do you take the other 99?”); now do you make the trade?

Of course–as others have noted–the key point is that Monty will always offer the trade, regardless of your first selection, and he always reveals a joker.

Thanks! That’s the clearest explanation I’ve heard. (As CJJ notes, different people will glom onto different explanations, and this one gloms for me.)

Little Nemo:

First: thanks. Those rules make sense. I’ll give them a try.

Second: I may be stubborn, but I’m not dense – I think I’ll be convinced long before 3,000 tests.

Third:

Are you sure those numbers are correct? Because as I read them, I’ve got a 50% chance of winning when I switch, but also a 50% chance of winning if I hold.

When I posted them, I realized they could be difficult to interpret, which is why I made my next post about running a test with clearer results.

But the data I posted does support switching. You have to look at the results you want to end up with and then work backwards to the actions which produced those results.

You want to win. So you look at the results that led to a win:

switch and win - 1000
hold and win - 500

So you see the action you should choose is switching because it gives you twice as many wins as holding.

Here’s another way of looking at it which might make the odds intuitively obvious.

You’re going to pick a random door out of three choices. One door wins and two doors lose.

Now without knowing yet what’s behind the door you picked, it should be obvious that you had a one third chance of picking the winning door and a two thirds chance of picking one of the losing doors.

Monty does his shuffle at this point and eliminates a losing door that you didn’t pick. Now because of this, there is one situation you’ll never face - you’ll never be able to switch from one losing door for another losing door. The only possibilities are switching from a winning door to a losing door or switching from a losing door to a winning door. So if you picked a losing door to start with, you will always win if you switch.

And now go back to what I said above: you originally had a one third chance of picking the winning door and a two thirds chance of picking a losing door. That means that one third of the time you will win by holding and two thirds of the time you will win by switching.

Every description of this problem I’ve seen (outside of the SD) has been misleading. You have to highlight the fact that a door is not being eliminated at random. Only a losing door is eliminated after the initial pick. Then you can see that 2 out of 3 times the remaining door has the big prize.

Monty Hall talked about the problem, and also pointed out how reality differs from the analysis. In the real show, the idea is to get a winner. They want the show to end on a high note. Monty knows whats behind all the doors, and he tries really hard to get you to switch if you picked the loser. Not so much if you picked the winner.