Friday, July 20, 2018

Solving the Monty Hall problem using Bayesian inference

The month hall problem is one of my favourites. I came accross How to solve the Monty Hall problem using Bayesian inference, which used my other favourite topic, Bayesian inference. My only criticisim of the post is that P(E) is a little confusing. The following formulation with separate P(B*) and P(C*) notation suits me better:

P(B*) = Probability that Monty will open door B (given that the user has choosen door A) = 1/2

P(C*) = Probability that Monty will open door C (given that the user has choosen door A) = 1/2

P(C*/B) = Probability that Monty will open door C (given that the user has choosen door A and car is behind door B) = 1/1

P(C*/A) = Probability that Monty will open door C (given that the user has choosen door A and car is behind door A) = 1/2

P(B*/C) = Probability that Monty will open door B (given that the user has choosen door A and car is behind door C) = 1/1

P(A/B*) = Probability that the car is behind door A, given that Monty has opened door B = P(B*/A) * P(A) / P(B*) = 1/2 * 1/3 * 1/2 = 1/3

P(C/B*) = Probability that the car is behind door C, given that Monty has opened door B = P(B*/C) * P(C) / P(B*) = 1/1 * 1/3 * 1/2 = 2/3

P(A/C*) = Probability that the car is behind door A, given that Monty has opened door C = P(C*/A) * P(A) / P(C*) = 1/2 * 1/3 * 1/2 = 1/3

P(B/C*) = Probability that the car is behind door B, given that Monty has opened door C = P(C*/B) * P(B) / P(C*) = 1/1 * 1/3 * 1/2 = 2/3

As you can see, it is two times better to switch doors, i.e. if Monty has opened door B, switch to door C. If Monty has opened door C, switch to door B.

Interesting variation of this problem [Think Bayes, p.10]: What if Monty always chooses door B when B does not have a car behind?

No comments: