1 Introduction of the Monty Hall Problem

Exploration of the Monty Hall Problem
with Maple
Ng, Yui Kin
Department of Mathematics, The Hong Kong Institute of Education
10 Lo Ping Road, Tai Po, HONG KONG
Email: [email protected]
There are some teasers concerning conditional probabilities that are difficult for both the students
and even certain writers. The Monty Hall Problem is certainly a celebrated instance. In this
paper, we will first demonstrate in a mathematical way that why some prevailing solutions to this
problem are fallacious. And with the use of Maple together with Maple Statistics Supplement
provided by Karian and Tanis (1999), we will simulate the problem within a rich mathematical
environment so that, by playing around the computer algorithm, students could have a better
understanding of the solution and a deeper insight into the problem.
Key words: Conditional probabilities
Education
1
Monty Hall Problem
Maple
Mathematics
Introduction of the Monty Hall Problem
Implementing conditional probability notions and understanding their practical implication, as Morgan,
Chaganty, Dahiya, and Doviak (1991) argued, are difficult tasks for many students. Besides, some teasers
concerning conditional probabilities puzzles even some mathematicians and mathematics textbook writers. A
very famous example is the Monty Hall Problem which has become the subject of intense controversy since the
publication of a solution to a puzzle in Parade magazine by Marilyn vos Savant in 1990 (vos Savant, 1990a,
1990b, 1991, 1992).1 The problem runs like this:
“Suppose you are on a TV game show and given a choice of three boxes. Behind one and only one box is
a big prize – say, a diamond ring; inside the others are gag prizes – say, mouse-pads. You are asked to pick a
box and you choose, say Box A. The game show host, who knows what’s inside the boxes, opens another box,
say Box B – which has a mouse-pad.
You are then given the option to stick with your original choice or to
switch to the other unopened box. Is it to your advantage to stick with your original choice?”2
According to vos Savant, the answer would be “Yes you should switch. Box A has a 1/3 chance of
winning, but Box C has a 2/3 chance.” In the latter issues of Parade, there were three Ph.D.’s letters in which it
was saying that vos Savant’s answer was incorrect, and in two of the letters, it was further claimed that the
correct probability of winning with either remaining boxes should be 1/2. vos Savant gave rejoinder and a
national controversy was thus provoked (vos Savant, 1992).
Who’s correct?
2
Different Solutions to the Monty Hall Problem
Some might think in this way: Of the two boxes left, one contains the big prize, the other does not. It
makes no difference whether we stick or switch. We have a 50 percent chance of getting the box with the
diamond ring either way.
That is one solution.
Another solution is: we should switch! The argument runs as follows: Since you are selecting at random
1 The problem is called the Monty Hall problem due to its origin on the television show – Monty Hall’s ‘Let’s make a deal’. Craig
Whitaker wrote a letter to Marilyn vos Savant asking for consideration of this problem in her column in Parade Magazine. Marilyn then
gave a solution and several irate readers, some of whom identified themselves as having a PhD in mathematics, argued that Marilyn was
plainly wrong.
2 This version has been published in Ng (in press) and the original version posted in Parade Magazine can be found in vos Savant (1990b,
1992).
201
amongst three boxes, the chance that Box A contains the ring is 1/3. If you stick to your first choice, you will
have a 1/3 chance of getting the diamond ring. On the other hand, the chance that the ring is not in Box A will
be 2/3. Suppose the ring is not in Box A, of the two boxes left, one contains the big prize, the other does not.
The host could only open the box with the mouse-pad and in this case you will certainly get the ring if you
switch. In other words, no matter your original selection is correct or not, you double your chances of getting
the ring from 1/3 to 2/3 if you switch. This conclusion could also be demonstrated by considering the six cases
that exhaust all the possibilities:
Box A
Box B
Box C
Switch
Get the ring
Case 1
Ring
Mouse-pad
Mouse-pad
Yes
No
Case 2
Ring
Mouse-pad
Mouse-pad
No
Yes
Case 3
Mouse-pad
Ring
Mouse-pad
Yes
Yes
Case 4
Mouse-pad
Ring
Mouse-pad
No
No
Case 5
Mouse-pad
Mouse-pad
Ring
Yes
Yes
Case 6
Mouse-pad
Mouse-pad
Ring
No
No
You choose Box A in all six cases. Assuming that the host will not reveal the box containing the ring to
you during the game, you will get the ring in cases 2, 3 and 5. In other words, when you don’t switch (cases 2,
4, 6), only in case 2 you will get the ring. That means you will get the ring 1/3 of the time if you don’t switch,
but when you switch (cases 1, 3 and 5), you get the ring 2/3 of the time (cases 3 and 5).
Trivially, at least one of these two lines of reasoning must be fallacious. Today, there are still many
probability textbooks and volumes of mathematical recreations in which the second one is regarded as the
correct solution.3 But in what follows we will use conditional probability concept to show that the first
solution is mistaken in most cases (not all) but the second solution is also not completely correct.
3
Using Bayes’s theorem to analyze the problem
Bayes’s theorem does not only provide a formula for computing unknown probabilities from known ones.
It can, as Biehler(1991) argued, also play an important role in probability education as a tool for making
probability judgments. We will here use Bayes’s theorem to analyze the problem and will find that one very
important but easily be ignored implicit assumption could thus be revealed.
Let us denote the events that the ring inside the Box A, B, C by P, Q, R respectively and q, r be the events
that the host opens the Box B, C respectively to reveal the thing inside the box after you made your first
selection. Suppose you choose Box A and the host opens Box B to reveal the mouse-pad, the probability that
the ring is inside Box C is P(C | q) . By Bayes’s theorem, we have:
P(q | C ) p(C )
P(C | q) 
.
P(q | A) P( A)  P(q | B) P( B)  P(q | C ) P(C )
In order to compute P(C | q) , we need to make at least two assumptions. First, it is quite natural to
assume that P( A)  P(B)  P(C)  1/ 3 . Second, when the ring is not inside Box A, the host will never reveal
the ring to you, i.e. P(q | B)  0 and P(q | C )  1 . But when the ring is inside Box A, the host can open
either Box B or Box C. How does the host behave? If we attribute equal probabilities to these two available
options, i.e. P(q | A)  P(r | A)  1/ 2 , then the probability required is:
1
2
3
P(C | q) 
 ,
