Talk:Monty Hall problem/Arguments: Difference between revisions
Line 181: | Line 181: | ||
If we don't do exactly what the pseudo-code does we don't fit the description of the Monty Hall Problem but rather a situation where we're doing math for before |
If we don't do exactly what the pseudo-code does we don't fit the description of the Monty Hall Problem but rather a situation where we're doing math for before the host opens a goat door but after the host has announced the door has a goat behind it. |
Revision as of 03:07, 28 June 2020
This page is for mathematical arguments concerning the Monty Hall problem. Previous discussions have been archived from the main talk page, which is now reserved for editorial discussions. |
Please stay calm and civil while commenting or presenting evidence, and do not make personal attacks. Be patient when approaching solutions to any issues. If consensus is not reached, other solutions exist to draw attention and ensure that more editors mediate or comment on the dispute. |
|
|||||||||||||||
This page has archives. Sections older than 20 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Reductio ad Absurdum of the "vos Savant" Solution
Your first choice had a 1/3 probability of being a car, as did the other two doors. If you continue to say that it has a 1/3 probability, after the host's intervention, then you must say that the remaining unopened door still has a 1/3 probability of being a car, which is clearly absurd.
What has happened is that the host has introduced new information by opening a door, so the original logic tree must be modified or restarted from scratch. Nigelrg (talk) 21:14, 15 May 2017 (UTC)
- Indeed, once the host has opened another door to reveal a goat, then the only chance to win the car is a 50-50 choice to stay or switch to other door, as probability 0.5 either way. Conversely, some people claim Monty Hall would show the car if behind the first door chosen; otherwise the car would be behind the other door, as 100% chance of winning car by switching door (not merely 2⁄3). Of course, such a game would be absurd; hence, the only sensible game would include the chance of the car behind first door chosen, as again 50% chance of win, whether stay or switch. There is no other sensible conclusion. -Wikid77 (talk) 03:27, 16 May 2017 (UTC)
- @Nigelrg: You are exactly correct. In fact, numerous mathematicians have described vos Savant's reasoning as somewhat less than complete (see https://en.wikipedia.org/wiki/Monty_Hall_problem#Criticism_of_the_simple_solutions). Before the host opens one of the doors, the probability the car is behind each door is 1/3. After the host opens one, the probabilities must now be reevaluated. We're certain the probability the car is behind the door the host opens is 0, but what about the other two?
- @Wikid77: Wikid77 - please pay attention to this.
- If the player picks door 1, and the car is behind door 2, then the host MUST open door 3, so the composite probability the car is behind door 2 AND the host opens door 3 is 1/3 * 1, i.e. 1/3.
- If the player picks door 1, and the car is behind door 1, then the host can open either door 2 or door 3. Let's say the host doesn't care which door he opens in this case (e.g. he flips a coin to decide). This makes the composite probability the car is behind door 1 AND the host opens door 3 equal to 1/3 * 1/2, i.e. 1/6.
- If the host opens door 3, these are the only two possibilities. To express these as conditional probabilities, we divide each by their sum. 1/3 + 1/6 = 1/2, so the conditional probability (given that the host has opened door 3) that the car is behind door 1 is 1/6 / 1/2 = 1/3. And the conditional probability (given that the host has opened door 3) that the car is behind door 2 is 1/3 / 1/2 = 2/3.
- As it turns out, the probability the car is behind door 1 doesn't change. But we really can't just assume that. We should compute the conditional probabilities. As one source puts it "The host can always open a door revealing a goat and the probability that the car is behind the initially chosen door does not change, but it is not because of the former that the latter is true." -- Rick Block (talk) 04:09, 16 May 2017 (UTC)
@ Rick Block. I believe that your analysis only holds true if the player has decided whether to stay or switch before the host opens the door. The first post of the first discussion thread makes this point, and the main article addresses it in some depth, as stated in the unidentified post above: https://en.wikipedia.org/wiki/Monty_Hall_problem#Criticism_of_the_simple_solutions. No such stipulation is made in the description of the game, so we should assume that the player makes his decision after the host opens the door. I prefer to use Occam's Razor, and cut out unnecessary detail. Because the player has no information about the location of the car, other than the fact that it's behind one of two closed doors, he/she has a simple 50:50 choice.Nigelrg (talk) 02:43, 18 May 2017 (UTC)
- @Nigelrg: First, the analysis I presented above is not "mine", but it is what the most reliable sources in the field of probability use. It most definitely does NOT hold true only if the player decides whether to stay or switch before the host opens the door. It evaluates the probabilities explicitly AFTER the host opens a door. Yes - you don't know for sure which of the two remaining doors the car is behind, but you have "partial" information. This partial information (the fact that the host MUST open door 3 if the car is behind door 2, but has a 50/50 choice which door to open if the car is behind door 1) is what lets you conclude that the chance of winning the car by switching (AFTER the host opens a door and there are only two doors remaining) is 2/3.
- Lets take this a bit further. Say we have a deck of 52 cards, and the ace of spades "wins". If I (the "host") shuffle the cards, give you one (face down), and now (looking at the rest) discard all but one making sure I'm not discarding the ace of spades is it now 50/50 that you have the ace of spades? Or is it 1/52 that you have it and 51/52 that I have it? There are only two choices - you have it or I have it. You don't know for sure which one it is. In case it's not obvious the analogy to the MHP is this - instead of putting a car behind one of 3 doors we're putting the ace of spades among 52 cards. Instead of the player picking a door, we're dealing a random card to you. Instead of the host opening one "losing" door resulting in only two doors being left - the host host is discarding 50 losing cards resulting in only two cards being left. Please try this (really, no kidding) - say 20 times and let us know how it turns out (how many times do you end up with the ace of spades vs. how many times does the host end up with it). The notion that "you don't know for sure" and "there are only two choices" necessarily leads to the chances being 50/50 is simply incorrect. This is the entire point of the Monty Hall problem. It goes against a deeply held belief. The bottom line is that humans suck at conditional probability (or, perhaps, schools suck at teaching elementary probability concepts). -- Rick Block (talk) 06:49, 18 May 2017 (UTC)
I'll think over your interesting post later. I had some further thoughts myself, but your post may have negated them. Re: your last sentence, it's not just schools in general. Your views are opposed by post-graduates in math from some of the world's better universities. They're not infallible, of course, but it's a bit like climate change. When a large body of experts say one thing, there's a high probability that they're right.Nigelrg (talk) 18:05, 18 May 2017 (UTC)
I'm dealing with your post piecemeal :-) The deck of cards example is only relevant to one option in the Monty Hall problem - the case in which the player has pre-decided to stick (once you've picked a card, you can't change it). Therefore I don't think it's relevant to the problem as a whole≈Nigelrg (talk) 20:05, 18 May 2017 (UTC)
- That's not right. In the formulation of the card game aboive, it does not preclude that the player could still switch cards with the dealer, turning around the probabilities of having the ace of spades. This would make the game equivalent to a Monty Hall game with 52 doors, where the host opens 50 doors which don't have the car, and the player can decide to switch or not after that. Diego (talk) 23:06, 18 May 2017 (UTC)
Re: "partial" information. I think you've neglected the situation when the car is behind door 3, so the host must open door 2. Therefore the host has 2 possible actions when the player's door hides the car, and only 1 possibility when it doesn't. Either way, the player gets new information. I came back to this post months later and corrected it. I made a typo/brain fade when I originally wrote it.I hope my correction didn't change any responses.≈Nigelrg (talk) 21:00, 18 May 2017 (UTC)Nigelrg (talk) 06:07, 11 November 2017 (UTC)
- My views are NOT oppposed by post graduates in math (well, not any in probability or statistics) anywhere in the world. This is a classic problem - it appears in many elementary probability textbooks (with the exact answers I'm giving you). So, yes, it's a little like climate change in that the science is settled. But this is math, so not only is the science settled it's actually proven.
- @Nigelrg:I thought you wanted to talk about a case where the host has already opened a door and there are only two possibilities for where the car is - for example, the player picked door 1 and then the host opened door 3. In this case the car is manifestly not behind door 3. I'm not 'neglecting" the situation where the car is behind door 3 - we're explicitly talking about only a subset of cases where the host has opened door 3, which means the car is not there.
- Here's yet another way to think about it. Imagine 300 shows where the player has initially picked door 1. We'd expect the car to be behind each door about 100 times (right?). So, now the host opens door 2 or door 3. If we want to think about only the shows where the host has opened door 3 we're not talking about 300 shows anymore - but only some subset of the entire 300. Can you answer the following questions (thinking about 300 shows where the player has picked door 1 and the car is behind each door 100 times)? -- Rick Block (talk) 14:58, 19 May 2017 (UTC)
- In how many of the shows where the car is behind door 1 does the host open door 2? ______
- In how many of the shows where the car is behind door 1 does the host open door 3? ______
- In how many of the shows where the car is behind door 2 does the host open door 2? ______
- In how many of the shows where the car is behind door 2 does the host open door 3? ______
- In how many of the shows where the car is behind door 3 does the host open door 2? ______
- In how many of the shows where the car is behind door 3 does the host open door 3? ______
- In how many shows overall does the host open door 2? ______
- In how many shows overall does the host open door 3? ______
- In how many shows where the host opens door 3 is the car behind door 1? ______
- In how many shows where the host opens door 3 is the car behind door 2? ______
- If you pick door 1 and the host then opens door 3, are you more or less likely to win the car if you switch?
- This is a good example, Rick. Answer: It is completely impossible that you ever can be less likely to win the car if you switch.
This is valid not only in that (given?) case if you pick door 1 and the host then opens door 3 (in order to show a goat), but this is valid in any case, regardless which door you may pick, and regardless which other door the host may be opening (in order to show a goat).Once more: You never are (nor can be) "less likely" by switching. This is valid in any situation given.
Your chance to have picked the car by luck is 1/3, so on average the risk to lose the car by switching is still 1/3, but
your chance to have picked one of the two goats (=wrong guess scenario) is 2/3, so on average the chance to win the car by switching doors is 2/3. And the host's opening of a door (to show you the SECOND goat) does not alter the scenario you're actually fixed in.
The chance to have picked the car by luck (lucky guess scenario) is only 1/3, and the chance that you are fixed in the wrong guess scenario, having picked a goat (thereafter the SECOND goat has already been shown to you !) consequently is even 2/3.
So in 2/3 of all cases you will win the car by swithing doors.As to the host's behavior, he will never give you any hint on the scenario you're actually (unchangingly) fixed in (Henze, Mladinow et al). --Gerhardvalentin (talk) 12:20, 20 May 2017 (UTC)
- Nigelrg seems to think that the analysis of the situation AFTER the host opens a door is that there are two doors and we don't know where the car is, so therefore (??) the chances are 50/50. The point is that the structure of the imaginary show (the real show wasn't actually run like this) gives us some information. -- Rick Block (talk) 15:50, 20 May 2017 (UTC)
- Some readers believe in miracles, may be. Or they forget about the significant progress of the advancement made in course of the imaginary "show". But reality never will. --Gerhardvalentin (talk) 17:02, 20 May 2017 (UTC)
- Nigelrg seems to think that the analysis of the situation AFTER the host opens a door is that there are two doors and we don't know where the car is, so therefore (??) the chances are 50/50. The point is that the structure of the imaginary show (the real show wasn't actually run like this) gives us some information. -- Rick Block (talk) 15:50, 20 May 2017 (UTC)
- This is a good example, Rick. Answer: It is completely impossible that you ever can be less likely to win the car if you switch.
- This post is very useful to settle the topic.[1] — Preceding unsigned comment added by 190.199.242.101 (talk) 23:15, 16 August 2017 (UTC)
- Thank you. IP190.199.242.101, for your compliment. --Gerhardvalentin (talk) 16:08, 25 April 2018 (UTC)
- Bottom line is that the idealised Monty's behaviour is precisely equivalent to his telling you, "If you have picked the wrong door, then the prize is HERE". And you had 2 chances in 3 of being wrong. What more needs saying? Fredd169 (talk) 13:12, 23 December 2017 (UTC)
Another way to think about this
If the aim were to find 1 of the 2 goats, instead of the car, but all other rules were the same, then what? The host must remove a goat - he cannot remove the car. Thus, the other door which remains must contain what? Either a goat or a car. If it contains a goat, you are already on a car. If it contains a car, you are already on a goat. When you first picked a door, you picked one door from a 2/3 chance of getting a goat. If you stay, staying with your first choice will win you a goat 2 times for every 3 times you play. But, since the host must remove a goat, if you choose again, you will only get a goat 1 time for every three switches. Why? Because 2 out of 3 times you are already on a goat after your first choice. Thus, you only can possibly switch to a goat 1 out of 3 times. Thus, finding the car is the opposite of this: 1 out of 3 first choices get you the car. And if you stay with that choice, you can't then put yourself into the remaining 2 out of 3 pool; because you are stuck at 1 out of 3. When you switch, you leave the 1 of 3 pool of choices and you switch to the 2 of 3 pool of choices. And the 2nd choice is indeed two of three; 3 doors, one chosen by you, one removed by the host (no car) and one which you leave behind when you switch. If you switch, in only 1 time out of 3 plays will you accidentally leave the car behind, because in only 1 out of 3 plays, will you have actually picked the car to begin with. The odds of switching improve over the original odds because the removal of the door by the host enriches the prevalence ratio of cars to the available remaining choices. There initially is 1 car in a pool of 3 doors, then there is 1 car in a pool of 2 doors, which means it looks like this: 1/3 (car prevalence of 1st choice) ÷ 1/2 (car prevalence of 2nd choice) = 2/3 if switch. Of course, this last sentence looks like Ma & Pa Kettle math [1] Xerton (talk) 18:26, 4 February 2018 (UTC)
There are ONLY 2 choices left: "Impossible"/Confusing to have a present x/3 statistic.
The fact is, when there are only 2 doors left to choose from, there are then ONLY 2 choices left; and it is therefore impossible to have an x/3 statistic among those at that point in time because you no longer have a choice of 3 but only of 2. Thus, the way some of the article is written is incredibly confusing for the 9/10 people who notice this clear and indisputable fact: There are only 2 choices left.
Seeing that even a famed mathematician thought similarly makes it clear that if you are going to use x/3 when you have left only 2 choices, then you'd better be crystal clear about the logic of application, which from reading much of the article isn't that convincing or clear; because using an x/3 stat when there are only 2 choices left makes little sense to most of us.
Also, placing that remaining x/2 likelihood back in time when the INITIAL chance was 1/3, and continuing to use x/3 makes little sense to most of us.
Saying anything new about x/3 when there are only 2 choices left makes little sense to most; so Why be so confusing with the math? we think. The fact is, the REMAINING chance has only 2 choices possible, and so therefore the remaining statistic MUST be in reference to that: It must be stated as x/2.
Hardly a clear justification was made in my reading of the most of the article for using x/3 at all, at the point where there were only 2 choices left. It is that justification that needs to be made, and clearly applied, which would help the hapless reader understand at least some of the gobbledygook; because otherwise, it continues to seem nonsensical. And after all, isn't this conundrum in particular one that needs to be crystal clear to the general reader who was mystified in the first place when reading the "Ask Marylin" article? Misty MH (talk) 23:55, 9 March 2018 (UTC)
- I hand you a die with 2 white sides and 4 black. You only have 2 choices. Roll it, what do you think your odds are if you choose white? — Preceding unsigned comment added by Nijdam (talk • contribs) 11:17, 10 March 2018 (UTC)
- The formula ---> (#favorable events / #possible events) is applicable only if you have the same information about the options. Remember the division distribute equal amounts. For example, if I have a cake and two persons and I want to give each one the same amount, then I should give 1/2 to each. But certainly that's not the only way to distribute it. I could give 4/5 to one and 1/5 to the other, or give all the cake only to one, etc.
The probability is a measure about how much information we have. The confusion is to think that the options must be equally likely in any case. In this game, yes, we have two options, but do we have reasons to distribute the probability equitably? No. The contestant's door was chosen randomly from three, meaning that it has 1/3 probability to be the correct. On the other hand, the host knows the positions and must leave the car hidden (because he must reveal a goat door), so always the contestant failed at first, the other door the host leaves closed is the correct one, and we know this is more likely to have happened than the opposite.
In the second selection, we don't have a random door vs another random door. Basically, you have an option selected by someone who hits the correct 1/3 of the time and another chosen by someone who chooses the correct in the other 2/3 cases. Which one do you prefer? The important thing here is nor how many options do you have, but that they were chosen by two different people, one with more knowledge than the other. The host's closed door tends to be the correct with more frequency than the contestant's selection. — Preceding unsigned comment added by 190.36.105.224 (talk) 05:28, 13 March 2018 (UTC)
- @Misty MH: I guess Leonard Mlodinow, in his book The Drunkard's Walk, shows it best, in underlining the neglected, but obviously constricted role of the host in the MHP. His role leads to conditional probabilities of surprising 1/3 : 2/3. About Mlodinow, Just have a look there.
It's hard for anyone to grasp that the host can act "randomly" only in 1/3 of all cases. He can act randomly only in 1/3, only in case that the guest (by luck) selected the door with the car (i.e. only if the guest actually is in the "lucky guess scenario").
Only in this special case (1/3) the guest should stay and never switch.But in 2/3 of cases the guest will be in the "wrong guess scenario" (2/3), having selected one of the two wrong doors (two out of three). Because in that "guest's wrong guess scenario", the host's two doors having the car and a goat resp. a goat and the car, the host nevermore can act randomly, because he never shows the car but the second goat only. So his selection which door to open, in openening always the door with the goat, leads to conditional probabilities. He keeps the secret car undisclosed behind his still closed second door. In that 2/3 switching wins the car for sure.
So in 2/3 of all cases, as a "conditional probability", switching doors helps the guest to get the car.
The contestant, in opening a door, does not know the scenario he actually is in. He only knows that - by the host's constraint to never showing the car - by switching he will win the car with double (conditional) probability. Admittedly, on the long run only.
I agree with you, this fact that in 2/3 the host will never act randomly leads to a conditional probability of 2/3 to win the car by switching is hard to tell, using a few words only. --Gerhardvalentin (talk) 15:15, 22 April 2018 (UTC)
- @Misty MH: I guess Leonard Mlodinow, in his book The Drunkard's Walk, shows it best, in underlining the neglected, but obviously constricted role of the host in the MHP. His role leads to conditional probabilities of surprising 1/3 : 2/3. About Mlodinow, Just have a look there.
- I read this as a criticism of the article, not the math. What Misty MH is saying is that the article is not clear, because it immediately delves into the "simple" solutions which more or less ignore the conundrum most people encounter which is that at the point of the decision there are only 2 doors involved, not 3. In particular, we know vos Savant's explanation from her original column is unconvincing based on the reader reaction she got. -- Rick Block (talk) 14:53, 23 April 2018 (UTC)
- Yes, you are right. As to my understanding, Misty MH says that the article should clearly show that any assemblage of both unselected (host's) two doors is more likely to contain the prize. Exactly they have probability of 2/3, compared to any originally selected door of only 1/3.
And it's a fact that the host AVOIDS to show the car, but in any case he shows a goat. Solely in the contestant's lucky guess scenario, the host actually having two goats, he can act randomly. But if the CONTESTANT SELECTED ONE OF THE TWO GOATS (with twice chance) the host avoids to show his car, the "strict condition" is that he will show the SECOND GOAT only. So the 2/3 chance to win by switching doors is a typically "conditional probability". It's that easy.
And the famous mathematician Henze says that strictly speaking "math" is unnecessary to solve the MHP. And also Misty MH says: Why be so confusing with the math?
I say once more: math is rather unnecessary to fully understand vos Savant's MHP. That means that the whole ado about the host's biased behaviour belongs to a completely different article, you can name it "Index of lessons on conditional probability theory, based on the famous MHP"
And Marilyn vos Savant says that only in case that you already do have additional information of a factual existing preference of the host, and its extension, it might be sensual to do maths. But this never will be the case in the MHP, so any of similar considerations do never address the MHP of vos Savant, that definitely excludes any "additional (hidden?) information". No hidden hints are given. Such assumptions have to live their own life completely outside of vos Savant's famous MHP paradox.
(Though mathematically fully correct, M.et al. have disqualified themselves, in inventing ungiven additional assumptions, far outside of vos Savant's MHP, similar to "if wishes were horses, beggars would ride" and similar to "if you know that the biased host is paralyzed, then ...").Any of such unbased considerations, only basing on ungiven and unproven assumptions (suitable for lessons in probability theory only), are obfuscating for the reader and prevent understanding the core of the famous paradox:
"Two still closed doors, why does the door offered have double chance, compared to the door originally selected?"
Answer: because there is'nt a new simple probability of 50:50, but because there meanwhile emerged a conditional probability of 1/3 : 2/3.See theoretical physicist Leonard Mlodinow, who worked together with Steven Hawking, his diagram (1/3 : 2/3 on the long run) here:
The article, for years and years, has been confusing. It is time to detoxify it from disconcerting, misleading and truthless "conditional bias" math garbage that clearly belongs to a different article.--Gerhardvalentin (talk) 09:55, 25 April 2018 (UTC)
- Yes, you are right. As to my understanding, Misty MH says that the article should clearly show that any assemblage of both unselected (host's) two doors is more likely to contain the prize. Exactly they have probability of 2/3, compared to any originally selected door of only 1/3.
@Rick Block EXACTLY! You said it much better than I did! :) — Preceding unsigned comment added by Misty MH (talk • contribs)
- With a small change to the game, you could be told that you could either have what's in the door you chose, or take what you want from the other two doors - in effect Monty did just that by showing you the door not to bother with - you'd rather swap to the 2/3, right? — Preceding unsigned comment added by Gomez2002 (talk • contribs) 16:07, 19 July 2019 (UTC)
Keep It Simple
If the contestant picks the car and switches, the contestant loses. The contestant has 1/3 chance of picking the car.
If the contestant picks the goat and switches, the contestant wins. The contestant has 2/3 chance of picking the goat.
The contestant doubles the chance of winning by switching.
JAKQ0s (talk) 16:59, 15 November 2018 (UTC)
- That's about how I think about it. If you know the host has some algorithm (e.g. always pick the right-most losing door), pick Door 1. If the host picks Door 2, the car is behind Door 3; otherwise the car may be behind Door 2 or Door 1. You have a 2/3 chance of winning at all times. If the selection is random, then you pick a door and the host opens all other doors except one, and never opens the winning door, in which case you have chance of having picked the correct door and a chance of having picked the wrong door, so with more than two doors switching has a large probability of winning. John Moser (talk) 15:38, 17 October 2019 (UTC)
93.106.123.184 (talk) 14:05, 27 May 2020 (UTC) The following question could use a simple answer: Why does sticking with the door you chose originally not count as a new choice in a new situation?
93.106.123.184 (talk) 14:05, 27 May 2020 (UTC)
Where did the article go?
Where did the article go? I clicked on the "Article" tab, and there was nothing. Misty MH (talk) 09:12, 21 March 2019 (UTC)
- Weird. I found it, I guess. It's like this is an orphaned Talk page. Is "/Arguments" a normal additional page to a regular Talk page? The article is here https://en.wikipedia.org/wiki/Monty_Hall_problem Misty MH (talk) 09:14, 21 March 2019 (UTC)
- @Misty MH: No, this isn't normal. Subpages for talk pages are normal for archives (which will present the same "missing" article tab; mainspace articles can't have subpages either), but not for actual discussion. This is an unusual case because of the nature of the article. See also Talk:0.999.../Arguments. –Deacon Vorbis (carbon • videos) 16:13, 17 October 2019 (UTC)
Law of large numbers disproves this
We have 3 doors.
1 with a car behind it and 2 with goats - Assumed randomly assigned
Contestant randomly selects door - Also assumed random
We have to assume that the host cannot pick the door with the car AND cannot pick the contestant's door but other than that they randomly pick an available goat door (ultimately meaningless as it'll always come down to prize door and a goat door)
So at this stage we have 4 possible states...
1. Contestant picked the right door. Host picks goat door A. Contestant chose correctly
2. Contestant picked the right door. Host picks goat door B. Contestant chose correctly.
3. Contestant picked goat door A. Host must pick goat door B. Contestant chose incorrectly.
4. Contestant picked goat door B. Host must pick goat door A. Contestant chose incorrectly.
Host opens a goat door...
At this point the host HAS opened a door and it's known to be a goat and the problem has completely changed. We're left with the new states of...
1. Contestant picked the right door. If they stay they win but if they swap they lose.
2. Contestant picked the goat door. If they stay they lose but if they swap they win.
This can be programmatically shown by this pseudo-code.
Randomly pick 1 of 3 doors to have the prize.
Randomly pick 1 of 3 doors to be the contestant's pick.
Randomly pick 1 of 3 doors to have the host pick a door to throw out. If it's the prize door or contestant's pick just randomly pick again until it's not.
If the prize door is the contestant's pick we add 1 to the win column. Else we add one to the lose column.
Run it for as long as you want, assuming 1 million+ times to be at least semiaccurate, then then unsurprisingly find out that the tally is approximately 50/50. It cannot be argued against because we did the entire Monty Carlo Scenario. We have a random prize door. We had a contestant pick a random door. We had the host pick a random goat door. We then compare if the contestant already picked the right door or not. If they always swap doors or not doesn't impact their chances of winning in the slightest.
If we don't do exactly what the pseudo-code does we don't fit the description of the Monty Hall Problem but rather a situation where we're doing math for before the host opens a goat door but after the host has announced the door has a goat behind it.