The Monte Hall Problem

Boyd E. Hemphill of The John Cooper School
and
Dennis Donovan of The Galveston Bay Project

Presented at
The 10th Anniversary Celebration of
The Rice University School Math Project

Description of Problem
Game Program (Montesim)
Rapid Simulation (Monte)
Related Bookmarks

Description of Problem

The infamous probabalistic conundrum that has come to be know as "The Monte Hall Problem" has its history in the game show Let's Make A Deal. Here is the infamous Monte Hall problem, as it appeared in Parade Magazine (September 1990):

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 number 1, and the host, who knows what's behind the doors, opens another door, say number 3, which has a goat. He then says to you, ``Do you want to pick door number 2?'' Is it to yo ur advantage to switch your choice?

Question #1: Does it matter if you change your mind?

Question #2: What is the probabilty of winning if your remain with door number one?

Quesiton #3: What is the probability of winning if your change your mind to door number two?

Surprisingly, the answer to question #1 is yes, it does matter. Intuitively, one would believe they have a one in two chance of winning, but this is not the case.

The answer to question #2 is that your probability remains one out of three for winning if you choose to remain with door number one. This implies the answer to question #3 is two out of three because the probabilities must total one.

Frankly, I did not believe this result when it was explained to me at the Park City Math Institute in the summer of 1996. The result of my disbelief is the programs for the TI-82 Graphing Calculator b elow. In short, the program Montesim will allow you to act as the player and remain with your first choice or change you mind. The program "Monte" will allow you to make this decision up front and then run a specified number of trials based on that deci sion. In each case, enough trials will confirm the above results!

I intend to use Montesim first and allow the participants to come to their own understanding of the unexpected result. I will compile the results, and then use Monte to strengthen them. Finally, I will explain the reasons behind the result. I expect th is to take about 10 minutes. The codes, and more extensive descriptions of the programs, follow below. Finally, I have listed some of the bookmarks I collected to help me put together the programs and presentation. I hope you enjoy confirming this very interesting result, and I hope you have fun pondering its generalizations.

Boyd E. Hemphill

Game Program (Montesim)

The Program "Montesim" is an actual simulation of the game show "Let's Make a Deal." It allows you to choose your door, then it opens the wrong one "accidently." You are then asked whether you want to change your mind. After you decide, you are told wh ether you win or lose. The program keeps track of how many times you win or lose in each of the cases--change your mind or remain with your original choice.

Throughout the code below, I have placed comments that can be recognized by the change of font. These are intended to give you an idea of what the program is doing and suggestions for improvements you might make.

One improvement you may make right away is in error traps. I have made no provisions for them. An error trap is a logical test that would, for example, keep the user from choosing door number 4 or 2.73. This would corrupt the results of the simulation. In the case where an error trap may be useful, I will call for one and define its purpose.

Finally, Dennis and I worked for several days getting the program correct. We implore you to include our names and that of the Rice University School Math Project in the form specified in the program. If you decide to use our program at an inservice, pl ease credit us in your handout. If you have the time, drop us an email message and let us know where and how you are using the program. We appreciate your time, and our bosses will appreciate us!

Set variable values for use in the program.

