An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
The Monty Hall problem
Suppose you're on a game show, and you're given the choice of three doors: aaa, bbb, and ccc. Behind one door is a car; behind the others, goats. You pick a door, say aaa, and the host, who knows what's behind the doors, opens another door, say bbb, which has a goat. He then says to you, "Do you want to pick door ccc?" Is it to your advantage to switch your choice?
What were the odds he would choose that door to open?
- If the car is in box aaa then he could open either bbb or ccc to reveal a goat. The probability is 1/21/21/2.
- If the car were in box bbb there's no way he would open bbb. The probability is 000.
- If the car is in box ccc then Monty would definitely open box bbb to reveal a goat. The probability is 111.
So what's the probability that the car is in box ccc given that he opened bbb?
Bayes' Theorem
P(AB)=P(BA)P(A)P(B)P(A|B)={P(B|A)P(A) \over P(B)}P(AB)=P(B)P(BA)P(A)
There are three possibilities for the denominator P(Openb)P(Open_b)P(Openb):
- Cara(OpenbCara)=1312=16Car_a (Open_b|Car_a)=\frac 1 3 \cdot \frac 1 2=\frac 1 6Cara(OpenbCara)=3121=61
- Carb(OpenbCarb)=130=0Car_b(Open_b|Car_b)=\frac 1 3 \cdot 0=0Carb(OpenbCarb)=310=0
- Carc(OpenbCarc)=131=13Car_c(Open_b|Car_c)=\frac 1 3 \cdot 1=\frac 1 3Carc(OpenbCarc)=311=31
so we'll add them up and plug them into our formula:
giving us a 2/32/32/3 probability that the car is in the other box and therefore you should switch.
Original Link: https://dev.to/santisbon/the-monty-hall-problem-28om
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To