Results 1 to 8 of 8

Thread: Monty Hall problem

  1. #1

    Thread Starter
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Monty Hall problem

    Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
    The solution is said to be yes, because you have 1/3 probability to stay and 2/3 probability to switch.

    The answer to this problem has annoyed me to an extent. Why is the host completely ignored as a variable to calculate the probability? I think there is an error in this solution due to the fact that the host and his actions are completely ignored.

    Example:
    ' does not switch
    For c = 1 To 10000
    car = Rand(0, 2)

    If car = 0 Then
    x = x + 1
    End If
    Next c

    'always switches
    For c = 1 To 10000
    car = Rand(0, 2)

    If car = 2 Then
    y = y + 1
    ElseIf car = 1 Then
    y = y + 1
    End If
    Next c

    This algorithm will create the same result, 1/3 does not switch, 2/3's switch.

    Now if I introduce the host as a variable:
    For c = 1 To 10000
    car = Rand(0, 2)

    If car Xor 1 = 0 Then
    host = 2
    ElseIf car Xor 2 = 0 Then
    host = 1
    End If


    If host = 1 Then
    If car = 0 Then
    n = n + 1
    End If
    ElseIf host = 2 Then
    If car = 0 Then
    n = n + 1
    End If
    End If

    Next c


    'my version - switch is always made
    For c = 1 To 10000
    car = Rand(0, 2)

    ' host must decide which door to open based on the location of car. Since he always opens a losing door....
    If car Xor 1 = 0 Then 'if car is in door 1
    host = 2 'host will open door 2
    ElseIf car Xor 2 = 0 Then
    host = 1
    End If


    If host = 1 Then ' if host opens door 1
    If car = 2 Then 'switch is made to door 2, is there a car?
    z = z + 1 ' win
    End If
    ElseIf host = 2 Then
    If car = 1 Then
    z = z + 1
    End If
    End If

    Next c
    With this algorithm, the probability changes to 1/3 and 1/3 and shows that you have equal chance to win, if you do or do not switch doors.
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  2. #2
    Hyperactive Member
    Join Date
    Jun 2006
    Location
    Best Place on Earth
    Posts
    363

    Re: Monty Hall problem

    The solution to this is actually simple, there is a goat behind all three doors.

    They just switch the goat behind the unchosen door with the car.

    Thus the probability for the mug, sorry contestant, is always 0/3
    Signature Under Construction

  3. #3
    Lively Member homer13j's Avatar
    Join Date
    Nov 2003
    Location
    Ohio Turnpike Exit 173
    Posts
    80

    Re: Monty Hall problem

    What? No year's supply of Turtle Wax?

  4. #4
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Monty Hall problem

    I didn't bother following your algorithm because anything that proves 1/3 + 1/3 = 1 is clearly wrong.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  5. #5

    Thread Starter
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    322

    Re: Monty Hall problem

    Quote Originally Posted by FunkyDexter
    I didn't bother following your algorithm because anything that proves 1/3 + 1/3 = 1 is clearly wrong.
    too bad nobody ever says.... hey maven... how about not doing that xor and then it'll display crap correctly (IE: car = 1). and then I go... wow doh on my part... I should stop doing this crap so late.. and they go... np...
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  6. #6
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Monty Hall problem

    lol - you shouldn't need us to point your mistakes, you evil genius, you.

    I once spent an evening arguing with my nephew (a horribly good coder BTW) who thought he'd come up with a fool proof system for playing roulette. He went away the next day and him and his boss spent the whole day programming a simulation (not much else to do I guess) which didn't give them the results they predicted but did show them making a profit. Only after another evenings argument did he realise that reseeding the rnd function every time you call it in VB6 tends to skew your results.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  7. #7
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    Re: Monty Hall problem

    I didn't look too much at your code but I did follow what you were saying. You correctly noted that the host intentionally chooses to open a door where it is known that that car is not located. This makes it favorable to switch doors when the host offers. The fact that the probabilities are not equal in this scenario is what makes this problem so difficult. Most people see the probability as equal. If the host had simply chosen a door at random to open (ignoring the location of the car), revealing a goat, then the probability that the car is behind the door you chose is 1/2 and switching would do you no good (if this were really happening the host would reveal the car 1/3 of the time and the game would be over right there). This is the scenario most people imagine and why most people get it wrong and that's precisely why, as you say, 'the host is ignored as a variable' -- it makes the problem less obvious, which is the point of telling these problems in the first place.

  8. #8
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    Re: Monty Hall problem

    I didn't look too much at your code but I did follow what you were saying. You correctly noted that the host intentionally chooses to open a door where it is known that that car is not located. This makes it favorable to switch doors when the host offers. The fact that the probabilities are not equal in this scenario is what makes this problem so difficult. Most people see the probability as equal. If the host had simply chosen a door at random to open (ignoring the location of the car), revealing a goat, then the probability that the car is behind the door you chose is 1/2 and switching would do you no good (if this were really happening the host would reveal the car 1/3 of the time and the game would be over right there). This is the scenario most people imagine and why most people get it wrong and that's precisely why, as you say, 'the host is ignored as a variable' -- it makes the problem less obvious, which is the point of telling these problems in the first place.

    BTW, your prob. of 1/3 and 1/3 isn't so crazy. You probably counted all trials, even those that resulted in the host revealing the car. You should get 1/3 win by keeping same door, 1/3 win by switching, and 1/3 host selects car and game over. But if you limit the trials to those where the host doesn't reveal the car, then it's 50/50 keeping the door or switching.
    Last edited by wy125; Aug 13th, 2008 at 11:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width