Bag $A$ has $2$ red and $3$ blue marbles. Bag $B$ has $4$ red and $1$ blue marbles. One bag is chosen at random, and a red marble is drawn. What is the probability that it came from bag $A$?
Solution: $P(\text{bag}\ A \mid \text{red})\;=$$\;\frac{P(\text{red} \mid \text{bag}\ A) P(\text{bag}\ A)}{P(\text{red} \mid \text{bag}\ A) P(\text{bag}\ A) + P(\text{red} \mid \text{not bag}\ A) P(\text{not bag}\ A)}\;=$$\;\frac{(2/5)(1/2)}{(2/5)(1/2) + (4/5)(1/2)}\;=$$\;\frac{2}{6}\;=$$\;\frac{1}{3}$
.