Friday 5 June 2015

Mathematical Solution of Monty Hall Problem


Monty Hall problem is a brain teaser based on probability concept. It was first presented in the Television game show Let’s Make A Deal and named after its original host Monty Hall.

Problem: Suppose you’re on a game show and you’re given the choice of three doors. Behind one door is a car, behind others, goats. You pick a door, say no.1 and the host, who knows what’s behind the doors, opens another door, say no.3 which has a goat. He then says to you,”Do you want to pick the door no.2?” Is it your advantage to switch your choice?

slide-31.jpg
Picture courtesy: Business Insider


Assumptions: For this problem certain assumptions are needed. Many people get confused in this problem because they are not provided with assumptions.
  1. The host must always open a door that was not picked by the contestant.
  2. Monty always opens the door that has goat on it. Many people think Monty always chooses the third or fixed door.
  3. The host must always offer the chance to switch between the originally chosen door and the remaining closed door.

Many may think that it is not big deal either we switch or not. Switching or not switching our choice doesn’t affect our probability of getting car. But the fact is different. Switching our choice will be beneficial to us. In fact it is experimentally proved that switching has more chance to get you the car. If you still don’t believe, do this experiment yourself and observe.

When I first encountered this problem, I also thought switching gives you advantage does not have good logical reasoning. But when I experimented it, I got that switching has a real advantage. I searched all over the internet about its solution and explanation. Dozens of explanation articles by data scientists, computer scientists and mathematician did not make me understand it intuitively. I tried to solve it mathematically but I failed. The moment I saw an article about mathematical proof of this problem I was excited and tried to understand it but my mind did not work at that time.

This question was really irritating my mind and I was exhausted. After an hour of playing cricket, I was like fresh and decided to understand and solve it mathematically. It took not more than ten minutes when I finally understood it and got its mathematical solution. I am presenting the same solution here thinking it would help anyone who wanted to understand it.


Mathematical Solution:

Here, I make use of conditional probability and Bayes' Theorem. If you are ignorant about conditional probability and Bayes’ theorem learn it first here:

If you feel Bayes’ theorem and conditional probability intimidating I am giving another simple solution down. But if you really love mathematics doing it by conditional probability is interesting.

Okay, now let’s go for the solution:

The car can be in any doors: 1, 2 and 3. Let P(C1), P(C2) and P(C3) denote probability of car being in door 1, 2 and 3 respectively.
Then, P(C1) = P(C2) = P(C3) = 1/3

Here, it has specified that after you picked door 1, he opened up the door 3 and showed goat.
We denote probability of picking door 3 if car was in door x as P(3|Cx).

If car was in door 1, he would have probability of picking door 3 = 1/2 because of the two options available i.e. door 2 and door 3.
So, P(3|C1)= 1/2
If car was in door 2, he won’t show door 2 because it would be against our assumptions. Door 1 was picked by you. So, probability of picking door 3 by him P(3|C2) = 1.
Now, if car was in door 3, he won’t pick door 3. So, probability of picking door 3 is:
P(3|C3) = 0.

Now, probability of picking door 3 by host,
P(3) = P(C1)*P(3|C1) + P(C2)*P(3|C2) + P(C3)*P(3|C3)
       =1/3*1/2 + 1/3 *1 + 1/3 *0
       =1/6 + 1/3
       =1/2

Now, let’s see picking which door has more probability to get the car by using Bayes' theorem.

Probability of getting car by staying in door 1:
P(C1|3) = [P(C1)*P(3|C1)]/P(3) = (1/3 *1/2)/(1/2) = 1/3 = 33.33% probability
And,
Probability of getting car by switching to door 2:
P(C2|3) = [P(C2)*P(3|C2)]/P(3) = (1/3*1)/(1/2)  = 2/3 = 66.67% probability

Since, P(C2|3) is double of P(C1|3), switching will give you double chance of picking the car.


If you didn’t get this solution well, then here is another for you:

We denote here probability of car being in door 1, door 2 and door 3 by P(C1), P(C2) and P(C3) respectively.

We know,
C1 U C1c = U
So, P(C1) + P(C1c) = 1

You chose door 1. So, you have probability of getting car, P(C1) = 1/3.
So, probability of the car being in other doors than 1 is:
P(C1c) = 1 - P(C1) = 1 - 1/3= 2/3
Here,
P(C1c) = P(C2 U C3)

Since, C1 and C2 are mutually exclusive cases,
P(C1c) = P(C2) + P(C3)

The game show host shows goat in door 3. So, P(C3) = 0
Then P(C1c) = P(C2) = 2/3
Hence, you have double chance of getting car if you switch to another door.


Now, I will show experimental verification of this problem. The three possible arrangements can be:
C G G
door 1      door 2     door 3  

G G C 
door 1      door 2     door 3 

G C G
door 1      door 2     door 3         

In first door, only one time it has car out of three times. But if you switch, we can see we will find car two out of three times(once in door 3 and once in door 2).

Hence,solution of Monty Hall problem is proved experimentally too.

Thank you for reading this.
I hope you enjoyed and understood it well. If you find any errors here or confused about something please comment in below section.

No comments :

Post a Comment