Why doesn't the solution to the Monty Hall problem make sense?

  • Thread starter r0bHadz
  • Start date
  • Tags
    Monty hall
In summary, the probability of picking the car in the Monty Hall problem remains the same even after the host opens a door, as long as the host knows where the car is and never accidentally reveals it. This is because the probability is relative frequency, and by simulating the experiment a large number of times, it can be estimated that the probability does not change. The controversy surrounding this problem is due to a lack of understanding of probabilities by the general public. In the actual scenario of the show, where the host knows the location of the car, the probability of picking the car changes to 1% after the host opens 98 doors, leaving only two doors. However, this is not the case if the host opens a door by luck
  • #71
stevendaryl said:
Yes, and that principle does not give you a unique answer to the question "What is the probability that a man has two boys, given that he says that he has two children, at least one boy?"
That does not follow from the principle of indistinguishability. Don't you agree that it is possible that someone prefers boys? Or that they would like to have one of each? Assuming that every time a baby is born, it is equally likely to be a boy or a girl does not imply that Pr(2 boys)=Pr(2 girls)=2*Pr(1 each).

What you're doing is making up additional (reasonable, but additional) assumptions.
"What is the probability that a man has two boys, given that he says that he has two children, at least one boy?"

A non-exhaustive list of what I think are reasonable assumptions not explicit in the problem statement is as follows:
1. the man is not lying or mistaken about the number or gender of his children.
2. When the man says he has 2 children he means exactly 2 (not more than 2).
3. There are exactly 2 genders of children: boys and girls.
4. The independent gender probability is 1/2 for each gender for any child the gender of which is not disclosed.
5. The man did not do anything to bias the likelihood of either gender.
6. The gender distribution between his 2 children did not determine or influence whether he said or did not say something about it.

If we ask the man, "why did you say 'at least one of them', instead of saying 'one of them'?", and he replies "because the 2nd of them isn't born yet, and I won't know whether it's a boy or not until the birth happens."

At that point, the problem is the same as it would be if the man had said "at least one of them, the older one, is a boy", and the correct answer to the question "what is the probability that both children are boys?" would be 1/2.

If, however, in answer to our question, he said "I only wanted to disclose that they weren't both girls", that would mean that there were 3 remaining possibilities for the gender distribution over his children, one of which is both boys, and 2 of which are 1 of each, and the correct answer to the question "what is the probability that both children are boys?" would be 1/3.
stevendaryl said:
I'm actually not sure if there is a clear distinction between (A) applying the principle of indifference and (B) making auxiliary assumptions in order to solve a problem.
I think it's reasonable to say that (A) is an instance of (B).
 
Physics news on Phys.org
  • #72
stockzahn said:
In the scenario you described you can start the game with just two doors left, since the host opens one empty door before you even chose one. He could have done that before you enter the room and it wouldn't change anything, so in your described scenario the chance of getting the car should be 50-50. The original problem is based on the assumption that you have to choose one door before the host opens an empty one:

1. Choose a door
2. The host opens an empty door
3. You have to decide if you switch to third door or stick with your initial choice

In that case you can choose one of three doors: the car door ##C## or one of the empty doors ##E1##, ##E2## - each of the choices is made with the same probability:

1 x 1/3) You choose ##E1 \rightarrow## the host opens ##E2\rightarrow## change = win, stick = lose
1 x 1/3) You choose ##E2 \rightarrow## the host opens ##E1\rightarrow## change = win, stick = lose
1 x 1/3) You choose ##C \rightarrow## the host opens an empty door ##\rightarrow## change = lose, stick = win

In two thirds of your initial choices changing leeds two winning the car, in one third you lose. Therefore you should change.

Your answer includes a dangerous and misleading compression of data. If you happen to choose the door with the car behind it, then there are two scenarios for the door that is opened, not one. Monty can choose either door without a car - there isn't just one door for him to choose. If you chose one of the two wrong doors then Monty opens the other wrong door, but there are two configurations for this as well.

Choice Car Open Change
1______1_____2______Lose
1______1_____3______Lose
1______2_____3______Win
1______3_____2______Win

2______1_____3______Win
2______2_____3______Lose
2______2_____1______Lose
2______3_____2______Win

3______1_____2______Win
3______2_____1______Win
3______3_____1______Lose
3______3_____2______Lose

If you work through the full probability chart, then there are a total of 12 scenarios

Your odds of winning are 50/50. Thus sanity is restored to the world.
 
  • #73
Let's work this another way.

You choose a door, Monty opens another door (big surprise no car) and offers you the chance to change doors.

If the door you are offered has a 50% chance of having the car behind it, then the door you selected must also have a 50% chance of having the car behind it. The sum of probabilities is after all 100%.

If, as supposed by so many, the door you selected has a 1/3 (33.33%) chance of having the door behind it then the sum of probabilities is 83.33%. If you believe the door that was opened also had a 1/3 (33.33%) chance of having the car behind it, then the sum of probabilities is 116.66% which is also problematic.
 
  • #74
Eric Bretschneider said:
Your answer includes a dangerous and misleading compression of data. If you happen to choose the door with the car behind it, then there are two scenarios for the door that is opened, not one. Monty can choose either door without a car - there isn't just one door for him to choose. If you chose one of the two wrong doors then Monty opens the other wrong door, but there are two configurations for this as well.

Choice Car Open Change
1______1_____2______Lose
1______1_____3______Lose
1______2_____3______Win
1______3_____2______Win

2______1_____3______Win
2______2_____3______Lose
2______2_____1______Lose
2______3_____2______Win

3______1_____2______Win
3______2_____1______Win
3______3_____1______Lose
3______3_____2______Lose

If you work through the full probability chart, then there are a total of 12 scenarios

Your odds of winning are 50/50. Thus sanity is restored to the world.

Think about what you're saying. You think that switching or keeping your first choice gives you equal probability of winning: 50/50. So there is no reason, according to you, to switch. You might as well just always keep your first choice.

So now think about what you're saying. If you're always going to keep your first choice, then there is no reason to pay any attention to what Monty Hall says. Ignore him. If you ignore him, then you win if your first pick was the one that had the car. What are the odds that your first choice had a car behind it? Remember, there are three doors to choose from. And you think that choosing one at random gives you a 50/50 chance of picking the door with the car?
 
Last edited:
  • #75
stevendaryl said:
Think about what you're saying. You think that switching or keeping your first choice gives you equal probability of winning: 50/50. So there is no reason, according to you, to switch. You might as well just always keep your first choice.

So now think about what you're saying. If you're always going to keep your first choice, then there is no reason to pay any attention to what Monty Hall says. Ignore him. If you ignore him, then you win if your first pick was the one that had the car. What are the odds that your first choice had a car behind it? Remember, there are three doors to choose from. And you think that choosing one at random gives you a 50/50 chance of picking the door with the car?

That is the reason for my second post. If the door I am offered after one has already been opened has a 50/50 chance of having the car, then what is the sum of probabilities? Are you saying that the sum of probabilities doesn't have to be 100%?

When you say that Monty opens one door you and shows it to be empty, you are ignoring the fact that if you chose the correct door then he has two options and not just one.
 
  • #76
Eric Bretschneider said:
Let's work this another way.

You choose a door, Monty opens another door (big surprise no car) and offers you the chance to change doors.

If the door you are offered has a 50% chance of having the car behind it, then the door you selected must also have a 50% chance of having the car behind it. The sum of probabilities is after all 100%.

If, as supposed by so many, the door you selected has a 1/3 (33.33%) chance of having the door behind it then the sum of probabilities is 83.33%. If you believe the door that was opened also had a 1/3 (33.33%) chance of having the car behind it, then the sum of probabilities is 116.66% which is also problematic.

