in reply to Re^5: Marilyn Vos Savant's Monty Hall problem
in thread Marilyn Vos Savant's Monty Hall problem

I'm not sure of the relevance of this. Stats was never my strong suit but...

If the following simulation bears any resemblance to reality (of the re-stated version of the problem), then you only get a greater chance of winning if you always switch your choice after the host opens the first door on the goat.

If at that time you make another choice--either, whether to switch or not, or a random choice between the two remaining doors (which amounts to the same thing?)--then your odds of success remain at 33.33%.

#! perl -slw use strict; use List::Util qw[ shuffle ]; our $TRIALS ||= 1_000_000; my $DIVISOR = $TRIALS / 100; my( $stick, $switch, $newChoice ); for my $try ( 1 .. $TRIALS ) { ## Randomly hide the prizes behind the doors. my @doors = shuffle 'car', 'goat', 'goat'; ## Pick a door my $choice = int rand 3; ## The host opens a door that I didn't pick ## and that isn't the car my $opened = grep{ $_ != $choice and $doors[ $_ ] ne 'car' } 0 .. +2; ## Count my wins if I stick or switch $doors[ $choice ] eq 'car' ? $stick++ : $switch++; ## Make a new choice from the remaining two my $new = ( grep{ $_ != $opened } 0 .. 2 ) [ rand 2 ]; ## And if I make a completely new random choice. $doors[ $new ] eq 'car' and $newChoice++; } printf "Odds of Choose again: %.3f Win if you don't switch: %.3f Win if you do switch: %.3f\n", $newChoice / $DIVISOR, $stick / $DIVISOR, $switch / $DIVISOR; __END__ P:\test>test Odds of Choose again: 33.331 Win if you don't switch: 33.286 Win if you do switch: 66.714 P:\test>test Odds of Choose again: 33.370 Win if you don't switch: 33.353 Win if you do switch: 66.647