1 1
1
1 3
  0   1
2 3
3
3
that is the answer we got in the second line of reasoning.
But this answer is correct only when we assume
that the host is unbiased about opening either Box B or C when the host knows that the ring is inside Box A.
Suppose the host will open Box B with probability t (where 0  t  1 ) when the ring is inside Box A, the
probability that the ring is in Box C is
1
1
1
3
.
P(C | q) 

1
1
1 t 1
t   0   1
3
3
3
1
3 See, for instance, Haigh, 1999.
202
t
.
t 1
Since 0  t  1 , P(C | q)  P( A | q) for any t  [0,1] . The equality holds (i.e. it makes no difference
whether we stick or switch as what the first solution suggests) if t = 1. Of course, no matter what the value of t
is, it would still be wise for you to switch though not for the reason provided by the second solution.
Many students find difficulties in reconciling this solution with their intuitions (Falk & Konold, 1992).
But with the use of computers, we can simulate a large number of trials in a very short time, so we should be
able to let our students to test their results (Isaac, 1995). In the following section, we are going to write some
elementary algorithms for simulation of the Monte Hall Problem with the use of Maple and Maple Statistics
Supplement provided by Karian and Tanis (1999).
Similarly, P( A | q) 
4
Using Maple to simulate and explore the Monte Hall Problem
It is often suggested that simulation should be used in probability education and an abundance of instances
has been already published (Biehler, 1991). Apart from the use of simulation for solving problems, simulation
can also be used to provide model environments to explore. But when computers were not available, the time
required to perform simulation constituted a very difficult issue for educators. Nowadays, the availability of
computers is no longer a problem for most colleges or schools. Many students have already been familiar with
statistical packages such as SPSS. Such systems have powerful numeric and graphic features that are
user-friendly to the students. But it is not an easy task for them to use such packages to explore probability or
statistics problems. Computer algebra systems, such as Maple, together with certain statistics supplement,
could, however, provide a rich environment for mathematical manipulations so that we could conduct many
statistical analysis as well as explorations (Karian and Tanis, 1999).
In what follows, we will use Maple to simulate the Monte Hall Problem. The user is required to run the
Statistics Supplement first.
> libname:="C:/mylib/statpackage",libname:
> with(stat);
Then the user could choose a number of trials, N and the probability that the host will open Box B when the
diamond ring is inside Box A, t. By using the following algorithms, we could calculate the relative frequencies
of getting the ring when we never switch (Notswitch) and always switch (Switch) our selection. For 10000
trials and t = 0.5 we got a relative frequency of 0.32573 for getting the diamond ring when we always stick to
our original choice (Box A) and of 0.67427 when we always switch after the mouse-pad in Box B was revealed
to us. But when t = 1,
the relative frequencies obtained were 0.50091 and 0.49909 respectively.
> N:=10000:t:=0.5:
> L:=[0,0,1]:SW1:=0:SW2:=0:NW2:=0:NW3:=0:
> for i from 1 to N do
> LL:=randperm(L);LL[1]:
> if LL[1]=1 then
>
S:=[2,t,3,1-t];
>
RR[i]:=op(DiscreteS(S,1)):
>
if RR[i]=2 then NW2:=NW2+1:
>
else NW3:=NW3+1;
>
fi;
> elif LL[2]=1 then
>
RR[i]:=3:SW1:=SW1+1:
> else RR[i]:=2;SW2:=SW2+1:
> fi;
> od:
> R:=[seq(RR[i],i=1..N)]:FF:=Freq(R,1..3);F2:=FF[2];
> >Swithch:=evalf(SW2/(NW2+SW2),5);Notswitch:=evalf(NW2/(NW2+SW2),5);
203
The number of repetitions can be easily increased (simply change the value of N) so that uncertainty and
variation in the results can be reduced. New kinds of patterns become observable. Moreover, an extensive
exploration is possible by changing the assumptions of the model. For example, students could change the
value of t and see its influence on the relative frequencies obtained. By playing around with probability and the
computer, students perhaps could discover new results that might not be obvious to them if computers are not
available. For instance, students may contrast the difference of the following different calculations:
> Swithch:=evalf(SW2/(NW2+SW2),5)
> Swithch1:=evalf((SW1+SW2)/N,5)
and explore the difference of their meanings in terms of conditional probabilities.
5
Concluding Remarks
There are certain teasers concerning conditional probabilities that are difficult to many students and even
probability textbook writers (Bar-Hillel and Falk, 1982). The Monte Hall Problem is an instance. In this
paper, we have shown in a mathematical way that why some prevailing solutions to the Monte Hall Problem are
fallacious and use Maple to simulate the problem so that by playing round the algorithm students could have a
better understanding of the solution and a deeper insight into the problem
References
[1] Bar-Hillel, M., & Falk, R. (1982). Some teasers concerning conditional probabilities. Cognition, 11,
109-122.
[2] Biehler, R. (1991). Computers in probability education. In R. Kapadia, & M. Borovcnik (Eds.), Chance
encounters: Probability in education (pp. 169-211). Dordrecht: Kluwer.
[3] Falk, R., & Konold, C. (1992). The psychology of learning probability. In F. Gordon and S. Gordon
(Eds.), Statistics for the twenty-first century (pp. 151-164). Washington: Mathematical Association of
America.
[4] Haigh, J. (1999). Taking chances: Winning with probability. Oxford: Oxford University Press.
[5] Karian, Z.A., & Tanis, E.A. (1999). Probability and statistics: Explorations with Maple (2nd ed.). Upper
Saddle River, NJ: Prentice Hall.
[6] Isaac, R. (1995). The pleasures of probability. New York: Springer-Verlag.
[7] Morgan, J.P., Chagantz, N.R., Dahiya, R.C., & Doviak, M.J. (1991). Let’s make a deal: The player’s
dilemma. American Statistician, 91(45), 284-287.
[8] Ng, Y.K. (in press). Conditional probability and its practical implication: Should you stick or switch in a
game show? Young Post.
[9] vos Savant, M. (1990a). Ask Marilyn. Parade Magazine, September 9, 15.
[10] vos Savant, M. (1990b). Ask Marilyn. Parade Magazine, December 2, 25.
[11] vos Savant, M. (1991). Ask Marilyn. Parade Magazine, February 17, 12.
[12] vos Savant, M. (1992). Ask Marilyn: Answers to America’s most frequently asked questions. New
York: St. Martin’s Press.
204