This is one of those things where it really isn't a matter of opinion. There is a correct answer and an incorrect answer, and yours is incorrect. One way to demonstrate that it's incorrect instead of using mathematics is to actually play the game a bunch of times, and see how often you win with the strategy of always switch.
 
  • #77
You are saying play the game, and not arguing about the probability matrix. Seems like a weak position.

So the whole probabilities add to 100% thing is bunk . . .
 
  • #78
Eric Bretschneider said:
That is the reason for my second post. If the door I am offered after one has already been opened has a 50/50 chance of having the car, then what is the sum of probabilities? Are you saying that the sum of probabilities doesn't have to be 100%?

When you say that Monty opens one door you and shows it to be empty, you are ignoring the fact that if you chose the correct door then he has two options and not just one.

Eric Bretschneider said:
You are saying play the game, and not arguing about the probability matrix.

Do you know what a Markov Chain is? I originally thought it was overkill, but I can show the correct result pretty easily with an (absorbing state) markov chain, including a nice little state diagram picture of what's going on. Note: the correct result contradicts your solution.

On the other hand, if you don't know what a Markov Chain is, that's ok -- but it's a sign that you shouldn't be arguing with people who do understand basic probability concepts.
 
  • #79
Eric Bretschneider said:
You are saying play the game, and not arguing about the probability matrix. Seems like a weak position.

I'm just asking you: Do you think that you will win half the time with the strategy of always keeping your first choice?

So the whole probabilities add to 100% thing is bunk . . .

Your analysis is bunk, yes. You are making the assumption that because there are 12 possibilities, that all 12 have to be equally likely. That is what's bunk.

The correct analysis is that there are 9 possibilities for the situation (x,y) where x is the location of the car (behind doors 1, 2, or 3) and y is the door you pick.
All 9 possibilities are equally likely (if everybody plays randomly). They are:
  1. (1,1)
  2. (1,2)
  3. (1,3)
  4. (2,1)
  5. (2,2)
  6. (2,3)
  7. (3,1)
  8. (3,2)
  9. (3,3)
The strategy of always switching wins in cases 2, 3, 4, 6, 7, 8. It loses in cases 1, 5, 9. That's the correct analysis.

Now, all of those possibilities have probability 1/9. Now, let's take possibility 1. It has two subcases:
1A: Monty opens door 2.
1B: Monty opens door 3.

The probabilities for those two subcases have to add up to the probability for case 1. They are equally likely. So we have:
P(1A) = P(1B) = 1/2 P(1)

Similarly, there are two subcases for 5 and 9.

So the complete probability matrix looks like this:

##\left( \begin{array} \\ choice & car & open & probability \\ 1 & 1 & 2 & \frac{1}{18} \\ 1 & 1 & 3 & \frac{1}{18} \\ 1 & 2 & 3 & \frac{1}{9} \\ 1 & 3 & 2 & \frac{1}{9}
\\ 2 & 1 & 3 & \frac{1}{9} \\ 2 & 2 & 1 & \frac{1}{18} \\ 2 & 2 & 3 & \frac{1}{18} \\ 2 & 3 & 1 & \frac{1}{9} \\ 3 & 1 & 2 & \frac{1}{9} \\ 3 & 2 & 1 & \frac{1}{9}
\\ 3 & 3 & 1 & \frac{1}{18} \\ 3 & 3 & 2 & \frac{1}{18} \end{array} \right)##

I think that all the probabilities add up to 1.
 
  • #80
So if the door I am offered has a 50% chance of having the car and the door I originally selected has a 33.3% chance of having the car you are OK with that?
Please tell me how the probability of winning does not add to 100%. Also show your chain, because unless the fundamentals of probability have changed, then the probability of all outcomes adds to 100%.

