And behind THIS dor we have...
March 18, 2007 8:54 PM   Subscribe

[Riddle Filter] You are on a game show. There are three doors to choose from, two of which contain smelly goats, and one containing a million dollars.

You pick door number one. The game show host, who knows which door contains the money, shows you door number 3. Door number 3 has a goat in it.

He then offers you the choice to remain with your original door choice, number 1, or to switch to number 2.

Which one gives you the advantage?

[Answer]

Switching to number 2 does.

[/Answer]


But why?
posted by Phire to Grab Bag (79 answers total) 11 users marked this as a favorite
 


Best answer: It's called the Monty Hall Problem and has been discussed all over the internets.
posted by rhapsodie at 9:01 PM on March 18, 2007


Best answer: There's a gigantic Wikipedia article on this that covers everything you would ever want to know (and probably more).
posted by 0xFCAF at 9:01 PM on March 18, 2007


Well, then. Ditto.
posted by rhapsodie at 9:02 PM on March 18, 2007


Best answer: Including Askmefi. .. it still blows my mind, though
posted by Rumple at 9:18 PM on March 18, 2007


Response by poster: Goodness. >< I had no idea how to begin searching for it - but thank you so much!! And apologies.
posted by Phire at 9:20 PM on March 18, 2007


Three sentence summary for the impatient (though the amount of highly intelligent people who get this wrong, and the backstory as a whole, are interesting enough to read the links):

It depends on whether the host intentionally avoided opening the door with the cash, something sometimes left ambiguous in the problem. If he didn't, then the choice is arbitrary for the reasons you assume. If he did, which is the standard and much more interesting version of the problem, then it's guaranteed that if there were any money in the other two, it's in the one he left closed--in other words, he's picked the door with the money for you by avoiding it, as long as it was there for him to pick. Whereas your original choice has the same 1/3 chance it always did. QED.
posted by abcde at 9:37 PM on March 18, 2007


I think abcde's explanation is better than the one at Wikipedia.
posted by Brian James at 10:33 PM on March 18, 2007


If he did, which is the standard and much more interesting version of the problem, then it's guaranteed that if there were any money in the other two, it's in the one he left closed--in other words, he's picked the door with the money for you by avoiding it, as long as it was there for him to pick. Whereas your original choice has the same 1/3 chance it always did. QED.

Wait, this explanation doesn't make any sense to me. For one thing, the host has left 2 doors closed, not one. The door with the money could be either your door or the other door.

The trick is actually as follows. In your initial pick, you have a 2/3 chance of picking goats. The host then eliminates one door containing goats. So now, there is still a 2/3 chance your door contains goats, the host has done nothing to alter the probability in your initial pick. Now though, you only have to choose between your door and the other door. So, if you pick the other door, you will get the cash 2/3 of the time, because 2/3 of the time, your initial pick was wrong.
posted by !Jim at 10:53 PM on March 18, 2007


This comment also explained it well, and succinctly.
posted by !Jim at 10:57 PM on March 18, 2007


The Wikipedia one with the hundred doors or whatever explains it best for me, to summarize:

There are 100 doors. You pick one. Monty Hall opens 98 doors that are not your initial pick and not the money, leaving your initial pick and one other door. It's obvious you should switch, and it holds as you reduce the number of doors down to 3.
posted by TheOnlyCoolTim at 11:04 PM on March 18, 2007


It depends on whether the host intentionally avoided opening the door with the cash

No, it doesn't. All that matters is that a door without cash was opened.
posted by oaf at 12:31 AM on March 19, 2007


abcde is wrong. Well-meaning, but wrong. :) (The host has no choice about which door to open, according to the parameters of the rules.)

There are two ways to explain it, really:

1. Imagine there are 100 doors. You pick one. The host then opens 98 of the 99 remaining doors. Do you switch? (Of course you do!)

2. You pick one door. The chance of it containing the prize is 1/3. The chance of the prize being behind one of the other two doors is 2/3. When the host reveals one of the doors, that 2/3 probability "collapses" into the other door. So, you have a better chance if you switch.
posted by neckro23 at 12:44 AM on March 19, 2007


I've struggled to understand this one too. I like neckro23's explanation, but I just don't see why the 2/3 probability doesn't also "collapse" into the door I originally picked. Why is the door I originally picked all of the sudden any less liable to have $$ (or a stinky goat for that matter) than the other unrevealed door?
posted by iamkimiam at 12:59 AM on March 19, 2007


Nay, both oaf and neckro23 are wrong. I'm willing to risk being embarrassed by some crushing refutation, but really, the only way you guys aren't wrong is that I'm misreading you (not rare for me, so you're still on pretty good footing!) From the Wiki article: The solution would be different if the host did not know what was behind each door [...] In the problem as stated by Mueser and Granberg, it is because the host must reveal a goat and must make the offer to switch that the player has a 2/3 chance of winning by switching.
posted by abcde at 1:03 AM on March 19, 2007


Did some research and found this link from an earlier thread about the Monty Hall Problem on Metafilter. The link shows a simple matrix that displays all possible outcomes in each scenario.

This problem completely makes sense to me now. Sometimes an explanation can never rival a chart.
posted by iamkimiam at 1:20 AM on March 19, 2007


abcde, since you're insisting that you're right, would you explain to me what you said in your original comment, particularly the bit about the one door he leaves closed. I suspect we are thinking the same thing, but that our explanations aren't quite colliding. For some reason, this is really bugging me.
posted by !Jim at 1:30 AM on March 19, 2007


