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)).
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.
Rectify the error pointed out in the comments