Pay attention to the information available as the game progresses. There may be a 1/3 chance of selecting the right door at the beginning of the game, but if one door is opened and two remain then the odds of the car being behind either remaining door are equal. Your argument that the chance of the remaining door hiding the car is 2/3 ignores that one door has been eliminated. If I chose the correct door then Monty has two doors to chose from. If I chose the wrong door then he has no choice.

I wrote a program to "play the game". (Actually I put it into an Excel spreadsheet since it makes it easy to plot as well.)

Assign a random number (1, 2, 3) to selection
Assign a random number (1, 2, 3) to car
Determine door to open (if selection = 1 and car = 1 then randomly assign 2 or 3, etc.)
If stay and selection = car then "win" else "loose"

10,000 iterations = 50.07% win
50,000 iteration = 49.73% win
 
  • #81
Eric Bretschneider said:
So if the door I am offered has a 50% chance of having the car and the door I originally selected has a 33.3% chance of having the car you are OK with that?

No, the chance of the remaining door having the car is 66.66%.
 
  • #82
Eric Bretschneider said:
Pay attention to the information available as the game progresses. There may be a 1/3 chance of selecting the right door at the beginning of the game

So, if you follow the strategy of "never switch", then it doesn't matter which door Monty opens. You're keeping your original choice. So whatever Monty does is irrelevant. Right? How could it be relevant if you never take him up on his offer to switch?

So how did your 1/3 chance turn into a 50% chance? How can Monty doing irrelevant things affect your probability of guessing the right door the first time?
 
  • Like
Likes DrClaude and FactChecker
  • #83
So the door I selected has a 1/3 chance of being correct, so did the door that was open and the door that remains.
Monty opens one door and my door still has the original 1/3 chance of being correct, but the other door has a 2/3 chance of being correct. That's one special door.

If my chance remains 1/3 and can't go to 50%, then how come Monty's offer goes from 1/3 to 2/3? Information theory has a problem here.

At the end of the game there are two doors. Monty eliminated one.

Feel free to write your own code. I can send the spreadsheet if you like.
 
  • #84
Eric Bretschneider said:
So the door I selected has a 1/3 chance of being correct, so did the door that was open and the door that remains.
Monty opens one door and my door still has the original 1/3 chance of being correct, but the other door has a 2/3 chance of being correct. That's one special door.

Yes, it's special because Monty knows where the car is. He NEVER opens the door with the car. That's important. If he randomly opened a door, not caring where the car was, and it just happened to be empty, than that would be different.

Suppose you always pick door number 1. Why not? They're all the same. Then you know that there is a 2/3 chance that you guessed wrong. That means that there is a 2/3 chance of one of the following happening:

1. The car is behind door number 3 and Monty opens door number 2.
2. The car is behind door number 2 and Monty opens door number 3.

Those are equally likely. So they have 1/3 chance each. So the probability that "Monty opens door number 2 and the car is behind door number 3" is 1/3. Right?

The way that probabilities adjust in light of new information is according to the following rule:

P(X | Y) = P(X and Y)/P(Y)

The probability of X given Y is the probability of X and Y divided by the probability of Y.

Let X be "the car is behind door number 3". Let Y be "Monty opens door number 2".

The probability of X and Y is 1/3, as we established above. What is the probability of Y?

If you always pick door number 1, then Monty will always either open door number 2 or door number 3. So there's a 50/50 chance that he will open either one. So the probability that Monty will open door number 2 is 50%. So P(Y) = 1/2

Now, using our formula:

P(X | Y) = P(X and Y)/P(Y) = (1/3)/(1/2) = 2/3.
 
  • #85
Eric Bretschneider said:
If my chance remains 1/3 and can't go to 50%, then how come Monty's offer goes from 1/3 to 2/3? Information theory has a problem here.

Do you agree that your chance can't possibly go to 50%? Suppose you always choose door number 1 (why not? they're all the same). And, since you think there is no reason to switch, let's suppose that you always keep door number 1. Then you think that half the time, you'll be right, that the car is behind door number 1?
 
  • #86