I had this problem for real recently... I think.

I bought an iMac and, when I got it out of the box, the screen looked slightly scratched. So I phoned Apple and they agreed to swap it.

Then I realized that the screen just needed a wipe to get some nasty marks off it, and that it was in fact fine. But Apple had already dispatched the replacement iMac.

So I ended-up with two iMacs, one of which was to be returned. I think what I should have done is gone with the NEW iMac. Given the opportunity of choosing between two new machines, and the odds of getting a faulty unit (common with Apple hardware), I should have taken the second one. Sure enough, as it turned out, the original one developed a handful of annoying faults.

But I'm not sure if this falls into the same category. We might even be tip-toeing into superstition here.
posted by humblepigeon at 1:54 AM on March 19, 2007


This is one of those things that are not human comprehensible. There is a serious disconnect with the way the human mind figures out things and reality on occasion, and the ol' monkey-meat is just not cut out for this. The math works, the computer simulations based on the math works... but it shouldn't, according to human intuition.

So, the short of it, it's magic. Honest-to-gosh, reality changing mojo you can perform just by cogitating the math. Things get eerier when you start to think of how these sorts of tricks and work-arounds apply to information theory and bayesian computation. Ontotechnology, here we come...
posted by Slap*Happy at 2:28 AM on March 19, 2007


This puzzle is also mentioned in the novel The Curious Incident of the Dog in the Night-time, which I enjoyed immensely. I believe the author used the chart approach to illustrate how it works. I was surprised by the solution too, BTW.
posted by alltomorrowsparties at 2:41 AM on March 19, 2007


This problem is hee-lariously simple if you are still so confounded yet concerned that you are reading down this far. Also similar to the previously linked succinct explanation.

If you don't plan on switching, then you have a 1/3 chance of getting the money (not bad at all). This has been said a large number of times.

If you do plan on switching, however, then the strategy would be to pick a door with a goat, as only choosing a goat would allow you to switch to the money after a door has been eliminated. The probability of choosing a goat initially is 2/3. Twice as likely as initially having chosen the money.
posted by GooseOnTheLoose at 3:55 AM on March 19, 2007


The Monty Hall problem is bad for you and unpleasantly contentious. Monty Hall is a nasty trickster.
posted by that girl at 5:11 AM on March 19, 2007


Algebra makes things easy for me, (I know I'm weird)

Let's call the probability that each door has the prize A, B and C, So added together

A + B + C = 1
when you pick the first door it has 1/3 a chance of being the right door. Say you pick A, so

A = 1/3

When monty reveals that B is empty you know that

B = 0

so simple math

1/3 + 0 + C = 1
C = 2/3

So you should pick C.
posted by afu at 5:54 AM on March 19, 2007


Actuallty yeah it is more complicated than that because Monty needs to know which door is which, ugh, don't post answers to math questions while high.
posted by afu at 5:58 AM on March 19, 2007


!Jim: I have homework to finish but I'll get back to you. I've managed to re-confuse myself in the few minutes I've re-thought it this morning; the reason I was so hubristic last night was that, when I checked to make sure I wasn't misremembering or full of it, multiple sources said things like this:
If Monty opened his door randomly, then indeed his action does not help the contestant, for whom it makes no difference to switch or to stick. But Monty's action is not random. He knows where the prize is, and acts on that knowledge. That injects a crucial piece of information into the situation. Information that the wise contestant can take advantage of to improve his or her odds of winning the grand prize. By opening his door, Monty is saying to the contestant "There are two doors you did not choose, and the probability that the prize is behind one of them is 2/3. I'll help you by using my knowledge of where the prize is to open one of those two doors to show you that it does not hide the prize. You can now take advantage of this additional information. Your choice of door A has a chance of 1 in 3 of being the winner. I have not changed that. But by eliminating door C, I have shown you that the probability that door B hides the prize is 2 in 3." (source)
But it's beginning to look like either these authors made my same mistake or they're all using the same ambiguous device to emphasize that the selection conveys information. I'm tempted to write a script to settle this by brute force, but the more I think about how such a script would look, the more I realize I might have been (gasp) wrong that the intention behind the opened door could possibly matter and these sources just happened to be wrong in the same way such that I didn't have a motive to check my thinking. Regardless, I will be as embarrassed as promised if I do turn out wrong.

Incidentally, if this is causing any trouble, let's not even touch the Sleeping Beauty Problem ;)
posted by abcde at 5:59 AM on March 19, 2007


There are two key issues here to make this problem work:

1. The host MUST offer a switch;
2. The host knows which door has the car.

In essence, by opening a door with a goat, he conveys information to you. Before he opened one of the unpicked doors, there was a 2/3 chance one of them had the car; after opening, there's now a 2/3 chance the single remaining door has the car. That's why switching doubles your chance of winning. You are taking advantage of the host having greater information than you do.

If either of these things aren't true, then you get no benefit from switching.
posted by Malor at 6:17 AM on March 19, 2007


I would sniff the doors and choose the one that doesn't smell like goat.
posted by ardgedee at 6:29 AM on March 19, 2007 [2 favorites]


It's interesting to imagine a different version of the game where you write your original choice on a piece of paper and stick it in a sealed envelope, and then the host reveals a goat. In this case it is obvious that the door opening provides no information about the relative merits of the two remaining doors. The benefit from switching results from the assumption (or fact in careful statements of the problem) that your choice influences Monty's behavior.
posted by teleskiving at 6:45 AM on March 19, 2007


Malor, I think you need to add:

3) The host never opens the door you picked
posted by teleskiving at 6:47 AM on March 19, 2007


