Before reading this node, be sure you have read Monty Hall Problem first...

Yes! It improves your chances of getting the car if you switch! In fact, it doubles your chances. Why?

In conceptual terms:

There are three possible arrangements of the prizes:

Case 1: Door1: Goat, Door2: Goat, Door3: Car

Case 2: Door1: Goat, Door2: Car, Door3: Goat

Case 3: Door1: Car, Door2: Goat, Door3: Goat

Say you pick door 1. There is a 1/3 chance that you picked the door hiding the car. Since Monty knows which door the car is behind, he opens a door with a goat.
In cases one and two, when you did not guess the car, he opens the second and third door, respectively.
Only in case three would it be advantageous to not switch.

So, 2/3 of the time, you will win the car if you switch, where only 1/3 of the time, you will win the car if you don't switch, because one of the choices has been removed from the picture.

If you still don't buy it, imagine that there are 10,000 doors. 9,999 of the doors hide goats, and one of the doors hide a new car.
Say you pick door #1. Monty then proceeds to open every door except door #4,654, revealing goats behind each one. Should you switch to door #4,654?
Since your first guess had only a 1/10,000 chance of picking the car, isn't is much more likely that the one door Monty didn't show you contains the car than your 1 in 10,000 guess?

Mathematical Solution

The probability that the prize is behind door X, P(X) = 1/3

The probability that Monty opens door B if the prize were behind A,
P(Monty opens B|A) = 1/2

The probability that Monty opens door B if the prize were behind B,
P(Monty opens B|B) = 0

The probability that Monty Hall opens door B if the prize were behind C,
P(Monty opens B|C) = 1

The probability that Monty opens door B is then
p(Monty opens B) = p(A)*p(M.o. B|A) + p(B)*p(M.o. B|B) + p(C)*p(M.o. B|C)
                 = 1/6 + 0 + 1/3 = 1/2

Then, by Bayes' Theorem,

P(A|Monty opens B) =  p(A)*p(Monty opens B|A)/p(Monty opens B)
                   = (1/6)/(1/2)
                   = 1/3
P(C|Monty opens B) = p(C)*p(Monty opens B|C)/p(Monty opens B)
                   = (1/3)/(1/2)
                   = 2/3

Thus, your odds increase to 2/3 when you switch doors.


A cool side-note to this problem exploits a loophole in the problem. Check out the Problem with the Monty Hall Problem.
The original noding is correct in the terms of the problem.
If I have a one in three chance of picking the car then one time in three if I open the original door I get the car (Regardless of what is done to other doors). If I opened both the doors that I did not pick then I have a two in three chance of finding the car. Therefore if one of the doors I did not choose is opened (and definitely did not have a car behind it) then there is a two thirds chance that the car is behind the other (there is still a two in three chance that opening both doors will reveal the car). It is not a new probablility unless the information about which door I chose originally is removed (and I have to chose again from the pair of remaining doors) otherwise the original probablilities stand.

This is easier to see from the point of view of different possibilities. I shall just consider the cases for having selected door 1 because although there are three times as many options they do not change the proportion of wins/losses just the absolute counts.

There are three possible situations corresponding to the car being behind door 1, door 2, and door 3. Each of these is equally likely with a probablility of 1/3

[A]      >CAR<    goat    goat
       --Door1---Door2---Door3--   1/3

[B]       goat   >CAR<    goat
       --Door1---Door2---Door3--   1/3

[C]       goat    goat   >CAR<
       --Door1---Door2---Door3--   1/3
If Monty Hall then opens one of the doors that I didn't select (but which has a goat behind it) then in cases [B] and [C] he only has one door to open. However in case [A] he could open either door 2 or door 3 so there are two possiblities ([A1] and [A2]). However the probability of each of these is only 1/6 as each has half the chance of the original possiblity [A] of occurring (because they share that 1/3 evenly between them).
[A1]     >CAR<    goat    goat
       --Door1---     ---Door3--   1/6   LOSE on Switch

[A2]     >CAR<    goat    goat
       --Door1---Door2---     --   1/6   LOSE on Switch

[B]       goat   >CAR<   goat
       --Door1---Door2---     --   1/3   WIN on Switch

[C]       goat    goat   >CAR<
       --Door1---     ---Door3--   1/3   WIN on Switch
If I switch then in cases [A1] and [A2] I lose and in cases [B] and [C] I win. But despite the fact that there are two possiblities in each case their probabilities are different.
  • The Switch and Lose probablility is 1/6 + 1/6 = 1/3.
  • The Switch and Win probability is 1/3 + 1/3 = 2/3.
  • So you are twice as likely to win if you switch.
The confusion normally arises because you can either count all four possibilities as having the same probablility or forget that cases [B] and [C] are different (and so think there are only two possiblities). In either of the cases the probabilities would come out as 1/2 for each case and no advantage.

Obviously in the full case (of choosing any door) the probabilities are 1/18 and 1/9 but they still sum up to give the same 1/3 and 2/3.