Eric Bretschneider said:
So the door I selected has a 1/3 chance of being correct, so did the door that was open and the door that remains.
Monty opens one door and my door still has the original 1/3 chance of being correct, but the other door has a 2/3 chance of being correct. That's one special door.

If my chance remains 1/3 and can't go to 50%, then how come Monty's offer goes from 1/3 to 2/3? Information theory has a problem here.

At the end of the game there are two doors. Monty eliminated one.

Feel free to write your own code. I can send the spreadsheet if you like.
Your probability calculations are wrong and your simulation is wrong. @stevendaryl has been asking a very basic question that I don't think you have directly answered: If you never switch, then everything Monte does is irrelevant, so how can you claim that your probability increases from 1/3 to 1/2?
 
  • #87
Eric Bretschneider said:
You are saying play the game, and not arguing about the probability matrix. Seems like a weak position.
Trying it out, in a way that you recognize as a valid equivalent of the problem, is one way for you to overcome your initial resistance to recognizing the correct answer to be correct. Doing the probability analysis is easier for some people than for others. You can find many simulations from trustworthy sources by searching on "monty hall simulation" or similar terms.
So the whole probabilities add to 100% thing is bunk . . .
I estimate that there's at least a 2/3 chance that you're trying to be sarcastic here.
Eric Bretschneider said:
So if the door I am offered has a 50% chance of having the car and the door I originally selected has a 33.3% chance of having the car you are OK with that?
Please tell me how the probability of winning does not add to 100%. Also show your chain, because unless the fundamentals of probability have changed, then the probability of all outcomes adds to 100%.

Pay attention to the information available as the game progresses. There may be a 1/3 chance of selecting the right door at the beginning of the game, but if one door is opened and two remain then the odds of the car being behind either remaining door are equal. Your argument that the chance of the remaining door hiding the car is 2/3 ignores that one door has been eliminated. If I chose the correct door then Monty has two doors to chose from. If I chose the wrong door then he has no choice.

I wrote a program to "play the game". (Actually I put it into an Excel spreadsheet since it makes it easy to plot as well.)

Assign a random number (1, 2, 3) to selection
Assign a random number (1, 2, 3) to car
Determine door to open (if selection = 1 and car = 1 then randomly assign 2 or 3, etc.)
If stay and selection = car then "win" else "loose"

10,000 iterations = 50.07% win
50,000 iteration = 49.73% win
Unless you're playing the "Monty doesn't know where the car is" version of the game, and disregarding the cases in which Monty reveals the car, a correct simulation doesn't result in a 50% probability of winning regardless of whether the contestant switches.
No I don't agree, because Monty's choice isn't random, unless I chose the correct door.

If I choose the wrong door then Monty has no choice on which door to open and if I change I win. If I choose the correct door then he has a 50% chance of choosing either remaining door, but my changing results in a loss.
That matters only if the opening of the door, or something else, somehow discloses to the contestant whether Monty had 2 doors to choose from or only 1 door. The contrary of that is an operative assumption in the now-standard version of the game. In the now-standard version of the game, the doors not originally chosen have a 2/3 chance of having the car behind them, including after 1 of them has been opened.
Eric Bretschneider said:
Because ignoring Monty changes the situation entirely - it becomes a different game. My choice is random, Monty's isn't so you can't apply the normal rules of probability to him.
That's an insufficient representation to justify your 50-50 scenario.
I am still waiting for you to refute my "experimental" result. Run your own code.View attachment 238927
At n = 500,000 I get a win probability = 50.0148%
Any code that produces such a result is not correctly simulating the now-standard version of the game.
Respectfully you haven't written your own simulation code and neither has anyone else (at least not that they have admitted) I wrote mine three times in FORTRAN, C++ and VBA (4 times if you count Excel as separate from VBA).
Please post your code then. The output you posted is of no probative value without the code. Please post the program or Excel formula you used to generate the output.
Of course my PC has an Intel CPU, so maybe they never really fixed their problems from the days of the original Pentium CPU.
A Pentium CPU is an Intel CPU.
It's not simply a matter of choosing one door at random out of three. That's my point. It's choosing one door at random out of three and then eliminating one door from consideration in a non-random manner. Probability doesn't apply equally in all scenarios.
Again, that's an insufficient representation to justify your 50-50 scenario.

If this program is not imaginary or hypothetical, it's an incorrect simulation, and if you'll please show your code, I'll be glad to point out at least one error in it.

Here's a correct simulation (in Javascript, so you can copy it, paste it into an html file, and run it in your browser -- you can right-click, select Inspect, and see the results in the console) that simulates playing the game 10,000 times (you can change that number in the first line), copied from https://rosettacode.org/wiki/Monty_Hall_problem#Basic_Solution

That site has correct simulations for the now-standard version of the Monty Hall problem written in 80 different computer languages. There's no Excel version there at present, and you can presumably post yours there if you actually have one and you care to do so, but if it's incorrect, it will be corrected or removed.
JavaScript:
var totalGames = 10000,
    selectDoor = function () {
    return Math.floor(Math.random() * 3); // Choose a number from 0, 1 and 2.
    },
    games = (function () {
    var i = 0, games = [];
 
    for (; i < totalGames; ++i) {
        games.push(selectDoor()); // Pick a door which will hide the prize.
    }
 
    return games;
    }()),
    play = function (switchDoor) {
    var i = 0, j = games.length, winningDoor, randomGuess, totalTimesWon = 0;
 
    for (; i < j; ++i) {
        winningDoor = games[i];
        randomGuess = selectDoor();
        if ((randomGuess === winningDoor && !switchDoor) ||
        (randomGuess !== winningDoor && switchDoor))
        {
        /*
         * If I initially guessed the winning door and didn't switch,
         * or if I initially guessed a losing door but then switched,
         * I've won.
         *
         * I lose when I initially guess the winning door and then switch,
         * or initially guess a losing door and don't switch.
         */
 
        totalTimesWon++;
        }
    }
    return totalTimesWon;
    };
 
/*
* Start the simulation
*/
 
console.log("Playing " + totalGames + " games");
console.log("Wins when not switching door", play(false));
console.log("Wins when switching door", play(true));
Output:

Playing 10000 games
Wins when not switching door 3326
Wins when switching door 6630
If you read the code, you might notice that it doesn't actually simulate the part about Monty revealing what's behind 1 of the doors, that part being of no consequence to the probability distribution, and instead employs the expedient of simply counting wins on not switching and on switching, based on the 1/3 to 2/3 probability as returned by the random function.

Some might call that an illegitimate shortcut, but the simulations that graphically display the opening of one of the doors, or that correctly generate the individual probabilities of each of the possible outcomes and correctly sum them, will produce the same results.

The part of the code that checks for wins is:
Code:
if ((randomGuess === winningDoor && !switchDoor) ||
        (randomGuess !== winningDoor && switchDoor))
In ordinary English, that means: if, by 1/3 chance, the contestant's originally chosen door is the winning door, and he doesn't switch, or, by 2/3 chance, the contestant's originally chosen door is not the winning door, and he does switch, he wins.

The 2nd comment after that point in the code says that the contestant loses if he originally picked the wrong door and doesn't switch, or originally picked the correct door and does switch. I edited the 2nd condition into the comment, because it had incorrectly been excluded as a losing condition in the pre-edited version, which had expressly specified the first condition as the only losing condition. I didn't write any of that code. The code itself actually individually counts and reports only wins.

