Application of Bayes Theorem in Dependent Events

bayes-theoremprobability

Here is my attempt to solve this problem using Bayes's Theorem. I would appreciate it if anyone could identify a mistake (if any) in my approach.

Problem: There are two bins B1 and B2. In B1 there are 2 red balls and 8 blue balls. In B2 there are 7 red balls and 3 blue balls. Suppose Bob first picks a bin B1 or B2 with equal probability and then picks a ball from the bin he has chosen (without telling us the bin). Given that Bob has picked a red ball, what is the probability he chose B1?

My approach:

It is clear that B1 and r are not independent events. Let B1 be the event of picking a B1 bin and r be the event of picking a red ball.

Use Bayes theorem: $P(B1|r)=\frac{P(r|B1)*P(B1)}{P(r)} = \frac{\frac{1}{5}*\frac{1}{2}}{\frac{9}{20}} = \frac{2}{9}$

Everything here is intuitive to me apart from the fact that I had $P(r) = \frac{9}{20}$. Here I just combined balls in B1 and B2 and there are 9 red balls out of 20 total. I appreciate any insights into how my approach or application of Bayes Theorem is incorrect. Thank you.

Best Answer

You can combine like that because there are ten balls in each bin and an equal choice between bins, therefore each ball has an equal chance of being selected.   Nine of the twenty balls are red.

If there were different amounts in each bin, there would be bias, and you would instead have to use the Law of Total Probability to get the correct result.   However, that is not the case, so you are okay.

Of course, you may still use it to obtain the same answer:

$$\begin{align}\mathsf P(r)&=\mathsf P(r\mid B_1)\mathsf P(B_1)+\mathsf P(r\mid B_2)\mathsf P(B_2)\\[1ex]&= \frac 2{10}\cdot\frac 12+\frac 7{10}\cdot\frac 12\\[1ex]&=\frac 9{20}\end{align}$$


So, yes, indeed.   The probability for having selected bin 1 when given that you obtained a red ball is $2/9$.   It is less likely that you picked from the bin with fewer red balls -- two among the nine red balls come from bin 1 and all balls are each equally likely to have been selected.

$$\begin{align}\mathsf P(B_1\mid r)&=\dfrac{\mathsf P(r\mid B_1)\mathsf P(B_1)}{\mathsf P(r\mid B_1)\mathsf P(B_1)+\mathsf P(r\mid B_2)\mathsf P(B_2)}\\[1ex]&=\frac 29\end{align}$$

Related Question