Assuming that this simulation isn't at fault, I'd love to see a (preferably layman's terms) explaination for why a predetermined strategy (always switch) would have such an effect on the odds of success?


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^7: Marilyn Vos Savant's Monty Hall problem
by Solo (Deacon) on Aug 23, 2004 at 21:34 UTC
    Maybe it's easier to think about like this: if you always switch, you only lose if you picked the door with the car first. That's a 1 in 3 chance to lose. (And a 1 in 3 chance to win if you never switch).

    --Solo

    --
    You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
Re^7: Marilyn Vos Savant's Monty Hall problem
by TrekNoid (Pilgrim) on Aug 23, 2004 at 21:19 UTC
    Assuming that this simulation isn't at fault, I'd love to see a (preferably layman's terms) explaination for why a predetermined strategy (always switch) would have such an effect on the odds of success?

    Suppose there were 100 doors... and I allowed you to choose one of them, what's the odds you picked the right door? 1%

    What's the odds that the prize is behind one of the other 99? 99%

    So, if I gave you a choice of switching your choice from Door 1, and allowing you to pick all 99 of the other doors, which would you take? Obviously, the 99.

    The torture is that I first open 98 of the goat doors (because I know where the prize is), leaving two... The one you picked, and the one remaining. None of that changes the fact that you're initial guess was only 1% chance of guessing right.

    Therefore, switching from your initial choice at the last minute is effectively the same as changing to all 99 doors.

    Occassionally this strategy would fail, but only about 1% of the time, since that was the likelihood you chose correctly to begin with.

    Same is true with three doors. Your chance of picking correctly initially is 1/3rd... If you were allowed to switch to the other two doors, you'd have a 2/3rds chance of winning.

    At least, that's how it was initially explained to me, and it seems pretty reasonable.

    Trek

Re^7: Marilyn Vos Savant's Monty Hall problem
by tilly (Archbishop) on Aug 23, 2004 at 22:22 UTC
    Your simulation is bad. $opened is always 1 or 2, depending on whether you picked a car. In fact $opened is (1/3 odds) the same as the door you pick. After that it is coincidence that you did a calculation that came out to the right answer.

    Here is code that lets you try different scenarios and see how Monty's behaviour and knowledge affect the outcome. You can uncomment the scenario that you want to see that behaviour.

    #! perl -slw use strict; use List::Util qw[ shuffle ]; my( $stick, $switch, $skip_goat, $skip_car ) = (0, 0, 0, 0); for ( 1 .. 100_000 ) { ## Randomly hide the prizes behind the doors. my @doors = shuffle 'car', 'goat', 'goat'; ## Pick a door my $choice = int rand 3; #### ## Uncomment the option you want here to see different scenarios. ### ## Option 1: The host opens a door that I didn't pick ## and that isn't the car #my @available = grep{ $_ != $choice and $doors[ $_ ] ne 'car' } 0 + .. 2; ## Option 2: The host opens a random door #my @available = grep{ $_ != $choice } 0 .. 2; ## Option 3: The host tries to be malicious #my @available = grep{ $_ != $choice and $doors[ $_ ] eq 'car' } 0 + .. 2; #@available = grep{ $_ != $choice } 0..2 if not @available; #### ## End of options #### # Monty chooses which door to open from the choices # that he might make. my $opened = $available[rand(@available)]; if ($doors[$opened] eq 'car') { $doors[ $choice ] eq 'car' ? $skip_car++ : $skip_goat++; next; } ## Count my wins if I stick or switch $doors[ $choice ] eq 'car' ? $stick++ : $switch++; } printf "Odds of Not getting here if you were originally right: %.3f Not getting here if you were originally wrong: %.3f Win if you don't switch: %.3f Win if you do switch: %.3f\n", $skip_car / (( $stick + $switch + $skip_goat + $skip_car) / 100 ), $skip_goat / (( $stick + $switch + $skip_goat + $skip_car) / 100 ) +, $stick / (( $stick + $switch) / 100 ), $switch / (( $stick + $switch) / 100 )
    Now that said, let me explain why the odds are what they are for each option.

    In Option 1, you pick a door and have 1/3 odds of being right. There are 100% odds that you'll see a goat, so the fact that you saw one tells you nothing. Therefore your odds of being right remain 1/3. Since switching makes you right if you were wrong, your odds if you switch are 2/3 - so you want to switch.

    In Option 2, you pick a door and have 1/3 initial odds of being right. However if you were right, then you're guaranteed to see a goat next, while if you're wrong, you have only even odds of seeing a goat next. Therefore the knowledge that you actually saw a goat conveys information - if you do the math just enough information to tell you that you now have even odds of being right.

    In Option 3, you again pick a door and have 1/3 initial odds of being right. However the fact that you saw a goat gives you considerable information - it literally tells you that you must be right. Since you're right, you don't want to switch.

      Although your three scenarios may be pedantically valid, only the first one makes any real sense.

      If there are goats behind two of the doors, then Monty opening the door with the car behind it would make for a really stupid game show. He might as well just open the door you chose since both actions tell you that you picked a goat door.

      I suppose you could argue that the problem as stated doesn't make it absolutely clear that you *know* that there are two goat doors (or that there are *always* two goat doors).

      But as stated, the only reasonable interpretation is the first one (that makes sense for a game show, that fits common sense, not that fits a mathematician's standard for precision).

      As for the real Monty saying that he sometimes opened the "car" door, this is true. And that didn't make the real game show really stupid (yes, I'm sure many regarded the show as plenty stupid, but I'm talking stupid beyond sense, not just a matter of taste) because the real show always (or almost always, I haven't personally reviewed every single episode) had one "goat" door (a joke "prize", and no, it wasn't always a goat), one "car" door (a major prize), and one "appliance" door (a minor prize).

      That makes for a more complex statistics problem (as it should, being a real game show). But it has little more to do with the problem as stated other than being the likely inspiration for it and, later, the inspiration for its retitling as well.

      Also note that Monty had other options besides opening one of the doors. He could have a prize wheeled out and offer you that in exchange for the door. He often pulled cash out of his pocket and offered you that (perhaps in addition to the prize he just wheeled out). It wouldn't have made much sense to call the show "Let's make a deal" without such negotiations. (:

      - tye        

        I didn't model it that way, but who is to say (given the problem statement) that Monty wouldn't choose to open your door first if you didn't choose the car? In that case the analysis comes out to what I showed.

        Indeed in the slight variation of this game known as the shell game, it is indeed traditional to show people right off the bat that they got it wrong. (It is also traditional to remove/re-add the pea by sleight of hand so that the chump playing always loses..but let's ignore that fact.) Indeed that precedent suggests that there might indeed be room for a game show where the host tries to make life hard for the players. Indeed the existence of reality shows suggests that the traditional game show format is not the only possible one with an audience.

        Furthermore even if you do (based on cultural knowledge) find only one possible assumption natural, it is still good to analyze the problem clearly enough to know that that is an assumption. Because while implicit assumptions often are right, every so often you'll run across a problem that you can only get straight by being able to find and correct a wrong assumption that you made. (In my experience, "every so often" comes by pretty frequently...)

      The code for option 3 is quite confusing. It took me a while to figure out exactly what it was doing.

      my @available = grep { $door[ $choice ] eq 'car' ? ( $_ != $choice ) : ( $doors[ $_ ] eq +'car' ) } 0 .. 2;

      Hmm.. I guess that's not much clearer either.

      Update: so I rewrote the code, and I think this is clearer:

      for ( 1 .. 100_000 ) { my @door = 0 .. 2; my $car_door = int rand @door; my $my_pick = int rand @door; @door = grep { $_ != $my_pick } @door; ## Option 1: The host reveals a goat #my @available = grep { $_ != $car_door } @door; # Option 2: The host opens a random unopened door #my @available = @door; ## Option 3: The host tries to be malicious #my @available = @door; #@available = grep { $_ == $car_door } @door if $my_pick != $car_d +oor; my $opened = $available[ rand @available ]; if( $opened == $car_door ) { $my_pick == $car_door ? $skip_car++ : $skip_goat++; next; } ## Count my wins if I stick or switch $my_pick == $car_door ? $stick++ : $switch++; }

      Makeshifts last the longest.

        I don't think that there is a good short way to state it.

        Perhaps the best way is to be verbose as in:

        my @available; if ( $door[ $choice ] eq 'car' ) { # Can't beat him yet @available = grep { $choice != $_ } 0 .. 2; } else { # Make him lose! @available = grep { $doors[ $_ ] eq 'car' } 0 .. 2; }

      Your simulation is bad. -- Nice catch.

      Since switching makes you right if you were wrong, your odds if you switch are 2/3 - so you want to switch. -- That's the explaination that will stick. Thanks.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon