The Monty Hall problem is a well-known problem as a paradox of probability. In this article, I'll give you an intuitive explanation that doesn't rely on the most convincing formulas I've come up with.
[Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%A2%E3%83%B3%E3%83%86%E3%82%A3%E3%83%BB%E3%83 Quoted from% 9B% E3% 83% BC% E3% 83% AB% E5% 95% 8F% E9% A1% 8C)
There are three closed doors in front of the player, behind one door is a new prize car, and behind the two doors is a goat, which means off. Players can get a new car by hitting the door of the new car. After the player selects one door, the moderator Monty opens the remaining door with the goat and shows the goat. The player is now told that he may change the door of his choice to the remaining unopened door. Should the player change the door here?
Answer "The player should change the door, because the probability of winning if not changed is $ \ frac {1} {3} $, while the probability of winning if changed is $ \ frac {2} {3. } $. "
When the player first chooses one door, the odds of winning any door should be $ \ frac {1} {3} $. Why does that change after the moderator shows one out door?
To understand this, consider the following problem, which is similar to the Monty Hall problem.
In this case, everyone would choose the latter "two doors left". This is because the probability of hitting the former is $ \ frac {1} {3} $, while the latter is $ \ frac {2} {3} $.
The decisive difference between this problem and the Monty Hall problem is the presence or absence of the act of "showing one of the unselected doors that is out of the way." In the Monty Hall problem, this action establishes one of the "two remaining doors" with a zero probability of winning. To organize this,
--The probability of hitting "the remaining two doors" is $ \ frac {2} {3} $, --The probability of hitting one of the "two remaining doors" is confirmed to be 0
From the above, the probability that the last remaining unselected door will be a hit is $ \ frac {2} {3} $.
The odds of hitting any door should be the same. Therefore, if one door is confirmed, the probability that the remaining two doors will be won is $ \ frac {1} {2} $, respectively.
This idea is correct if the problem is as follows.
The decisive difference between this question and the Monty Hall problem is ** "whether the moderator can show the door the player is choosing" **. The Monty Hall problem does not allow the above. This difference doesn't matter if the player's selected door is a hit, but if it's a miss, it has a big impact. If the door selected by the player is out, the Monty Hall problem always discloses the other out door. On the other hand, in the above problem, which out-of-door is chosen is completely random, and no hint is given to hit the winning door.
The above is an intuitive explanation, but I think you can be convinced that the probability of hitting is not $ \ frac {1} {2} $ for the time being.
Here is an example of simulation using Python. We played the game 10,000 times and calculated the winning percentages when the door was changed and when it was not changed.
import random
random.seed(1)
doors = ["Hit", "Goat", "Goat"]
stay_wins, change_wins = 0, 0
#Repeat enough trials
loop = 10000
for _ in range(loop):
#Choose the door first
choose = random.choice(doors)
#Wins for the winner with or without changing the door+1
if choose == "Hit":
stay_wins += 1
else:
change_wins += 1
print("---Win rate---")
print(f"If you do not change the door: {stay_wins / loop}")
print(f"When changing the door: {change_wins / loop}")
Output result
---Win rate---
If you do not change the door: 0.3323
When changing the door: 0.6677
This is Qiita's first post. Any comments are welcome! !!