Here's a Fortran version, also from rosettacode:
https://rosettacode.org/wiki/Monty_Hall_problem#Fortran
This version bothers to include Monty deciding which door to open.
Fortran:
PROGRAM MONTYHALL
 
  IMPLICIT NONE
 
  INTEGER, PARAMETER :: trials = 10000
  INTEGER :: i, choice, prize, remaining, show, staycount = 0, switchcount = 0
  LOGICAL :: door(3)
  REAL :: rnum
 
  CALL RANDOM_SEED
  DO i = 1, trials
     door = .FALSE.
     CALL RANDOM_NUMBER(rnum)
     prize = INT(3*rnum) + 1
     door(prize) = .TRUE.              ! place car behind random door
 
     CALL RANDOM_NUMBER(rnum)
     choice = INT(3*rnum) + 1          ! choose a door
 
     DO
        CALL RANDOM_NUMBER(rnum)
        show = INT(3*rnum) + 1
        IF (show /= choice .AND. show /= prize) EXIT       ! Reveal a goat
     END DO
 
     SELECT CASE(choice+show)          ! Calculate remaining door index
       CASE(3)
          remaining = 3
       CASE(4)
          remaining = 2
       CASE(5)
          remaining = 1
     END SELECT
 
     IF (door(choice)) THEN           ! You win by staying with your original choice
        staycount = staycount + 1
     ELSE IF (door(remaining)) THEN   ! You win by switching to other door
        switchcount = switchcount + 1
     END IF
 
  END DO
 
  WRITE(*, "(A,F6.2,A)") "Chance of winning by not switching is", real(staycount)/trials*100, "%"
  WRITE(*, "(A,F6.2,A)") "Chance of winning by switching is", real(switchcount)/trials*100, "%"
 
END PROGRAM MONTYHALL
Sample Output

Chance of winning by not switching is 32.82%
Chance of winning by switching is 67.18%
The part of that code that emulates Monty choosing and opening a door is this:
Fortran:
DO
   CALL RANDOM_NUMBER(rnum)
   show = INT(3*rnum) + 1
   IF (show /= choice .AND. show /= prize) EXIT       ! Reveal a goat
END DO
You can see that the random function is called again for Monty's choice, and that the DO loop does an EXIT when the number produced by that function call is that of a non-prohibited door.

The following code example, also from rosettacode.org, and located at https://rosettacode.org/wiki/Monty_Hall_problem#ALGOL_68
is written in Algol 68, which, as the name of the language suggests, could run on computers from 1968, when Let's Make A Deal was in its 5th year on the air.

The program not only faithfully reflects Monty randomly making a legal choice between 2 doors if he has one, and selecting the only legal door to open if he doesn't, and opening the selected door; it also shows the result of a 3rd strategy for the contestant, other than always switch (2/3 wins) or never switch (1/3 wins): randomly choose whether to switch or not; that strategy results in 1/2(1/3) + 1/2(2/3) = 1/2 wins, which should surprise no-one, including those who already incorrectly suppose that there is no advantage or disadvantage to the other 2 strategies.
Code:
INT trials=100 000;
 
PROC brand = (INT n)INT: 1 + ENTIER (n * random);
 
PROC percent = (REAL x)STRING: fixed(100.0*x/trials,0,2)+"%";
 
main:
(
  INT prize, choice, show, not shown, new choice;
  INT stay winning:=0, change winning:=0, random winning:=0;
  INT doors = 3;
  [doors-1]INT other door;
 
  TO trials DO
     # put the prize somewhere #
     prize := brand(doors);
     # let the user choose a door #
     choice := brand(doors);
     # let us take a list of unchoosen doors #
     INT k := LWB other door;
     FOR j TO doors DO
        IF j/=choice THEN other door[k] := j; k+:=1 FI
     OD;
     # Monty opens one... #
     IF choice = prize THEN
     # staying the user will win... Monty opens a random port#
       show := other door[ brand(doors - 1) ];
       not shown := other door[ (show+1) MOD (doors - 1 ) + 1]
     ELSE # no random, Monty can open just one door... #
       IF other door[1] = prize THEN
           show := other door[2];
           not shown := other door[1]
       ELSE
           show := other door[1];
           not shown := other door[2]
       FI
     FI;
 
     # the user randomly choose one of the two closed doors
        (one is his/her previous choice, the second is the
        one not shown ) #
     other door[1] := choice;
     other door[2] := not shown;
     new choice := other door[ brand(doors - 1) ];
     # now let us count if it takes it or not #
     IF choice = prize THEN stay winning+:=1 FI;
     IF not shown = prize THEN change winning+:=1 FI;
     IF new choice = prize THEN random winning+:=1 FI
  OD;
 
  print(("Staying: ", percent(stay winning), new line ));
  print(("Changing: ", percent(change winning), new line ));
  print(("New random choice: ", percent(random winning), new line ))
)
Sample output:

