Decrepit Ian J. Tree - "Cogito ergo sum"
The Monty Hall Problem
Ian J. Tree - Eindhoven - 14/02/2025
There was a television gameshow in the US in the 1970's called "Lets's Make A Deal", the host of the show was Monty Hall. The show was fairly simple. A contestant is faced with three closed doors there is a car behind a random one of the doors and a goat behind the other two. The contestant, who is unaware of what lies behind each of the doors, is asked to select one of the doors and to inform Monty of his selection. Monty will then open one of the unselected doors that has a goat behind it. The contestant is then asked if he will stick with the original door he selected or switch to the other unopened door. Having changed (or not) his selected door, the remaining doors are flung open to see if the contestant has won the car (I believe that if his selected door had a goat behind it then he did not win the goat!).

The "problem" arose, not because of the gameshow itself but from a letter from Steve Selvin to the American Statistician in 1975 and then further discussed in Marilyn Vos Savant's "Ask Marilyn" column in Parade Magazine in 1990. The column discussed if the contestant would have a winning advantage if he stuck with his original door or switched to the other unopened door. Savant argued that the contestant should switch as that had a 2/3 probability of winning the car rather than a 1/3 probability of winning if he stuck with his original selection. Here lies the problem, an overwhelming 87% of people were in favour of sticking with the original selection leaving only 13% trusting in Savant's analysis.

What is the cause of the paradoxical bias in favour of "sticking"? One possible cause is "Endowment (or Investment) Bias", this bias is caused by people believing that their random selection of a door is in fact the result of an "inspired guess", where the inspiration came from any one of the following:-
	It's my lucky number.
	I always trust my gut feelings with things like this.
	I saw two dove's on my way to the studio.
	I am sure that Monty winked at me twice.
	A voice in my head whispered to me.
The contestant then endows their initial selection with a totally unwarranted bias.
Many people look at the problem and incorrectly determine that after Monty has opened a door there are two doors remaining so the probability of the car being each is 1/2 and therefore sticking with the original selection is as good as switching doors.

The MHProb program was developed to demonstrate the correctness of using the "switch doors" strategy to maximise the contestants chance of winning the car. We do this by presenting a series of scenarios that together provide a proof by induction of the correctness of the switching strategy.
In the first scenario we perform the selected number of trials following the protocols and information disclosure of the gameshow rigidly. This shows the result that sticking wins 1/3 of the time and switching 2/3 of the time. The second scenario introduces a second contestant who is allocated the two doors that are NOT selected by the first contestant. As might be expected this shows that the first contestnt will win the car 1/3 of the time and the second contestant 2/3 of the time, which is not surprising as the second contestant has twice as many doors as the first contestant. For the third scenario we allow Monty to open one of the second contestant's allocated doors at random, this shows the first contestant winning 1/3 of the time, the second contestant also winning 1/3 of the time and now Monty also winning the car 1/3 of the time. Then in the fourth scenario we change the way that Monty selects the door to open from random selection to the same protocol as he uses in the gameshow, he now opens one of the second contestant's doors that has a goat behind it. The fourth scenario now shows the first contestant winning the car 1/3 of the time, the second contestant again winning the car 2/3 of the time and Monty never wins the car. For the fifth and final scenario, after Monty has opened one of second contestant's doors the first contestant is invited to switch his choice of door with the second contestant. The final scenario has brought us back to the protocol and result of the first (gameshow) scenario hopefully with a clear understanding of why the switching strategy will always improve the chances of the first (or only) contestant winning the car by a factor of 2:1.
It should be noted that the second contestant was introduced ONLY to act as a placeholder for the doors that were NOT selected by the first contestant. The second contestant has no agency, he doesn't select anything indeed he plays no active part in any facet of the gameshow.

Below is a sample output from the program, each scenario performs 1,000,000 trials:-
2025/04/07 15:21:02: Monty Hall Problem (MHProb) Version: 1.0.0 build: 01 is starting.

SCENARIO #1 - IT'S SHOWTIME!
----------------------------

In this scenario we strictly follow the protocols and information disclosure model of the gameshow.

2025/04/07 15:21:02: INFO: Starting the show, performing: 1000000 trials.
2025/04/07 15:21:02: INFO: Show has ended with: 1000000 trials performed.
2025/04/07 15:21:02: INFO: The car was placed behind the first door: 334072 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the second door: 332243 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the third door: 333685 times (33%).
2025/04/07 15:21:02: INFO: The contestant guessed the car was behind the first door: 333174 times (33%).
2025/04/07 15:21:02: INFO: The contestant guessed the car was behind the second door: 333043 times (33%).
2025/04/07 15:21:02: INFO: The contestant guessed the car was behind the third door: 333783 times (33%).
2025/04/07 15:21:02: INFO: Sticking won: 333269 cars (33%).
2025/04/07 15:21:02: INFO: Switching won: 666731 cars (66%).
2025/04/07 15:21:02: INFO: The show ran for: 20 ms.

OBSERVATIONS:

We see that the result clearly favours the strategy of switching doors by a factor of 2:1. Here lies the crux of
of the problem, people favoured the strategy of sticking with the originally selected door by a massive 87% to
13% majority. In the following scenarios we will show correctness of the switching doors strategy in a clear manner.


