Originally motivated by the analysis of games of chance, probability theory, through its concepts, methods and results, plays a role in a great many fields, including the social sciences (sociology, economics, etc.) and the natural sciences (physics, biology, chemistry, etc.). From middle school through higher education, students therefore encounter the analysis of probabilistic phenomena at every stage.
The Monty Hall paradox is a concrete example of probability in action. Inspired by the American television game show Let's Make a Deal, hosted by Monty Hall (1921–2017) from 1963 to 1977, it also appeared in 1990 in the Ask Marylin column of Parade Magazine.
Simulations to see for yourself
==================================
On a television game show, a contestant faces three doors. Behind one is a car; behind the other two are goats (supposedly consolation prizes). The contestant selects one of the three doors. The host, who knows what lies behind each door, opens one of them to reveal a goat. The contestant must then choose again: stick with the original choice or switch?
Is the probability of winning by switching doors greater than the probability of winning by staying with the original choice?
To answer this question, we will use a Python program to simulate a large number of rounds of the Monty Hall game. At the start of the 2018 school year, a free update for Casio's Graph 90+E calculator will add a new Python programming menu. We will use this new menu to run our simulation.
In this program, we will define a function that generates a single round. One of the three doors is chosen as the hiding place for the car. The function then selects the contestant's initial choice and eliminates one of the two doors hiding a goat. Depending on the contestant's strategy—switching or staying—we will count how many of 1,000 rounds the contestant wins.
Let's look at the details. First, a "Tactique" class is created. The contestant has two options: switch or keep the initial choice.
The second step is to define the "jouer\_jeu" function. For a single round, it simulates the contestant's choice of door, the host's opening of a losing door, and then the contestant's final choice.
To simulate a large number of rounds, let us define the "jouer" function. This function returns the result of each round in a list. The results are recorded according to whether the contestant wins (0 for a loss and 1 for a win). All that remains is to add up the entries in each list for a given number of rounds—1,000 here—for each of the contestant's strategies, and then display the result.
Once the program has been written, we can run it in the Shell console.
Out of 1,000 rounds, about 66% are won when the contestant switches doors, compared with only 34% when the contestant stays. We may reasonably conjecture that the probability of winning is higher when the contestant switches doors.
Ladies and gentlemen, if you want to improve your chances of winning this game, here is a word of advice: change your initial choice!
Bayes takes the helm
===================
Contrary to what many people may think, contestants who switch doors really do have a two-thirds chance of winning, compared with only one-third if they keep their original choice. Let us use Bayes' theorem to confirm this reasoning.
Let P(A | B) denote the probability of event A given event B, and let P(A) and P(B) denote the respective probabilities of A and B. Then (see pages 22–24):
P (A|B)=P (B)P (B|A) P (A).
Let us apply this theorem to our problem. Suppose the player initially chooses door 1 (the reasoning would be the same for either of the other two doors).
P (V1∣C2)=P (C2)P (C2∣V1) P (V1)
where P(V1) is the probability that the car is behind door 1, P(C2) is the probability that the host reveals a goat behind door 2, and P(C2 | V1) is the probability that the host reveals a goat behind door 2 given that the car is behind door 1.
The probability P(V1) is equal to 1/3, since the car is equally likely to be behind any of the three doors.
P(C2 | V1) is equal to 1/2. The host, who knows where the car is, may choose to open either door 2 or door 3, given that the car is behind door 1—the contestant's initial choice.
P(C2 | V2) = 0: if the car is behind door 2, there is no chance that the host will not open it.
P(C3 | V3) = 1: if the car is behind door 3 and the player has chosen door 1, the host must choose door 2.
P (C2)=P (C2∣V1) P (V1)+P (C2∣V2) P (V2)+P (C3∣V3) P (V3)
P (C2)=21×31+0×31+1×31=21.
P (V1∣C2)=2121×31=31.
The contestant therefore has about a 33% chance of winning without switching doors.
But if the contestant switches doors, the chance of winning rises to about 67%:
P (V3∣C2)=P (C2)P (C2∣V3) P (V3)=32.
The probability of winning is higher when the contestant switches doors.