Staying: 33.62%
Changing: 66.38%
New random choice: 50.17%
Even if you don't specifically know Algol, the code is straightforward enough and well-commented enough that you should be able to see well enough what it's doing.
 
Last edited:
  • Like
Likes FactChecker
  • #88
We know that Monte had the opportunity of opening the unpicked door that he did not open. There is a good chance that he did that because that door had the prize. The same can not be said of the door that you picked. He is not allowed to open your door. Therefore, we should not expect the probabilities of the two doors to remain equal. Your door's probability remains at 1/3 and the other door's probability increases to 2/3. It's as simple as that.
 
  • #89
Eric Bretschneider said:
So the door I selected has a 1/3 chance of being correct, so did the door that was open and the door that remains.
Monty opens one door and my door still has the original 1/3 chance of being correct, but the other door has a 2/3 chance of being correct. That's one special door.

If my chance remains 1/3 and can't go to 50%, then how come Monty's offer goes from 1/3 to 2/3? Information theory has a problem here.

At the end of the game there are two doors. Monty eliminated one.

Feel free to write your own code. I can send the spreadsheet if you like.

Eric, what about this? The car is randomly behind doors 1, 2 and 3 with equal probability. Your strategy is to pick door 1 and stick with door 1. You play the game 50000 times and you win 25000 times. So, the car was really behind door 1 50% of the time?

Meanwhile, another friend has a strategy to pick door 2 and stick with door 2. He/she also wins 50% of the time?

And, a third friend picks door 3 and sticks with door 3 and he/she also wins 50% of the time?

Or, to put it another way. Let's assume that the car is behind door 2. Only one of those three players can win. The one whose strategy is door #2. The other two players cannot possibly win. If the car is behind door #2 you cannot possibly win by picking door #1 and sticking with door #1. Similarly, if the car is behind door #3, you cannot possibly win by picking door #1 and sticking with door #1.

It's clear, therefore, that sticking with door #1 wins precisely 1/3 of games, as it must.

As others have said, your spreadsheet must have a mistake in it.
 
  • Like
Likes FactChecker, stevendaryl and sysprog
  • #90
Since we've completely covered every possible aspect of this problem and the Donkey behind door #2 is getting mighty ornery, I think it's time to close this thread and thank everyone for their fine contributions.



For further information on the theory and practice of not being the donkey or deer who selects the human behind door #2, please refer to these articles:

https://www.realclearscience.com/articles/2013/06/14/how_to_avoid_the_goat_behind_door_2_106562.html

https://betterexplained.com/articles/understanding-the-monty-hall-problem/

https://en.wikipedia.org/wiki/Monty_Hall_problem

and remember even Paul Erdos had a problem with this before a computer simulation convinced him otherwise and that Monty Hall was the real winner in every case (https://en.wikipedia.org/wiki/Monty_Hall)

Cheers,
Jedi
 

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
907
  • Set Theory, Logic, Probability, Statistics
7
Replies
212
Views
11K
  • Engineering and Comp Sci Homework Help
Replies
15
Views
1K
Replies
12
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
21
Views
13K
  • Set Theory, Logic, Probability, Statistics
Replies
19
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
19
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
3K
Back
Top