I have created a Visual Basic program to simulate the Monty Hall situtation and to show the effects of switching or not switching. The results shown below are for a one million cycle simulation (using VB6 doesn't make them automatically suspect - honest).
              Win     Lose      TOTALS
  Switch  | 332779 | 166772 |   499551
 NoSwitch | 166970 | 333479 |   500449

  TOTALS    499749   500251    1000000
As can be seen the results show a roughly 2:1 predominance for winning when switching guesses. The totals are to show that the program did randomly switch about half the time. The logic of the simulation is shown below and below that the core simulation routine.
Pseudo Logic of Simulation
  1. [Door] := Random(1, 2, 3)
  2. [Guess] := Random(1, 2, 3)
  3. Generate [Other] Door Choice
    • Does [Door] = [Guess] ?
      • YES: [Other] := random choice between non-[Door] values
      • NO: [Other] := [Door] (as the door without the car behind is eliminated)
  4. [Choice] := Random(Switch, NoSwitch)
  5. Change the [Guess] if decided to switch
    • Is [Choice] = Switch ?
      • YES: [Guess] := [Other]
      • NO: [Guess] remains unchanged
  6. Determine whether the car was won
    • Is [Guess] = [Door] ?
      • YES: [Result] := Win
      • NO: [Result] := Lose

Then use the values of Choice and Result to increment the count in one of the cells of the results matrix

The variables in the pseudo logic and their values ranges are:

  • Door (1, 2, 3) - The number of the door which the car is behind
  • Guess (1, 2, 3) - The program's current guess as to where the car is
  • Other (1, 2, 3) - The door we could switch to (the number that is not Guess and not Other is the one that Monty opened)
  • Choice (Switch, NoSwitch) - Whether the choice was switched or not
  • Result (Win, Lose) - Whether the car was won or not
In the Pseudo logic variable names are in square brackets and := means assign the value on the right to the variable named on the left.
The source code of the core Simulation Routine
' Perform a single increment of the Monty Hall Problem
'   The value in the relevant cell of the 2 x 2 array
' lResCount(Result, Choice) is incremented
' are used to select the correct cell
'   A false return indicates a problem occurred
Public Function DoMontyHallCycle(lResCount() As Long) As Boolean
' Enable error handling
    On Error GoTo ERR_DoMontyHallCycle
    Dim bResVal As Boolean
    Dim lDoor As Long       ' The door behind which the car is
    Dim lGuess As Long      ' The programs guess where the car is
    Dim lOther As Long      ' The other door offered after elimination
    Dim bChoice As Boolean  ' Whether the program switched choice (True = Switch)
    Dim bResult As Boolean  ' Whether the program found the car (True = Win)
' Initialise the return value
    bResVal = True
' Put the car behind a door
    lDoor = GenRand3
' Guess where the car is
    lGuess = GenRand3
' Get the other door to offer
    If (lDoor = lGuess) Then
' Have guessed correctly so randomly choose a door other than Guess
        lOther = 1 + ((GenRand2 + lGuess - 1) Mod 3)
' Have not guessed correctly so the other choice will be the correct door
        lOther = lDoor
    End If
' Decide whether to switch
    bChoice = (GenRand2 = 1)
' Change the Guess if necessary
    If bChoice Then lGuess = lOther
' Did we get the car
    bResult = (lDoor = lGuess)
' Update count in the relevant cell of the results matrix
    If bResult Then
        If bChoice Then
' Switched Choice and found the car
            lResCount(GOT_CAR, DID_SWITCH) = lResCount(GOT_CAR, DID_SWITCH) + 1
' Did not switch Choice and found car
            lResCount(GOT_CAR, NO_SWITCH) = lResCount(GOT_CAR, NO_SWITCH) + 1
        End If
        If bChoice Then
' Switched choice and did not find car
            lResCount(NO_CAR, DID_SWITCH) = lResCount(NO_CAR, DID_SWITCH) + 1
' Did not switch choice and did not find car
            lResCount(NO_CAR, NO_SWITCH) = lResCount(NO_CAR, NO_SWITCH) + 1
        End If
    End If

' Return the final value
    DoMontyHallCycle = bResVal

    Exit Function
' Error Handler
' Return Failure Flag
    bResVal = False
    Resume EXIT_DoMontyHallCycle
End Function
This is also known as the Monty Hall Problem, from a gameshow.

The explanation is easier to realize when considering 100 doors. If you choose 1 out of 100 doors, and then the game host removes/opens all but one of the remaining 99, it's fairly probable that the prize is behind the 99-now-collapsed-into-1 door, wouldn't you think?

It can of course be generalized to a case with n doors.

  • Probability of winning if you keep the door you originally picked:
    1 / n
  • Probability of winning if you choose another unopened door:
    ((n - 1) / n) * (1 / (n - 2))
The latter value is equal to (1 / n) * (n - 1) / (n - 2), which is greater than 1 / n for n >= 3. Thus, it is always better to switch doors.
For the benefit of people who (like me) didn't believe a word of this, but can't bear to look at Visual Basic, here's a quick perl experiment I conducted:

#! /usr/bin/perl while ($i++ < 10000) { # try 10,000 times @doors = ('goat', 'goat', 'goat'); $car = int(rand(3)); $doors[$car] = 'car'; $guess = int(rand(3)); for (0..2) { if (($_ != $guess) and ($doors[$_] eq 'goat')) { $open = $_; last; } } if ($j = !$j) { # every other time. for (0..2) { if (($_ != $guess) and ($_ != $open)) { $finalguess = $_; last; } } $switchwin++ if ($finalguess == $car); $switched++; } else { $unswitchwin++ if ($guess == $car); $unswitched++; } } print "switched wins: $switchwin/$switched\n"; print "unswitched wins: $unswitchwin/$unswitched\n\n";

Astoundingly, this consistently gives results like:
switched wins: 3298/5000
unswitched wins: 1555/5000

For those of you who, like me, couldn't get their head around this problem, try thinking of it this way...

Given a choice between choosing a goat to win a car or choosing the car to win a car, which would you pick?

Choosing the car at the begining of the game gives you a 1 in 3 chance. Choosing a goat gives you a 2 in 3 chance.

Asking to switch in the middle is simply changing this from a "choose the car" game to a "choose the goat" game, as the only way to win by switching is to have picked a goat in the first half.

Therefore, you have a higher probability of winning by switching.

Log in or register to write something here or to contact authors.