#Monty Hall Problem

1 messages · Page 1 of 1 (latest)

tulip solstice
#

I'm struggling to understand the choice of defining the events. For example if we define A_1="Car in door 1" A_2="Goat in Door 2" A_3="Goat in door 3". If I calculate it, it gives me the wrong answer (2/5). How do I know which ones are correct

frank zephyrBOT
#
  1. Do not ping the Moderators, unless someone is breaking the rules.
  2. Do not ping the Helper Moderators, unless there is a conflict between helpers.
  3. Do not ping other members randomly for help.
  4. Ask your question and show the work you've done so far. If you've posted a screenshot of a question, specify which part you need help with.
  5. Wait patiently for a helper to come along.
  6. If the Helper has answered your question, remember to thank them with the Mathematics Ranks bot and close the thread with:

+close
Feel free to nominate the person for helper of the week in #helper-nominations
If you're happy with the help you got here, and the server overall, you can contribute financially as well:

tulip solstice
#

$$P(A_1|A_2)=\frac{P(A_2|A_1)\cdot P(A_1)}{\sum P(A_2|A_j)\cdot P(A_j)}$$.

weary hatchBOT
tulip solstice
#

The probability of P(A_2|A_1) should be 1 since the car is already revealed to be in door 1

burnt rose
tulip solstice
burnt rose
tulip solstice
#

Okay so I set A_1="..." and so on

tulip solstice
# weary hatch **Tony**

Now P(A_2|A_1) should be equal to 1 cuz if I already know where the car is then there must be goats left in both of the doors

#

P(A_j)=1/3 no matter what j is

#

So P(A_j) cancels out with P(A_1)

#

Left is 1/sum(P(A_2|A_j))

#

P(A_2|A_1) is 1, P(A_2|A_2) is also 1 and P(A_2|A_3) is 1/2 since we have two doors left: either car or goat

#

1+1+1/2 is 5/2

#

1/(5/2) is 2/5

#

The right answer should be 1/3 tho

burnt rose
#

Okay, it feels like you confused yourself primarily by using this weird notation.

tulip solstice
#

May I know what do you mean?

tulip solstice
burnt rose
#

I mean that A_1 means "the money is behind door 1", but A_2 means "a goat is behind door 2".

tulip solstice
#

Hmm okay

#

Oh wait shi

burnt rose
#

Also, you're conditioning on the wrong event.

tulip solstice
#

Can you elaborate?

#

Englisch is my second language sryyy

burnt rose
#

Okay, do you understand the word "conditioning" here?

tulip solstice
#

Isn't it like if something kind of depends on something else

burnt rose
#

That works.

#

Bayesian probability is talking about conditional probability.

#

P(A|B) is the probability of A, given B, or conditioned on B.

tulip solstice
#

Yep

burnt rose
#

So what I'm saying is, "there is a goat behind Door 2" isn't the event you need to take into account.

tulip solstice
#

Hmmm

#

But can't you say "whats the probability that in door 1 is the money given that in door 2 is a goat"

burnt rose
#

You can, but that's not the problem.

burnt rose
#

Algebra mistake!

tulip solstice
burnt rose
#

P(A_j) = 1/3 only when j = 1.

tulip solstice
#

Yeee

burnt rose
#

Else it equals 2/3.

tulip solstice
#

Yep

#

I was also thinking of it rn lol

burnt rose
#

That's why you use consistent notation.

#

And ideally specific notation, too.

#

Anyway, what you're actually conditioning on is that Monty opens Door 2.

#

So it would be $P(M_1|O_2) = P(M_1) \frac{P(O_2|M_1)}{P(O_2)}$

weary hatchBOT
#

Techie Literate

tulip solstice
#

Okay so P(M_1) is 1/3 right

#

P(O_2) is also 1/3

#

So they cancel out

burnt rose
#

Right, because M_1 = "the money is behind Door 1" (and more generally, M_i = "the money is behind Door i").

burnt rose
tulip solstice
#

Oh yee cuz he wouldn't open the door with the money in it

burnt rose
#

