Simulating the Monty Hall Problem (1)
In 1990, Marilyn vos Savant, the woman with the world’s highest IQ, Parade magazine contributor, and wife of Dr. Robert Jarvik, the inventor of the Jarvik artificial heart, posed the following question to her magazine readers:
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?
This brain teaser is often referred to as the Monty Hall Problem, or the Monty Hall Paradox, because of its obvious resemblance to the game show Let’s Make A Deal. (On a quick tangent, a friend from high school was named Adeel. I’ve always joked that on the night he was conceived his parents said to one another, “Let’s Make Adeel!” He never found this as funny as I did.)
This puzzle was most recently made famous in the movie 21, when it was posed by Kevin Spacey’s character to one of his students. The student gives the correct answer, which I’ll point out in a moment. Before I do, let me tell you about my initial reaction to this problem. A few years ago I was reading a math book that brought up the Monty Hall question. My first response to the question of whether it was better to switch doors or stick with your first choice was, “it doesn’t matter.” After all, if it always comes down to two doors in the end then isn’t it always going to be a fifty-fifty chance?
The answer that the book provided, and the answer that the student gives in 21, is that you are better off switching doors every time. In fact, you double your chances of winning if you switch doors!
When I read this answer I couldn’t believe it. It didn’t make any sense to me. In fact, I decided that the only way I would believe it was if I saw it with my very own eyes. So, I did what any geeky programmer would do. I opened up a text editor and whipped together a quick little Java program that simulated the game. I had the program play the game 2,000 times, simulating a game where the contestant switches 1,000 times and doesn’t switch the other 1,000 times. Sure enough, when the player switched doors they won approximately 66% of the time, and when they didn’t switch doors they won only 33% of the time.
At this point I was convinced that you were better off switching doors, but it took me a little while to grok the reason for why. Here’s how I now like to explain it…
Let’s imagine a scenario where the contestant picks door number one. There are now two sets of doors: The set of chosen doors (a set containing one door) and the set of unchosen doors (a set containing two doors.) (BTW, “unchosen” isn’t a real word, but don’t you think it should be?) Which set has a better chance of winning? Well, the first set (the set containing one door) has a 1/3 chance of winning, while the second set (the set containing two doors) has a 2/3 chance of winning. Obviously, the set with two doors is more likely to contain the winning door.
Think of it this way: If you buy one lottery ticket, and I buy two lottery tickets, who has the better chance of winning? Of course, with lottery tickets neither one of us has a good chance of winning, but the person with two lottery tickets is twice as likely to win as the person with only one ticket.
When Monty asks if you would like to switch doors, what he’s really asking is, “would you like to leave the set that has a 1/3 chance of winning and move to the set that has a 2/3 chance of winning?” When framed this way, of course you’d want to switch sets!
An important thing to point out is that Monty knows in advance where the car and goats are. Since Monty can’t open the winning door, he often has no choice about which door to reveal. (If you pick door number one, and the car is behind door number two, then Monty has no choice but to reveal door number three.)
When I deliver corporate training seminars, I like to conduct an “afternoon distraction” with my students every day after lunch. One of my favorite afternoon distractions is the Monty Hall Problem. Even after explaining the solution with words and visuals, some students still don’t believe the logic actually works. Remember, I was the same way when I first heard this brain teaser a few years ago. For people that simply won’t believe it until they see it, I rewrote my initial Java application in JavaScript…. see below.
Try it out, and remember, you’re always better off switching doors. (Although, with the rising cost of gas combined with the rising cost of food, I could almost understand preferring a goat to a car!)


| Number of wins by switching doors: | 0.00% (0/0) |
|---|---|
| Number of wins by not switching doors: | 0.00% (0/0) |



With this new outlook, traffic stopped having the same anxiety inducing effects on me. Viewing my car as a forward traveling time machine, I came to realize that I should be no more frustrated by traffic congestion than I should be with miles of open road. (Or, if you’re a pessimist, you should be just as furious with empty lanes as congested ones!)