Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 25, 2023 06:25 am GMT

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?

Image description

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)
P(CarcOpenb)=P(OpenbCarc)P(Carc)P(Openb)P(Car_c|Open_b)={P(Open_b|Car_c)P(Car_c) \over P(Open_b)}P(CarcOpenb)=P(Openb)P(OpenbCarc)P(Carc)

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:

P(CarcOpenb)=11316+13=1312=23P(Car_c|Open_b)={1 \cdot \frac 1 3 \over \frac 1 6+\frac 1 3}={\frac 1 3 \over \frac 1 2}={\frac 2 3}P(CarcOpenb)=61+31131=2131=32

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

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To