SCENARIO #2 - TWO CONTESTANTS.
------------------------------

The setup for this scenario is the same as in the gameshow, the car is randomly placed behind one of the doors and
contestant #1 selects one of the doors at random. Contestant #2 is allocated the two remaining doors and the car
winning position is evaluated and recorded.

2025/04/07 15:21:02: INFO: Starting the contest, performing: 1000000 trials.
2025/04/07 15:21:02: INFO: The contest has ended with: 1000000 trials performed.
2025/04/07 15:21:02: INFO: The car was placed behind the first door: 333666 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the second door: 333353 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the third door: 332981 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the first door: 333171 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the second door: 333602 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the third door: 333227 times (33%).
2025/04/07 15:21:02: INFO: Contestant #1 won: 333837 cars (33%).
2025/04/07 15:21:02: INFO: Contestant #2 won: 666163 cars (66%).
2025/04/07 15:21:02: INFO: The contest ran for: 18 ms.

OBSERVATIONS:

An unsurprising result, contestant #2 won out over contestant #1 by a resounding factor of 2:1.


SCENARIO #3 - MONTY RANDOMLY OPENS A DOOR.
------------------------------------------

This scenario is an extesion of scenario #2, before the result of a trial is determined we allow Monty to select
and open one of the doors allocated to contestant #2.

2025/04/07 15:21:02: INFO: Starting the contest, performing: 1000000 trials.
2025/04/07 15:21:02: INFO: The contest has ended with: 1000000 trials performed.
2025/04/07 15:21:02: INFO: The car was placed behind the first door: 334055 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the second door: 332322 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the third door: 333623 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the first door: 333697 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the second door: 332578 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the third door: 333725 times (33%).
2025/04/07 15:21:02: INFO: Contestant #1 won: 333682 cars (33%).
2025/04/07 15:21:02: INFO: Contestant #2 won: 333202 cars (33%).
2025/04/07 15:21:02: INFO: Monty won: 333116 cars (33%).
2025/04/07 15:21:02: INFO: The contest ran for: 24 ms.

OBSERVATIONS:

This is clearly NOT what we want, Monty should not be allowed to win a car (he has enough of them).


SCENARIO #4 - GET MONTY INTO LINE.
----------------------------------

This scenario is an extension of scenario #3, before the result of a trial is determined we allow Monty to select
and open one of the doors allocated to contestant #2, he may ONLY select a door with a goat behind it.

2025/04/07 15:21:02: INFO: Starting the contest, performing: 1000000 trials.
2025/04/07 15:21:02: INFO: The contest has ended with: 1000000 trials performed.
2025/04/07 15:21:02: INFO: The car was placed behind the first door: 332729 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the second door: 334072 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the third door: 333199 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the first door: 333559 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the second door: 333192 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the third door: 333249 times (33%).
2025/04/07 15:21:02: INFO: Contestant #1 won: 332966 cars (33%).
2025/04/07 15:21:02: INFO: Contestant #2 won: 667034 cars (66%).
2025/04/07 15:21:02: INFO: Monty won: 0 cars (0%).
2025/04/07 15:21:02: INFO: The contest ran for: 22 ms.

OBSERVATIONS:

We have returned to the result from scenario #2, even with Monty opening a door. This follows the same protocol
as is used in the gameshow.


SCENARIO #5 - ONE SMALL STEP.
-----------------------------

This scenario is an extension of scenario #4, before the result of a trial is determined and after Monty has opened a door
we allow contestant #1 to switch doors with contestant #2.

2025/04/07 15:21:02: INFO: Starting the contest, performing: 1000000 trials.
2025/04/07 15:21:02: INFO: The contest has ended with: 1000000 trials performed.
2025/04/07 15:21:02: INFO: The car was placed behind the first door: 333233 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the second door: 333224 times (33%).
2025/04/07 15:21:02: INFO: The car was placed behind the third door: 333543 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the first door: 333601 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the second door: 333598 times (33%).
2025/04/07 15:21:02: INFO: The first contestant guessed the car was behind the third door: 332801 times (33%).
2025/04/07 15:21:02: INFO: Contestant #1 won: 334248 cars (33%) by sticking to their original choice.
2025/04/07 15:21:02: INFO: Contestant #2 won: 665752 cars (66%) by sticking with their original allocation.
2025/04/07 15:21:02: INFO: Contestant #1 won: 665752 cars (66%) by switching from their original choice.
2025/04/07 15:21:02: INFO: Contestant #2 won: 334248 cars (33%) by switching from their original allocation.
2025/04/07 15:21:02: INFO: Monty won: 0 cars (0%).
2025/04/07 15:21:02: INFO: The contest ran for: 24 ms.

OBSERVATIONS:

We have demonstrated the correctness of choosing to switch, using exactly the same protocol as is used in the gameshow.
Observe that contestant #2 has no agency, acting only as a placeholder for ownership of the doors not selected by Contestant #1. 
So I think it is Quod Erat Demonstrandum folks, good night and thank you for watching!

2025/04/07 15:21:02: Monty Hall Problem (MHProb) Version: 1.0.0 build: 01 has completed normally.