Posted 120 days ago
I read a very interesting article on the NY Times today, linked from this /. article, about the Monty Hall Problem. The problem has apparently caused much embarrassment among mathematicians, and now psychologists, and it's a very interesting read.
I couldn't quite agree with the argument put forth, and I'm no mathematician, so I wrote a simple program to calculate some numbers for me... first, lets review the problem at hand:
- I present you with three closed doors. Behind one is a new car, the other two, a goat.
- You choose one of the three doors, hoping it has a car.
- I open one door exposing a goat.
- You may keep your original door, or change your mind choosing the other closed door.
- Open your door, if it's the car, you can keep it.
So as impulsive humans, it's easy to see, and think, that since I open one door, your final choice gives you a 50/50 shot at winning a car. The argument in the paper those posits that you should change your mind, since your original decision only had a 33% chance of being correct, and a 66% chance of being wrong.
Here is my source for the simulation I ran: MontyDoor.cpp. It very closely follows the steps I laid out above, resetting the doors at the start of the loop, randomly choosing which one contains a "car" (true value). The simulates a user's choice (rand mod three), opens a door containing a goat, and then simulates the user randomly choosing to change their mind (rand mod 2). It totals how many times the user kept their original door and won a car, as well as how many times the user changed their minds and won a car.
I present the results here for you to mull over - I ran 75,000,000 iterations of the loop and got the following:
How many iterations: 75000000
In 75000000 runs, we won a car 44.4418% of the time.
Used original choice and won a car 12499628 out of 37505245 times... 33.3277%
Chose the other door and won a car 20831722 out of 37494755 times... 55.559%
Suggesting that your original choice is only correct 33% of the time - which makes perfect sense. However, after I open a door and narrow your choices down, you have about a 50% chance of winning the car when you change your mind.
Since your original choice was made out of three closed doors, you'll win with that choice 33% of the time. However, when you change your mind you're only choosing out of two closed doors, so you'll win about 50% of the time.
Doesn't add up, I know - but makes a certain bit of sense.
add to
del.icio.us