You might be tempted to say that because we're only considering cases where the host didn't open our door that condition 3 is not necessary, but a consideration of the sealed-envelope version of the problem above shows why this is a mistake.
posted by teleskiving at 6:51 AM on March 19, 2007


afu, !jim and others have it. you can't assume ANYTHING AT ALL about what the host knows or why he opened a particular door. ALL you know is that you selected door A, then door B opened, one of the two that you didn't choose, and door B has a goat behind it. On that basis, with no other knowledge and therefore no other assumptions warranted, the chance that the goat is behind door C is 2/3. It might be easier to understand if the question was phrased differently, e.g. door B sprang open by mistake or you got an illicit sneak peek behind door B.

Once you assume some kind of intenionality on the part of the host, which many people do, the paradoxical solution above fails, so in that sense the problem as traditionally phrased is badly phrased.
posted by londongeezer at 6:54 AM on March 19, 2007


Although having written the above I still think the classic purported paradoxical solution is a load of crap.

Imagine the choosing process has reached the point where door B has swung open, a goat has been revealed, and you are being offered the chance of swapping from door A to door C. By the logic of the so-called solution, the chance that door C is the correct door is now 2/3, apparently.

Imagine now that standing next to you is a second contestant. Imagine that this contestant's initial choice was not door A but door C. By the logic of the so-called solution, the chance that door A is the correct door is now also 2/3.

So, imho, the problem and its purported solution are a load of crap.
posted by londongeezer at 7:05 AM on March 19, 2007


Nay, both oaf and neckro23 are wrong.

Sorry, but I'm not wrong. All that matters is that a door with a goat is opened every time. Whether the host knows is immaterial. If the door with the cash behind it is opened, it's not the Monty Hall problem.
posted by oaf at 7:19 AM on March 19, 2007


I already conceded I was quite possibly wrong after all, just backed by comparably ignorant authorities that I trusted credulously.

