posterior probability of bag given ball (evidence)

987 Views Asked by At

Question:

Given the distribution of the coloured balls in three different bags:
- Bag A: 1 Red 2 Black 2 Blue
- Bag B: 2 Red 4 Black 4 Blue
- Bag C: 10 Red 2 Black 3 Green

we carry out two independent experiments:
1) pick a bag, then pick a ball from the chosen bag.
2) pick a ball uniformly and random from all of the 30 balls.

We observe that the ball is red (for both experiment).
Now, we want to find the posterior probability of ball was taken from bag C given the ball chosen is Red for each of the experiment (i.e. P(Bag C | Red)).

My attempt:
For Experiment 1:
Using Bayes Rule we have:
P(Bag C | Red) = P(Bag C and Red) / P(Red)

From the distribution, we have P(BagC, Red) = 10/30
Now,P(Red)
= (by law of total probability) sum of conditional probability of
    P(Red | Bag X) * P(Bag X) 
= P(Red|BagC)*P(BagC) + P(Red|BagB)*P(BagB) + P(Red|BagA)*P(BagA)
= (1/3)(10/15) + (1/3)(2/10) + (1/3)(1/5) 
= 16/45

And hence P(BagC|Red) = (10/30) / (16/45) = 15/16 ???

For Experiment 2:
this is the part where i am confuse, because intuitively, i dont not see the difference between both question! But i slept over it and think maybe the difference is in the way we calculate P(red), and thats why the following answer:

So using the same formula above, but with difference calculation of the probability of getting a red ball from the bag:

P(Red) = total number of red / total number of balls = 13/30
Hence, P(BagC|Red) 
= P(Red, BagC) / P(Red) 
= (10/30) / (13/30) 
= 10/13

Intuitively, i thought my answer made sense because if we were to choose a bag first, the probability of the red ball coming from bag C will be larger since the proportion of red balls in bag C is significantly higher.
In comparison, if we pick randomly from the pool of 30 balls, the contribution of C into the pool is higher as well (10/13 red balls from C).

I am not entirely sure if my approach is correct here, and would wish that you can validate my answers.

EDIT:
Rectify the error pointed out in the comments

2

There are 2 best solutions below

7
On BEST ANSWER

Your answer to the first question is correct. (ETA: Or was, before you edited $\frac{5}{8}$ to $\frac{15}{16}$. $<$g$>$)

Your answer to the second question is incorrect, because the $P(\text{red}, \text{Bag $C$}) = 10/30$, not $10/45$. (That is, out of the $30$ balls, each equally likely to be selected, exactly $10$ of them are both red and in Bag $C$.) You then obtain the correct answer of $10/13$.

1
On

In the pool of all $30$ balls, label the balls by the label of the bag they came from. Then, there are $10$ red 'C' balls. So the second question asks for the probability of a ball being a red 'C' ball, given that it is a red ball. There are totally $13$ red balls, and $10$ of these are 'C', so the probability is $\dfrac{10}{13}$.

You can do this using Bayes' theorem too, but you will get the same answer.