$P(O_2) = P(O_2|M_1)P(M_1) + P(O_2|M_2)P(M_2) + P(O_2|M_3)P(M_3)$ I think should cover all our bases.

weary hatchBOT
#

Techie Literate

burnt rose
#

That middle term is, of course, 0.

#

Then the outer terms are each 1/2 * 1/3.

#

So yes, $P(O_2) = 1/3$.

weary hatchBOT
#

Techie Literate

burnt rose
#

Wait.

tulip solstice
#

1/2×1/3×3?

burnt rose
#

No.

#

Because $P(O_2|M_2) = 0$, but I see what I did wrong.

weary hatchBOT
#

Techie Literate

burnt rose
#

Monty never opens the door you picked.

tulip solstice
#

Oh yee

burnt rose
#

And implicitly here we've picked Door 1.

#

Thus $P(O_2|M_3) = 1$.

weary hatchBOT
#

Techie Literate

burnt rose
#

Because Monty can't open Door 1 because we picked it, and he can't open Door 3 because it has the money.

#

So $P(O_2) = 1/2$

weary hatchBOT
#

Techie Literate

burnt rose
#

Which we should've expected, because again, he doesn't open our door, which leaves two.

#

An easier way to think about this is to forget about specific doors at all.

#

Let P = "we pick a goat" and R = "Monty reveals a goat".

#

Thus, we wish to calculate P(P|R).

#

$P(P|R) = P(P) \frac{P(R|P)}{P(R)}$.

weary hatchBOT
#

Techie Literate

burnt rose
#

$P(R|P) = P(R) = 1$, obviously, because Monty always reveals a goat.

weary hatchBOT
#

Techie Literate

tulip solstice
#

Ye

#

So just P(P)

burnt rose
#

So in a sense, the reason the Monty Hall Problem works the way it does is because Monty revealing the goat doesn't give you any information about the door you picked.

tulip solstice
#

Do you mean if I pick a door, monty will reveal a goat anyway so I still don't know if my door is the right one or not?

burnt rose
#

Well, let's imagine an alternate version of the problem where Monty opens an unpicked door at random.

tulip solstice
#

Okay

burnt rose
#

This would actually make $P(R|P) = 1/2$, since if we picked a goat, there's only one goat left for Monty to reveal.

weary hatchBOT
#

Techie Literate

burnt rose
#

What this means is that Monty revealing a goat is more likely if we picked the money than if we picked a goat.

#

And so if Monty reveals a goat, that gives us evidence that our door really does contain the money.

#

This evidence happens to be exactly an amount that raises the probability from 1/3 to 1/2.

#

In the actual problem, Monty always reveals a goat whether we picked a goat or not.

#

It gives us no information at all about whether our door contains a goat.

#

Thus it doesn't change the probability we assign to that event.

tulip solstice
#

I think I got it

tulip solstice
#

Is this correct techie?

#

Prob. of I pick money given monty reveals goat is 1/3

#

Uhhhh

#

But wait

#

If he reveals a goat

#

Then the chance that I pick the money is 1/2

tulip solstice
#

Well if he reveals a goat then there are two doors left

#

I didn't choose anything before he reveals it

#

Which is not the actual problem

tulip solstice
burnt rose
#

What we want to know is whether the door you picked has the money.

tulip solstice
#

But isn't it connected to the probability itself

#

So if we choose A_1= I pick money

burnt rose
#

What?

#

No. Stop.

#

Don't use As.

tulip solstice
#

Okay

#

M=I pick money

burnt rose
#

What do you mean "I pick money"?

#

Do you mean the door you pick has the money behind it?

tulip solstice
#

Yep

#

Shouldn't that work?

burnt rose
#

Okay, so let M = "the door you pick has the money behind it" and G = "Monty opens a door with a goat behind it".

#

So we want P(M|G).

tulip solstice
#

Yep

#

And uh

#

Theres another event

#

Which is

#

W="I pick a door with a goat"

#

So that covers all the possibilities

burnt rose
#

No.

#

That would just be ~M.

tulip solstice
#

