Skip to content

How I Came to Understand the Solution to the Monty Hall Problem

The Monty Hall problem is considered an example of a problem whose solution is counterintuitive. There are many who may be familiar with this problem, although relatively few may truly understand the solution to it. The problem’s solution is explained on a number of different pages on the web, such as the Wikipedia page for it. A description of the problem and a description of its solution were given in the film 21 and on an episode of the television series Numb3rs. However, even after hearing explanations of the solution to the problem in that film and on that television show, I never truly fully understood how one could see how the solution to the problem made sense. That is, until quite recently, when I was able to view it so that it made sense to me.

For those of you not familiar with the problem, here is a short description of it: On the game show titled Let’s Make a Deal, a contestant would be given a choice to open one of three doors. Behind one of these doors was a car, and behind the other two doors were goats. The contestant would choose a door to open. After the contestant chose one of the three doors to open, the host, Monty Hall, would actually open a door not selected by the contestant, and it would be one that had a goat behind it. He could do this, as he knew what was placed at random behind each door. Opening a door that has a goat behind it leaves two doors closed, one of which has a car behind it, and the other has a goat behind it. He would then give the contestant the option to open the closed door that the contestant did not initially choose. The contestant would then win whatever was behind whichever door was selected at this point.

There are many who think that switching which door to open does not improve the contestant’s chances of winning the car. As there would be a car behind one door and a goat behind the other door, many believe that the contestant has a 50% chance of winning the car regardless of which of these doors is selected. The question of whether or not choosing to open the previously unselected door would improve the contestant’s chances of winning the car was asked by the professor of an artificial intelligence course that I took while at university. Some do not understand why the probability of winning the car increases from 33.3% to 66.7% when the contestant switches which door to open. Those individuals will be pleased to know that approximately half a class of fourth year computer science students thought that switching doors would not affect the probability of winning the car, and that the professor said that he finds that about half the class usually gets the answer to this question wrong.

The reason switching which door to open leads to an increase in the probability of winning a car is stated formally in a number of places, and it is often given in terms of conditional probability in these places. However, many people would prefer a less formal, more understandable, yet still accurate explanation of why it pays to open the door that was not initially selected. There are a number of different ways in which one can understand why switching doors doubles the probability of winning a car. One of the better-known explanations involves imagining a similar situation. In this situation, there are many more than three doors from which to choose, although only one door has a car behind it and the rest have goats behind them. After choosing a door, all but one of the unselected doors are opened, and all of these doors are revealed to have had goats behind them. When one visualizes all but one of these other doors being opened, it seems to almost be a certainty that the one door left closed and not selected would have the car behind it. Since the host only opens doors that have goats behind them, the host is giving information about what is behind every door that was not selected. When one imagines several of these doors being opened, and only one among them being left closed, one may understand how the door left closed was not likely chosen at random by the host. I thought this explanation was a good one, although I thought that an explanation that applies to the actual situation in which there were three doors from which to choose would be preferable.

I have seen the solution to the problem given in terms of Bayesian analysis. However, it may have been because I majored in computer science, not statistics, that I came to understand the problem when I viewed the source code of an implementation of a similar problem. It was when I was viewing the source code of a program that included a game titled “Find the Ace” that I found that I could explain why switching doors doubles the probability of winning a car. This program, whose source code is in the book titled “Hacking: The Art of Exploitation” and is located in the file titled “game_of_chance.c” in an archive that can be downloaded from here, allows one to view the problem as if it were an algorithm. In the program, one is dealt three cards which are “face down” and only one of these cards is an ace. After selecting a card to “turn over” one can choose to switch which card to select after an unselected card other than an ace is revealed. It was after viewing this source code that I realized that I needed to view the Monty Hall problem from the perspective of the host who reveals what is behind the doors. And I could explain why a contestant should always switch doors by describing what the host must do after the contestant initially selects a door.

This explanation is as follows: When one first chooses a door to open, then there is, of course, a 33.3% chance that the car is behind that door. Then the host always opens a door that has a goat behind it. If the contestant chooses the door that has the car behind it at first, then the host can choose between two doors to open. And in that case, no information about which door has the car behind it is given, as the host is choosing a door at random. However, there is a 66.7% chance that a door with a goat behind it was selected at first. And in that case, the host has no choice as to which door to open, as only one of the two remaining doors has a goat behind it. It is in this case that the host is not opening a door at random, and giving information about where the car is, by the process of elimination. Therefore, 66.7% of the time, when a goat is selected at first, the host is giving information about what is behind the closed door that was not selected by the contestant. This is made clear when one views the source code for an algorithm that implements this kind of game. In fact, one might see that in the source code of the “Find the Ace” game, the first of the three cards that is not an ace is always revealed. Therefore, whenever the first of the three cards not selected by the user is left unrevealed, one will always win by switching which card to select.

Some explanations of why switching which door to open are more understandable to some people than others. Some might prefer informal explanations such as the one given in this entry. Some, like myself, prefer to see the source code behind the problem. Some might prefer to see how the probability of winning a car is derived by seeing how this probability is calculated. To those people, I suggest viewing this section of the article on Bayes’ theorem. I find that it gives a concise explanation of how switching from one particular door to another, without loss of generality, increases the probability of winning by explicitly giving the probability of the host opening a particular door. And there are those who might still need to see for themselves that this is true, and can visit this site to play the game several times to see if they will win the car more often after switching which door to open. One can also view the source code of this web page on which this game can be played to see how the game is implemented. However, when reading the source code, it helps to be able to understand the languages of English, German, and JavaScript. Understanding two of these three languages may be sufficient, though.

I have found that some do not find that they can understand why switching doors increases the probability of winning a car even after hearing explanations of this solution. And after some discover why switching doors increases the probability of winning a car, they may be disappointed that they did not originally understand why one should always switch which door to open. I understand why some would be disappointed that they do not initially understand this. This is because I was one of those students in the class who raised their hands after the professor of that AI class asked who thought it would make no difference to switch which door to open.