There are $3$ bags, each containing $3$ coloured balls. The first two bags contain a red, green, and blue ball. The third bag contains $3$ red balls. You choose a bag at random. You then pull out a ball and replace it back into the bag. You then pull out another ball and determine that both of the balls you chose were red. What is the probability you chose the bag with the $3$ red balls?
P_redBag $= 1/3$ => P_redBall $= 1$
P_mixBag $= 2/3$ => P_redBall $= 1/3$
$P(A|B) = P(A) * P(B|A)/P(B)$
$B = 1/3 * 1 + 2/3 * 1/9 = 0.4074$
The solution is $82$%
I cannot figure out how to derive that solution... I have tried:
$P(A|B) = 1/3 / (1/3 * 1 + 2/3 * 1/9)$
and several variations.
I assume that B is the probability of choosing a red ball, and A is the probability of choosing the bag full of red balls.