Oh so why is it a problem?

burnt rose
#

...I didn't say it was?

#

I just said you don't need a third letter.

tulip solstice
#

Ah okayy

burnt rose
#

Because in the structure of the problem, if the door you pick doens't have the money, it must have a goat.

tulip solstice
#

Ye I understand

#

But I'm allowed to use a third letter?

burnt rose
#

No.

#

I mean.

tulip solstice
#

Cuz of confusion?

burnt rose
#

"You are allowed", technically, but I'm not allowing you.

#

Yes, because of confusion.

tulip solstice
#

Oh okay

#

So your advice is that I should express every event in terms of an other event as long as its possible?

#

If you can formulate it like that

#

Okay lets just move on

burnt rose
#

My advice is to talk about as few events as possible, and to name them as descriptively as possible.

tulip solstice
#

Okayy

#

Got it

burnt rose
#

The more events you're juggling the more likely you are to confuse yourself, especially if you've failed to give them distinguishing names.

#

So anyway. We want P(M|G).

#

The probability that the door we picked has the money behind it, given that Monty opens a door with a goat behind it.

tulip solstice
#

P(G|M)=1

#

Because he reveals a goat no matter what?

#

And P(M)=1/3

burnt rose
#

Right.

#

And P(G) = 1 also.

tulip solstice
#

Ye

#

So its just 1/3/1

#

Which is 1/3

#

We dont need the formula with the total probability right?

burnt rose
#

"Total probability"?

tulip solstice
#

Law of total probability

burnt rose
#

Not here, because we've described our events in a way where the place where we didn't need it in the place where we might because the event we defined was guaranteed.

tulip solstice
#

In other words its easy to find out what P(G) is?

#

If it werent easy the law of total probability might help

#

Am I right?

#

And uhm

#

M is defined as "I pick the door with the money before monty reveals a goat"

#

?

#

Thats what I was abit confused about

#

It's kind of trivial but when I'm tired its abit hard to understand it

tulip solstice
#

You're probably right

burnt rose
tulip solstice
#

Yep sure thats sounds great

burnt rose
tulip solstice
#

Okayy, number 1 teacher ^^

tulip solstice
#

I'm ready now @burnt rose

burnt rose
#

Alright, give me a minute.

tulip solstice
#

Should I just tell you what I've fully understood so far?

burnt rose
#

Go ahead.

tulip solstice
#

Okay so the problem states that we have 3 doors. We pick one door. Monty reveals one door with a goat. Question: should we switch to the other door or stay? For this problem we set M="I pick the door with the money" and G="Monty reveals a goat". We want P(M|G) since it asks what is the probability that I pick the door with the money GIVEN that Monty reveals a a door with a goat. We now use bayes theorem: P(M|G)=P(G|M)×P(M)/P(G). Since Monty always reveal a goat the probilities P(G|M) and P(G) are 1. Therefore P(M|G)=P(M). But P(M) is 1/3 since out of three doors, only one has the money. The probability that I pick the door with the money given that Monty reveals a goat is 1/3. But after he reveals it, there is only the other we didn't pick door left which will have the probability of 2/3 to have the money (remaining probability). Thus we should switch

burnt rose
#

Right.

tulip solstice
#

Yayy

#

Is the solution also like this in most of the text books?

burnt rose
#

I don't know.

tulip solstice
#

But I can trust you that you already studied the subject and you can varify that this solution is right?

burnt rose
#

I can do you one better and prove it to you.

tulip solstice
#

Ye why not

burnt rose
#

Okay, so.

#

The complete treatment of the problem contains nine statements, three each of three types; P_i = "I pick Door #i" O_i = "Monty opens Door #i" M_i = "The money is behind Door #i"

#

From the statement of the problem, we are given P(O_i|M_i) = P(O_i|P_i) = 0.

#

That is, Monty never opens the door with the money or the door we pick.

tulip solstice
#

Uh wait

tulip solstice
#

Right?

#

Cuz if the money is in door 1 then he cannot reveal door 1

burnt rose
#

...what I'm saying is that we have statements P_1, P_2, P_3, O_1, O_2, O_3, M_1, M_2, M_3.

#

Not all of these statements can be true at once, but we do have all of them.

tulip solstice
#

I understand

burnt rose
#

So now, arbitrarily suppose we pick Door 1 and Monty opens Door 2.

#

Thus, we wish to calculate P(M_1 | O_2 P_1).

#

Now, there are two rules of probability theory it'd probably help to learn before we go any further.

tulip solstice
#

Okayy

burnt rose
#

We can call these the product law and sum law of probability theory.

tulip solstice
#

Ah ye I know them

#

I think

burnt rose
#

The product law is thus; P(AB) = P(A|B) P(B)

tulip solstice
#

Yep

burnt rose
#

And because AB = BA, this also means P(AB) = P(B|A)P(A).

#

Which of course means, by the transitive property of equality, P(A|B)P(B) = P(B|A)P(A), which means P(A|B) = P(A)P(B|A)/P(B), thus Bayes's theorem.

#

The sum law of probability theory states P(A + B) = P(A) + P(B) - P(AB).

#

So we want P(M_1 | O_2 P_1), which equals P(M_1 | P_1) * P(O_2 | M_1 P_1) / P(O_2 | P_1).

#

Now, obviously, P(M_1 | P_1) = P(M_1) = 1/3. The door the money is behind is independent of the door we pick. The alternative would suggest either we have some suspicion of where the money is or the money is moved after we pick a door.

#

Equally obviously, P(O_2 | M_1 P_1) = 1/2, because if the money is behind the door we picked, then there's only one door Monty can't open, so he can just flip a coin to decide between the other two.

#

Now it might be prudent at this time to detour through a crash course on Boolean algebra.

#

Unless you already understand it.

tulip solstice
burnt rose
tulip solstice
#

P(M_1| O_2 P_1)= long expression

#

The rhs

burnt rose
#

What do you mean "varify" (besides "verify")?

tulip solstice
#

Oops ye I mean like derive it

#

So we know P(A|B)=P(B|A)P(A)/P(B)

#

Applying it with A=M_1 and B= O_2 P_1 doesn't directly give the expression you wrote

#

It gives this

#

You wrote

burnt rose
#

Uh, third line?

#

Okay, so it's important to recognize these as statements in Boolean relation to each other.

#

This is because logical connectives are commutative, associative, and distributive.

tulip solstice
burnt rose
#

So we know P(O_2 P_1 | M_1)P(M_1) = P(O_2 M_1 P_1), right?

burnt rose
#

Which means it's also equal to P(M_1 O_2 | P_1) P(P_1).

#

Or actually.

tulip solstice
#

It is true

#

Cuz of commutativity

burnt rose
#

Okay, so; P(O_2 M_1 P_1) = P(O_2 (M_1 P_1)) = P(O_2 | M_1 P_1) P(M_1 P_1) = P(O_2 | M_1 P_1) P(M_1 | P_1) P(P_1)

tulip solstice
#

Yes

burnt rose
#

So P(M_1 | O_2 P_1) = P(M_1) * P(O_2 P_1 | M_1) / P(O_2 P_1)

tulip solstice
#

Yes

burnt rose
#
P(M_1 | O_2 P_1) = P(M_1) * P(O_2 P_1 | M_1) / P(O_2 P_1)
                 = P(O_2 P_1 M_1) / P(O_2 P_1)
                 = P(O_2 | P_1 M_1) * P(P_1 M_1) / P(O_2 P_1)
                 = P(O_2 | M_1 P_1) * P(M_1 | P_1) * P(P_1) / (P(O_2 | P_1) * P(P_1))
                 = P(O_2 | M_1 P_1) * P(M_1 | P_1) / P(O_2 | P_1)```
#

Follow?

tulip solstice
#

Waittt I'm almost there

#

Yes

#

Makes sense

#

Pls go ahead

burnt rose
#

Okay, so.\

#

Like I said, P(0_2 | M_1 P_1) = 1/2, and P(M_1 | P_1) = 1/3.

#

Now we need to calculate P(O_2 | P_1).

tulip solstice
#

Okay I understand

#

So is it just 1/2 again?

burnt rose
#

Well, we need to calculate it.

tulip solstice
#

Hmm

burnt rose
#

This is where we derive the law of total probability.

tulip solstice
#

Oh yeee mb

burnt rose
#

And where Boolean logic is important.

#

Because A = AT = A + F in Boolean logic.

#

Or A = A * 1 = A + 0.

#

If we're using Boolean algebra specifically.

#

Now, we know that M_1 + M_2 + M_3 = 1, that is, the money is behind at least one of the three doors.

#

Thus, P(O_2 | P_1) = P(O_2 (M_1 + M_2 + M_3) | P_1).

#

Which, of course, thanks to the distributive property, equals P(O_2 M_1 + O_2 M_2 + O_2 M_3 | P_1).

#

Which therefore by the sum law of probability equals: P(O_2 M_1 | P_1) + P(O_2 M_2 | P_1) + P(O_2 M_3 | P_1) - P(O_2 M_1 M_2 | P_1) - P(O_2 M_1 M_3 | P_1) - P(O_2 M_2 M_3 | P_1) + P(O_2 M_1 M_2 M_3 | P_1)

#

And we know that i =/= j ==> M_i M_j = 0.

#

That is, the money is behind at most one door.

#

Therefore this all simplifies to P(O_2 M_1 | P_1) + P(O_2 M_2 | P_1) + P(O_2 M_3 | P_1).

#

We know that O_i M_i = 0 for all i, that is, it is always false that Monty opens the door with the money, so the middle term disappears.

#

We therefore have P(O_2 | P_1) = P(O_2 M_1 | P_1) + P(O_2 M_3 | P_1).

#

Which of course, by Bayes's theorem, equals P(O_2 | M_1 P_1) * P(M_1) + P(O_2 | M_3 P_1) * P(M_3).

#

And this is why we had to do all of that, because the door Monty opens depends on both which door we pick and which door has the money.

tulip solstice
#

I have one question: what are you really trying to prove

burnt rose
#

...we're doing the Monty Hall problem, right?

tulip solstice
#

Yep

#

So you're trying to prove that we should switch?

burnt rose
#

I'm trying to prove that the probability that the money is behind the door we picked is 1/3.

#

Behind Door 1.

tulip solstice
#

By considering all possible cases right?

burnt rose
#

Now, we know that P(O_2 | M_1 P_1) = 1/2, and we know P(O_2 | M_3 P_1) = 1.

burnt rose
#

We also know P(M_1) = P(M_2) = P(M_3) = 1/3 (which is something else I can show you how to derive, rather than taking for granted).

#

Thus, P(O_2 | P_1) = 1/2 * 1/3 + 1 * 1/3 = 3/2 * 1/3 = 1/2.

tulip solstice
#

Yep

burnt rose
#

Which is just 1/3.

#

Now, since we know that P(M_1 | O_2 P_1) + P(M_2 | O_2 P_1) + P(M_3 | O_2 P_1) = 1 and that P(M_2 | O_2 P_1) = 0, then we arrive at 1/3 + P(M_3 | O_2 P_1) = 1, or P(M_3 | O_2 P_1) = 2/3.

tulip solstice
#

Yep

#

Uhm Techie it's abit late in germany rn (12 a.m midnight) and I have school tomorrow. I don't know if the proof is done yet because I have to look at it a few times again to fully grasp the idea. I will come back tomorrow. Good night!

#

You were really helpful today thank you!

burnt rose
#

There might be details to shore up your understanding, but mechanically the proof is complete.

tulip solstice
#

Okayy, thats nice to know ^^ I will continue tomorrow byee

rocky rapidsBOT
#

@tulip solstice

:HelpIcon:| Help Reminder

Hello tony.241, this is a friendly reminder that your help request has been inactive for more than 24 hours. If you no longer need assistance, please consider closing the thread using the +close command. This thread will be automatically closed in 3 days if it remains inactive.