:8->y:9->n
:0->B:0->D:0->E:0->N:0->U:0->V:0->W:0->Y:0->Z:0->I:0->J
:ClrHome
The introduction. This only happens the first time you start the program.
:Disp " "
:Disp "LETS MAKE A DEAL"
:Disp " "
:Disp "  B. HEMPHILL"
:Disp "   D. DONOVAN"
:Disp "     [ENTER]"
:Pause
:ClrHome
:Disp "    WITH"
:Disp " "
:Disp "    THE RICE"
:Disp "   UNIVERSITY"
:Disp "  SCHOOL MATH"
:Disp "    PROJECT"
:Disp " "
:Disp "    [ENTER]"
:Pause
:Lbl A
The program asks for a door. This is the first place an error trap could be used to force the user to pick 1, 2 or 3.
:ClrHome
:Disp "  CHOOSE DOOR"
:Input "(1,2,3)",D
The next line is how the winning door is randomly generated. The following If . . . Then tests determine which wrong door to open.
:int 3rand+1->W
:If (D=1 and W=2)
:Then
:Disp "DOOR 3=ZONK"
:Goto T
:End
:If (D=1 and W=3)
:Then
:Disp "DOOR 2=ZONK"
:Goto T
:End
:If (D=2 and W=1)
:Then
:Disp "DOOR 3=ZONK"
:Goto T
:End
:If (D=2 and W=3)
:Then
:Disp "DOOR 1=ZONK"
:Goto T
:End
:If (D=3 and W=1)
:Then
:Disp "DOOR 2=ZONK"
:Goto T
:End
:If (D=3 and W=2)
:Then
:Disp "DOOR 1=ZONK"
:Goto T
:End
:If (W=1 and D=W)
:Then
:Disp "DOOR 2=ZONK"
:Goto T
:End
:If (W=2 and D=W)
:Then
:Disp "DOOR 1=ZONK"
:Goto T
:End
:If (W=3 and D=W)
:Then
:Disp "DOOR 2=ZONK"
:Goto T
:End
A message indicating "Monte's mistake" is given and the user is asked to decide whether to change their mind or remain with their first door. Again, nothing in the program keeps them from picking the door already open. An error trap to force the user in to such a decision would be good here. The problem is that the value of the mistakenly open door is never assigned above. You will have to rectify this.
:Lbl T
:Disp " "
:Disp "      OOPS"
:Disp " "
:Disp "CHOOSE AGAIN"
:Disp "FROM REMAINING"
:Input "DOORS",E
The program determines if you have changed your mind so it can track the appropriate statistics.
:If D=E
:Then
:Goto R
:Else
:Goto S
:End
The program determines if you win or lose and notifies you. The two similar If . . . Then statements are for the two different situations--remain with first choice or change mind.
:Lbl R
:If E=W
:Then
:Disp "YOU WIN"
:I+1->I
:Else
:Disp "ZONKED AGAIN"
:J+1->J
:End
:Goto Z
:Lbl S
:If E=W
:Then
:Disp "YOU WIN"
:U+1->U
:Else
:Disp "ZONKED AGAIN"
:V+1->V
:End 
Stats are given in table form, and a choice to run the program again or exit.
:Lbl Z
:ClrHome
:Output(1,6,"STATS")
:Output(2,1,"WINS")
:Output(2,8,"LOSSES")
:Output(3,2,"CHANGED MIND")
:Output(4,1,U)
:Output(4,8,V)
:Output(5,1,"UNCHANGED MIND)
:Output(6,1,1)
:Output(6,8,J)
:Output(7,1,"[ENTER] CONTINUE")
:Output(8,3,"[ON] BREAK")
:Pause
:Goto A

Rapid Simulation (Monte)

The program Monte is a vast modification of a short program written by John Powers. It assumes "Monte's Mistake" has already occured and allows you to choose in advance if you would like to change your mind or remain with the first door choosen. Then it asks you for the number of such trials to work with. If you have the time, you could run 1,000,000 but this would take hours. The results given are the number of wins and losses you would experience for the number of trials you pick. This is a fast wa y to demonstrate the interesting answer to the problem.

Again, I will make short comments in the code to help you determine what the program is doing. I could find no need for error traps except the one I included in the beginning.

Again, I ask that you include Mr. Powers' name and my own in the program in the specified form. If you decide to use our program at an inservice, please credit us in your handout. If you have the time, drop me an email message and let me know where and how you are using the program. I appreciate your time, and my boss will appreciate me!

The introduction. This only happens the first time you start the program.

:ClrHome
:Disp "     MONTE"
:Disp " "
:Disp "       BY"
:Disp " JOHN P. POWERS"
:Disp " "
:Disp "  MODIFIED BY"
:Disp "BOYD E HEMPHILL"
:Pause
The program asks you to which way you would choose to go--remain with the same door or change your mind.
:Lbl K
:ClrHome
:Disp "ALWAYS CHANGE"
:Disp "MIND PRESS 8"
:Disp " "
:Disp "ALWAYS STAY WITH"
:Disp "FIRST CHOICE"
:Disp "PRESS 9"
:Input M
The following is an error trap that forces the user to choose 8 or 9. (Note: <> means not equal on test menu)
:If (M<>8 and M<>9)        
:Then
:Goto K
:Else
:Goto O
:End
:Lbl 0
:If M=9 
:Then
:Goto F
:Else
:Goto G
:End
The program reminds you of your choice and sets the win and loss counters to 0. Then it prompts the user for the number of trials.
:Lbl F
:0->L
:0->W
:Lbl A
:ClrHome
:Disp "STAY WITH FIRST"
:Disp " "
:Input "TRIALS:",N
A loop is created to repeat the "remain with original" senario N times. The two remaining doors are generated and the program assigns your original choice to the variable G and the winning choice to the variable W. The third door ca n be ignored since it has been revealed as a loss. Finally the program decides you win if you original choice matches the winning door and displays a result.
:For(I,1,N)
:int 3rand+1->G
:int 3rand+1->B
:If G=B
:Then
:W+1->W
:Disp "WIN"
:Else
:L+1->L
:Disp "LOSE"
:End
:End
:ClrHome
:Disp "WINS=",W
:Disp "LOSS=",L
The user is given a choice to run another simulation or quit the program.
:Output(6,1,"[ENTER] CONTINUE")
:Output(7,3,"[ON] BREAK")
:Pause
:Goto K
A loop is created to repeat the "change mind" senario N times. The two remaining doors are generated and the program assigns your original choice to the variable G and the winning choice to the variable W. The third door can be igno red since it has been revealed as a loss. Finally the program decides you win if you original choice matches the winning door and displays a result.
:Lbl G
:0->L
:0->W
:ClrHome
:Disp "CHANG MIND"
:Disp " "
:Lbl A
:Input "TRIALS",N
:For (I,1,N)
:int 3rand+1->G
:int 3rand+1->B
:If G=B
:Then
:L+1->L
:Disp "LOSE"
:Else
:W+1->W
:Disp "WIN"
:End
:End
:ClrHome
:Disp "WINS=",W
:Disp "LOSS=",L
The user is given a choice to run another simulation or quit the program.
:Output(6,1,"[ENTER] CONTINUE")
:Output(7,3,"[ON] BREAK")
:Pause
:Goto K

Related Bookmarks

For a great description of the Monte Hall problem, visit:
Monty Hall (Let's Make a Deal) Problem

To see John P. Powers original Monte program in its TI-85 format, vist:
InterNIC's Graphing Calculator Programs

To get a MacIntosh simulation, visit:
Mike Naylor's Software Page

Return to Boyd's Homepage

URL: http://math.rice.edu/~hemphill/Professional/Presentations/MonteHall/Monte.html
This page is maintained by
:
Boyd E. Hemphill
Last Updated: 6 September 1996