(back to bio homework, but I'm already issuing multiple mewls of defeat, you might notice :P)
posted by abcde at 7:24 AM on March 19, 2007


> I've struggled to understand this one too. I like neckro23's explanation, but I just don't see why the 2/3 probability doesn't also "collapse" into the door I originally picked. Why is the door I originally picked all of the sudden any less liable to have $$ (or a stinky goat for that matter) than the other unrevealed door?

Think of it this way:

You pick one door. The host then gives you the option of opening your chosen door, or of opening both of the remaining two doors. Which would you pick? (Of course the two doors, because that gives you 1/3 probability.)

By opening one of the doors, the host gives you the option of effectively opening two doors. You get the same probability as opening two of the doors, but the host is simply giving you an opportunity to get those same odds by sticking to only one door, as the rules state.

(It's early, so apologies if this doesn't make any sense.)
posted by neckro23 at 7:28 AM on March 19, 2007


You might be tempted to say that because we're only considering cases where the host didn't open our door that condition 3 is not necessary, but a consideration of the sealed-envelope version of the problem above shows why this is a mistake.

This is also not true.
posted by oaf at 7:31 AM on March 19, 2007


Wait, can someone please refute Londongeezer for me?
posted by poxuppit at 7:43 AM on March 19, 2007


OK.

Imagine now that standing next to you is a second contestant.

This is not the Monty Hall problem. Your criticisms do not apply to the Monty Hall problem, but to something you derived from it.
posted by oaf at 7:47 AM on March 19, 2007


abcde is right, and it's both unsurprising and disheartening to see everybody confusing themselves all over again, despite this having been worked out to death.

If the host knows where the money is and intentionally avoids that door, then it is a good idea to switch.

If the host does not know where the money is and only opens a door with a goat by luck, then it makes no difference if you switch or not.

There is a difference between these two scenarios, which would be reflected in code if you wrote a simulation for the two:

Here's the standard interpretation, where the host intentionally avoids the money:
repeat many times:
  — The prize is placed behind a random door.
  prizeDoor ← random(1...3)

  — Player picks first door.
  choice ← 1

  — Host opens a door.
  switch prizeDoor:
    case 1: openDoor ← random(2..3)
    case 2: openDoor ← 3
    case 3: openDoor ← 2

  — Player switches.
  if openDoor = 2: choice ← 3
  if openDoor = 3: choice ← 2

  — Did the player win?
  if choice = prizeDoor: wins ← wins + 1
Here's the algorithm if the host does not know which door has the money:
repeat many times:
  — The prize is placed behind a random door.
  prizeDoor ← random(1...3)

  — Player picks first door.
  choice ← 1

  — Host opens a door randomly.
  switch prizeDoor:
    case 1: openDoor ← random(2..3)
    case 2: openDoor ← random(2..3)
    case 3: openDoor ← random(2..3)

  — Oops! The host opened the winning door.
  if openDoor = prizeDoor:
    restart

  — Player switches.
  if openDoor = 2: choice ← 3
  if openDoor = 3: choice ← 2

  — Did the player win?
  if choice = prizeDoor: wins ← wins + 1
With the first simulation the player will win 2/3 of the time. With the second simulation he will win 1/2 of the time.
posted by Khalad at 8:10 AM on March 19, 2007


oaf: All that matters is that a door with a goat is opened every time. Whether the host knows is immaterial.

That is completely incorrect. If the host opens a door with a goat every time, then he knows where the money is. If he doesn't know where the money is then 1/3 of the time he is going to accidentally open the door with the money behind it. Oops!

abcde: I already conceded I was quite possibly wrong after all, just backed by comparably ignorant authorities that I trusted credulously.

You got it right. Stick to your guns!
posted by Khalad at 8:15 AM on March 19, 2007


Whew. Vindication! It's just that as I hacked out in Python in my mind it seemed like the set of cases where he picks it by accident are identical to those in which he does so identically. I would normally have either reasoned it out and came back around to my side or finished the code and found it out by Monte Carlo-ing Monty Hall, but !Jim was hankering for a response so I decided to reflect my momentary trepidation.
posted by abcde at 8:22 AM on March 19, 2007


Er, does so intentionally, that is.
posted by abcde at 8:22 AM on March 19, 2007


If anyone has any doubts remaining, do a simulation -- a housemate and I did it with the designated Monty Hall covering heads-up vs. tails-up pennies with index cards. Do it with both the always-switch and always-stay strategy, and record the results.

You'll quickly see it's exactly as Wikipedia and most people here have said. The always-switch strategy (assuming the scenario of the host knowing where the money is and avoiding it) will get you the money twice as often as the always-stay strategy (two times out of three vs. one time out of three.)

If you stay, you get the money only if your 1 chance in 3 original guess was right. If you switch, you get the money unless your 1 chance in 3 original guess was right, i.e., switching changes your chances to 2 in 3.

Again, if you don't believe everyone saying this, try it yourself.
posted by Zed_Lopez at 8:42 AM on March 19, 2007


Metafilter: the ol' monkey-meat is just not cut out for this.
posted by Rumple at 8:53 AM on March 19, 2007


That is completely incorrect.

You don't know what you're talking about.

There is absolutely zero chance of there being any door opened that has the prize behind it. It does not matter why this is so—because of the host's knowledge, some unseen stagehand's action, or divine intervention.

Any problem where there is a non-zero chance of the prize door being opened is not the Monty Hall problem, and it is not the problem this question is about.
posted by oaf at 9:09 AM on March 19, 2007


Because Monty will never open a door hiding the money, by switching you are getting the odds advantage of choosing two doors with the appearance of choosing only one.
posted by weapons-grade pandemonium at 9:44 AM on March 19, 2007


Khalad & ABCDE, in your weird game switching doesn't help because you have a 50-50 chance of winning even if you don't switch because half the time when you pick wrong the host "fouls" the game and restarts it.

That's not the Monty Hall problem though. Can we agree that'd be a pretty weird game show? "Well, oops, Bob, I guess you picked wrong but I shouldn't have exposed the prize just then so let's just start over after this commercial break."

OK a more likely game show would be: "You blew it!" In which case switching would still be neutral and 1/3rd of the time you'd lose without getting to decide whether or not to switch anyway.
posted by Wood at 9:57 AM on March 19, 2007


Incredibly, there does not appear to be a band called The Monty Hall Problem. This is now the greatest band name ever.
posted by jbickers at 10:08 AM on March 19, 2007


Incredibly, though people continually have this problem with the Monty Hall Problem, there does not appear to be an official Monty Hall Problem Problem.
posted by weapons-grade pandemonium at 10:29 AM on March 19, 2007


Khalad & ABCDE, in your weird game switching doesn't help because you have a 50-50 chance of winning even if you don't switch because half the time when you pick wrong the host "fouls" the game and restarts it.

That's not the Monty Hall problem though.


Well, I think we're in perfect agreement then. That's not the Monty Hall problem. But many people confuse it for the Monty Hall problem, which is what makes understanding this problem so difficult.

I just think it's very misleading to say that it doesn't matter whether or not the host knows where the money is, when what you mean is that maybe he knows, maybe a crew member is moving the money, maybe the hand of God is directing him—situations that, when you model the problem, are indistinguishable from one another.

One of the most common objections to the "always switch" solution is that if Monty is picking randomly then it doesn't matter if you switch or not. And that is correct analysis, and the proper answer to that objection is to point out that Monty is not picking randomly, but is intentionally avoiding the money door. So Monty either knows where the money is, or circumstances are conspiring to make it appear as if he does, which is really the same thing.
posted by Khalad at 10:59 AM on March 19, 2007


When you make your original pick, the door you pick (A) has a 1 in 3 chance of being good, because you know that there are three doors, and only one of them is good. Since there are only two bad doors, if you eliminate one of the bad doors (B), you're left with one bad door and one good door. With that choice, the remaining door (C) has a 1 in 2 chance of being good, because there are only two doors left. But nothing has changed about your original door - it still has a 1 in 3 chance of being good. So you should switch to the door that has a 1 in 2 chance of being good - door C.
posted by Caviar at 11:41 AM on March 19, 2007


Huh. Well I think the MHP is meant to show how some statistical assertions are counter-intuitive. One would think that the odds of any particular door containing a prize would be 1/3 before Monty opens an empty door, and 1/2 afterwards. But, this is simply not the case. One must consider the base rate throughout the whole exercise.

Before any doors are opened the odds of guessing the correct door is 1/3 or ~33%. Door A =~33% B=~33% C=~33%. Once a door is chosen and a door opened, say A is opened and C was chosen the base rate for any given door being correct remains the same ~33%, what has changed, however are the available options. Since C was picked when all three options were available its odd are and remain ~33%, but B becomes ~66%, or 2/3. Why? The ~33% of A and B "collapse" into one another. The base rate was 1/3 for all three options, but now there are only 2 options. The base rate being the same, one option must be 1/3 (C, since C was chosen at 1/3) and the other must be 2/3.

It doesn't matter who knows what when or anything. If it is the case that 3 doors are available and one contains a prize, when an empty door is opened and another choice is given, we have the Monty Hall Problem. Period.
posted by elwoodwiles at 12:22 PM on March 19, 2007


Owww. My head hurts.
posted by miss lynnster at 12:25 PM on March 19, 2007


With that choice, the remaining door (C) has a 1 in 2 chance of being good, because there are only two doors left.

That doesn't follow.

But nothing has changed about your original door - it still has a 1 in 3 chance of being good.

The way you state it it's unclear if anything has changed about the original door.

Let's forget about Monty Hall. How about Deal or No Deal? A very similar game, but with twenty doors (suitcases) instead of three.

So you're playing for the million, and the million alone. You have been going for nearly half an hour now, and have eliminated 18 of the suitcases. You're down to the last two suitcases: the one you picked initially, and the last of the original 19. You've got $1,000,000 on the board and also $500.

The tension rises. Howie hams it up. After a couple agonizing minutes, just as he's about to open the suitcase you chose, he pauses. "Would you like to switch?" he asks.

Knowing all about the Monty Hall problem, you smirk. "Yes, I'll switch."

Howie opens up your original suitcase. You lost! That's unbelievable! The chance of the million dollars being in your original suitcase at the start of the game were 1 in 20... how could you have lost?

The answer is that obviously you had a 50/50 shot of getting it right at the end of Deal or No Deal. Stay with your original choice, switch, it didn't matter. Even odds either way. But... wait, how come with Monty you're supposed to switch but with Howie it doesn't matter?

Here's why: Monty deliberately chose the door with no prize. He revealed information to you about the other two doors. However, you chose suitcases effectively at random, so when they were shown not to have the million dollars inside you learned nothing at all about the other suitcases. You only avoided the million dollars by sheer luck. So as you opened one suitcase after another, each time not finding the million dollars, the odds of the million dollars being in one of the other suitcases increased. By the end of the game each remaining suitcase had a 50% chance of being the winner.

Think about that. The distinction between informed and uninformed choice is paramount.
posted by Khalad at 12:28 PM on March 19, 2007


It doesn't matter who knows what when or anything. If it is the case that 3 doors are available and one contains a prize, when an empty door is opened and another choice is given, we have the Monty Hall Problem. Period.

Again, that is incorrect. Please stop saying this. It does matter. It does. It does.

If you disagree then I have to insist you run the two simulations I posted. I'll even rewrite them in C++ or Java so they can actually be compiled.
posted by Khalad at 12:33 PM on March 19, 2007


Here's a Java version of my pseudo-code above. Typical output is:
Runs when Monty knows where the prize is:
    Wins: 666421 (66.6%)
    Losses: 333579 (33.4%)

Runs when Monty has no idea where the prize is:
    Wins: 333649 (50.0%)
    Losses: 333406 (50.0%)
Notice that the only difference between the two functions is the switch statement—i.e., how Monty chooses which door to open.

import java.io.*;
import java.util.*;

public class Simulation {
    public static final int ITERATIONS = 1000000; 
    
    public static void main(String[] arguments) {
        montyHallKnowing  (ITERATIONS);
        montyHallUnknowing(ITERATIONS);
    }
    
    private static void montyHallKnowing(int iterations) {
        Random random = new Random();
        int    wins = 0, losses = 0;
        
        for (int i = 0; i < iterations; ++i) {
            // The prize is placed behind a random door.
            int prizeDoor = random.nextInt(3) + 1;
            
            // The player picks the first door.
            int playerChoice = 1;
            int openDoor     = 0;
            
            // The host opens a door.
            switch (prizeDoor) {
                case 1: openDoor = random.nextInt(2) + 2; break;
                case 2: openDoor = 3;                     break;
                case 3: openDoor = 2;                     break;
            }
            
            // Oops! The host opened the winning door.
            if (openDoor == prizeDoor) {
                continue;
            }
            
            // The player decides to switch.
            if (openDoor == 2) playerChoice = 3;
            if (openDoor == 3) playerChoice = 2;
            
            if (playerChoice == prizeDoor) wins   += 1;
            else                           losses += 1;
        }

        System.out.printf("Results when Monty knows where the prize is:%n");
        System.out.printf("    Wins:   %d (%.1f%%)%n", wins,   wins   / ((double) wins + losses) * 100);
        System.out.printf("    Losses: %d (%.1f%%)%n", losses, losses / ((double) wins + losses) * 100);
        System.out.printf("%n");
    }
    
    private static void montyHallUnknowing(int iterations) {
        Random random = new Random();
        int    wins = 0, losses = 0;
        
        for (int i = 0; i < iterations; ++i) {
            // The prize is placed behind a random door.
            int prizeDoor = random.nextInt(3) + 1;
            
            // The player picks the first door.
            int playerChoice = 1;
            int openDoor     = 0;
            
            // The host opens a door at random.
            switch (prizeDoor) {
                case 1: openDoor = random.nextInt(2) + 2; break;
                case 2: openDoor = random.nextInt(2) + 2; break;
                case 3: openDoor = random.nextInt(2) + 2; break;
            }
            
            // Oops! The host opened the winning door.
            if (openDoor == prizeDoor) {
                continue;
            }
            
            // The player decides to switch.
            if (openDoor == 2) playerChoice = 3;
            if (openDoor == 3) playerChoice = 2;
            
            if (playerChoice == prizeDoor) wins   += 1;
            else                           losses += 1;
        }
        
        System.out.printf("Results when Monty has no idea where the prize is:%n");
        System.out.printf("    Wins:   %d (%.1f%%)%n", wins,   wins   / ((double) wins + losses) * 100);
        System.out.printf("    Losses: %d (%.1f%%)%n", losses, losses / ((double) wins + losses) * 100);
        System.out.printf("%n");
    }
}

posted by Khalad at 1:11 PM on March 19, 2007


I think I see where we disagree. Khalad is arguing that in order to change the odds of the choices, the host must intentionally avoid the money, in terms of the game.

However the Monty Hall Problem is not the game, but a case that occurs in terms of the game. If one is playing the game and chooses a door, and if the first door is revealed to be empty, and if the host allows the player to change doors, we have a Monty Hall Problem where the original choice will be correct 1/3 of the time and the other option will be correct 2/3 of the time.
posted by elwoodwiles at 1:27 PM on March 19, 2007


If one is playing the game and chooses a door, and if the first door is revealed to be empty, and if the host allows the player to change doors, we have a Monty Hall Problem where the original choice will be correct 1/3 of the time and the other option will be correct 2/3 of the time.

Only if host knew the door to be empty.
posted by Khalad at 1:43 PM on March 19, 2007


I think Khalad has done a great job here, but the whole discussion once again brings out a possible "flaw" in the Monty Hall problem, that understanding it depends strongly on explaining very clearly the nature of the host/game. This is no problem theoretically, but pedogogically, I've always found it hard to convey the correct thought process to friends for that very reason.

It reminds me of something Martin Gardner once wrote with relevance to this kind of problem. Suppose you're locked in a prison with 100 people (total), and you know someone is going to be executed tomorrow. Then you "find" a list that you completely believe which says, "These 98 people aren't going to be executed tomorrow" at the top, followed by 98 names. You're not on that list. You should likely be very scared at this point.

But let's say you're right-handed, and you found the same list, except it says, "These 98 left-handed people aren't going to be executed tomorrow," and you're still not on the list. In a logical sense, you should be no more scared because of your lack of presence on the list, as the "left-handed" modifier makes it so that it would be impossible that you'd be on the list in the first place; in other words, it contributes no new information to you. (On some emotional level, of course, I'm sure it would be a bit shaking.) The point is, how the list is generated makes all the difference in the world, just as how Monty Hall picks the door to open does.

(I'm sure some Bayesian can waltz in here and poke a hole in that reasoning due to assumptions about right and left-handedness, but I think that misses the point of the thought experiment. I admit it's not a great example, except that I think it highlights this whole issue of the importance of the how.)
posted by sappidus at 1:57 PM on March 19, 2007


If you disagree then I have to insist you run the two simulations I posted. [...] Only if host knew the door to be empty.

The second simulation isn't the Monty Hall problem. In the Monty Hall problem, Monty does not open either the player door or the prize door. It's a stated part of the question. elwoodwiles is correct -- knowledge has nothing to do with the problem. If you've chosen one door and one of the others is shown to be empty, the odds that the prize is behind the third door are 2/3. Rewrite your second scenario to only count results when Monty randomly opens neither the player door nor the prize door, and you'll see that eliminating his knowledge doesn't change the outcome in cases where the problem occurs as stated.

Your second simulation proves the general case (given 1,000,000 iterations, one prize, and three doors, the player will choose the correct door about 333333 times), but the Monty Hall problem is emphatically NOT about the general case. It's about a very specific set of circumstances, circumstances that are not dependent on the host's knowledge.
posted by vorfeed at 3:41 PM on March 19, 2007


vorfeed: I'm confused as to why you think Khalad is missimulating the "Monty Hall don't know jack" situation. You say,

Rewrite your second scenario to only count results when Monty randomly opens neither the player door nor the prize door, and you'll see that eliminating his knowledge doesn't change the outcome in cases where the problem occurs as stated.

If you read his code, that is what it does. Specifically, it is designed such that the situations when unknowing Monty picks the player door are thrown out (actually, by never generating the situation in the first place). As for the situations when unknowing Monty picks the prize door, that is dealt with in the lines
// Oops! The host opened the winning door.
if (openDoor == prizeDoor) {
    continue;
}
That is, it throws out all such situations as well. (This is why the sample simulation numbers Khalad gave for unknowing Monty, 333649 and 333406, do not add up to 1000000.)

This leaves only situations where unknown Monty has randomly opened neither the player door nor the prize door, which seems to be what you're asking for.
posted by sappidus at 4:36 PM on March 19, 2007


Only if host knew the door to be empty.

That's not true. The actual problem is: the host opens a door with a goat. He can only consistently do that if he knows, but he doesn't have to know. If he gets it wrong and opens the prize door, I guess the game is aborted and it starts over.

If you choose a door, and Monty reveals another door with a goat, you will win 2/3 of the time by switching. Period. By switching, you get to open two doors.

This problem only works 100% of the time if Monty knows where the prize is: if he doesn't, 1 run in every 3 is aborted and fails. But in cases where he reveals a goat, whether he knew a goat was there or not, you will win 2/3 of the time by switching. Why? Because you are choosing two doors.
posted by Malor at 4:49 PM on March 19, 2007


Khaled is right and vorfeed is wrong. Whether it's better for you to switch or not does depend on whether Monty knew there would be a goat behind the door he opened.

If Monty doesn't know in advance that his door will have a goat, then the probability space underlying the game scenario (loosely speaking, the set of all equally likely outcomes) must be enlarged to include those cases where Monty opens his door and reveals the prize. The fact that the particular case under consideration is not one of those cases does not remove them from the probability space.

I'm going to make the reasonable assumption that in those cases where Monty does pick the door with the prize, then you don't get offered a chance to switch. It doesn't matter whether the game rules say you win, lose or restart the game at that point; all we're trying to figure out here is whether switching is the right thing to do, given the opportunity.

The set of equally likely outcomes in this (non-canonical-Monty-Hall-Problem) game is:

prize door, your door, Monty's door, switch=win
1, 1, 2, no
1, 1, 3, no
1, 2, 1, n/a
1, 2, 3, yes
1, 3, 1, n/a
1, 3, 2, yes
2, 1, 2, n/a
2, 1, 3, yes
2, 2, 1, no
2, 2, 3, no
2, 3, 1, yes
2, 3, 2, n/a
3, 1, 2, yes
3, 1, 3, n/a
3, 2, 1, yes
3, 2, 3, n/a
3, 3, 1, no
3, 3, 2, no

There are twelve cases where you get offered a chance to switch, and in half of those, switching wins. This is the result that the monkey mind generates intuitively. Typically we don't even think about the n/a outcomes.

But if Monty does know in advance where the goats are, then his choice of door isn't random, and the set of equally likely outcomes doesn't include his choices at all (because he's never making an outcome-affecting choice). It looks like this:

prize door, your door, switch=win
1, 1, no
1, 2, yes
1, 3, yes
2, 1, yes
2, 2, no
2, 3, yes
3, 1, yes
3, 2, yes
3, 3, no

And in this, the standard Monty Hall Problem scenario, you are in fact twice as likely to win by switching as by not switching.
posted by flabdablet at 4:56 PM on March 19, 2007


Khaled is right and vorfeed is wrong. Whether it's better for you to switch or not does depend on whether Monty knew there would be a goat behind the door he opened.

Yeah, you're right. Bah, it is counter-intuitive.
posted by vorfeed at 6:17 PM on March 19, 2007


flabdablet, you're missing something here. If you take the first door you choose and stay with it, you have a 1/3 chance of winning.

If Monty doesn't know where the prize is, and if opening the prize door ends the game(which is NOT stated as part of the puzzle, by the way), you STILL have a better chance if you switch when you can. If you lose when Monty opens the prize door, and you always switch if you're still able to, overall you win 1/2 of the time.

If Monty knows and always shows a goat, you win 2/3 of the time.

In either case, switching improves your odds. They just improve more if Monty knows.
posted by Malor at 6:18 PM on March 19, 2007


Sorry, Malor, but that's not right.

In the 2/3 of Ignorant Monty games where you get the opportunity to switch, you do indeed have a 1/2 chance of winning by switching. But that does not represent an improvement to your original 1/3 winning chance; that 1/3 chance was not conditional on your ending up in one of the Ignorant Monty Gets The Goat games.

Your a-priori chance of winning Ignorant Monty via switching is 2/3 (chance of getting an opportunity to switch) times 1/2 (chance of winning via switch) = 1/3, same as your a-priori chance of winning with no switch (which applies whether the failure to switch is down to choice or lack of opportunity).

In the Ignorant Monty scenario, there is no advantage to switching, and your a-priori probability of a win depends solely on how the rules deal with Monty opening the winning door.
posted by flabdablet at 6:50 PM on March 19, 2007


Malor, the probabilities of winning have to sum up to 1. If you have a 1/3 chance of winning by staying, then you have a 2/3 chance of winning by switching. If switching gives you a 1/2 chance of winning, then so does staying. You can't have a 1/3 chance of winning by staying and a 1/2 chance by switching. That's not mathematically consistent; what happens the remaining 1/6 of the time, when you neither win nor lose?

flabdablet, you're missing something here.

Well, if you think so, you need to tell us exactly what that is. You can't just wave away probability tables by saying you disagree.
posted by Khalad at 7:07 PM on March 19, 2007


To clarify: If the rules say that Ignorant Monty opening the winning door is your instant loss, then your a-priori chance of winning is 1/3.

If the rules say that Ignorant Monty opening the winning door makes the game restart, then your a-priori chance of winning is 1/2, and it is not predictable how long it will take the game to end.

If the rules say that Ignorant Monty opening the winning door is your instant win, then your a-priori chance of winning is 2/3.
posted by flabdablet at 7:07 PM on March 19, 2007


And Khalad, I'm sorry I misspelt your handle.
posted by flabdablet at 7:08 PM on March 19, 2007


Khalad's montyHallUnknowing() function models the second set of rules, by the way.
posted by flabdablet at 7:12 PM on March 19, 2007


If you take wins and losses to count the number of times you win or lose after having chosen to switch, then actually models all three sets of rules. The second program shows that if Ignorant Monty does not open the winning door, thereby giving you a choice to switch, it does not matter if you switch or stay. If he opens the winning door then there's no choice for you to make; the outcome is out of your hands.
posted by Khalad at 7:18 PM on March 19, 2007


I forgot that I posted in the previous Metafilter thread about the Monty Hall problem. I guess we got hung up on the same point there, too, arguing about the importance of information. It's all about earthquakes.

(I'm surprised Ethereal Bligh hasn't shown up yet!)
posted by Khalad at 7:34 PM on March 19, 2007


Reason I claimed it models the second set of rules is that in the real world, if you enter a prize-winning game and don't win a prize, that's a loss; however, montyHallUnknowing() doesn't count it as such - it just restarts the game as soon as Monty opens a prize door.

You could make it simulate the first or third rules by bumping losses or wins before the continue.
posted by flabdablet at 7:54 PM on March 19, 2007


I think the fundamental problem we have in this thread is that people are refuting the solution to the monty hall problem by changing the problem. This is no good.

Teacher: What is 5 + 3?
Student 1: It's 8
Student 2: NO! If you change the 3 to a 5, it's 10, so 5 + 3 is not 8!

See? That's no way to discuss things.
posted by !Jim at 8:03 PM on March 19, 2007


Nobody's refuting the solution to the Monty Hall problem. Everybody here is in heated agreement that, in the context of the canonical Monty Hall problem, switching doubles your chances of winning. I don't think that's controversial.

What has been controversial here is whether the Ignorant Monty Hall scenario has the same properties as the standard scenario, which is an interesting question in its own right.

abcde wrote "It depends on whether the host intentionally avoided opening the door with the cash, something sometimes left ambiguous in the problem..." (my emphasis)

In fact it wasn't left at all ambiguous in this particular statement of the problem, but that doesn't mean the issue is not worth carefully thinking through. Doing so goes a long way toward understanding why the MHP is so horribly counterintuitive.
posted by flabdablet at 4:28 AM on March 20, 2007


!Jim, one of the first comments in the thread was:

"It depends on whether the host intentionally avoided opening the door with the cash"

No, it doesn't. All that matters is that a door without cash was opened.


That's the misconception I've been trying to rectify this whole time. Furthermore, there's this question:

I've struggled to understand this one too. I like neckro23's explanation, but I just don't see why the 2/3 probability doesn't also "collapse" into the door I originally picked. Why is the door I originally picked all of the sudden any less liable to have $$ (or a stinky goat for that matter) than the other unrevealed door?

You see, depending on Monty's knowledge, the 2/3 probability may or may not "collapse" into the original door. There have been numerous people claiming it doesn't matter why he reveals the goat, it just matters that he did.

If you say my second program doesn't correctly represent the Monty Hall problem, then I agree! That's my whole point! It doesn't represent the Monty Hall problem, and the reason is that when Monty Hall doesn't know where the prize is, the whole situation changes.
posted by Khalad at 5:16 AM on March 20, 2007


Okay, for the record, the 66% success by switching makes sense to me. (And if Ignorant Monty picks the money door, you'd switch to that, duh -- if the switch is not allowed, and the game is restarted, *that's* where the rules have changed.)

Here's what messes with my head: Suppose that, just before you make your pick, Trustworthy Monty leans over and whispers, "Psst..., buddy! Door #3 has a goat." Door #3 is, effectively, taken out of play, because Trustworthy Monty never lies.

Obviously, your choices are then between Door #1 and Door #2 -- a 50/50 chance. Let's say you pick Door #1.

Monty then announces to the crowd, "Let's see what's behind Door #3!" And, sure enough, it's a goat. But you knew that all along; this is not new information.

You can change your pick to Door #2, but you'll still only have a 50% chance of success.

Soooo... you drop your chance of success from 66% to 50% by having the Goat Door information ahead of time, *before* making your first pick.

Huh? Really??

Something here does not add up. I can't imagine you'd gain an advantage by shushing Trustworthy Monty as he tried to give you an initial hint...
posted by LordSludge at 11:43 AM on March 20, 2007


If he whispered to you before you picked a door, then that changes the probability of your initial choice being correct. It's now 50/50. He's effectively removed the third door from play entirely, so there are only two doors.

And shushing him wouldn't be exactly the same as the normal MH problem either. Let's say told you door #3 has a goat, but you shushed him so you didn't hear. Then you randomly pick door #3 for your initial guess. He then opens door #3 to the crowd, showing a goat... but in the normal MH setup he only opens one of the other two doors.

Conclusion: whether or not you hear his hint, the fact that his hint is not dependent upon your choice means your odds are 50/50 no matter what. His telling you where a goat is before you make your choice unavoidably changes your probabilities, even if you don't hear him.
posted by Khalad at 12:46 PM on March 20, 2007


Let's say told you door #3 has a goat, but you shushed him so you didn't hear. Then you randomly pick door #3 for your initial guess. He then opens door #3 to the crowd, showing a goat... but in the normal MH setup he only opens one of the other two doors.

No, no -- we're not mandating that Honest Monty* always open the initial-hint-goat-door (Door #3, in my example). If you happened to pick Door #3, he would then open one of the other doors -- the other one with the goat. You're back to the original MH problem, and switching doors would give you a 66% chance. (Actually, it's 100%, but you don't know that because you didn't hear him; you just picked Door #3 out of dumb luck.)

Oh shit...! That's the (counter-intuitive) sure-win strategy if you get the pre-pick hint: From my example, if Honest Monty tells you Door #3 has a goat, go ahead and choose Door #3. He'll look at you funny, and the crowd will heckle you, but then Monty will realize that he has to reveal the other Goat Door before offering you a chance to switch. The only remaining door is the money door.

Cool.

* rolls off the mind-tongue so much better than "Trustworthy Monty"
posted by LordSludge at 1:26 PM on March 20, 2007


« Older What's the motherfucking source of these...   |   Bye Zire, hello Nano? Newer »
This thread is closed to new comments.