Computation of the likelihood of the following two questions with balls in urns

bayes-theoremprobabilitysolution-verification

Urn A contains three balls: one black, and two white; urn B contains
three balls: two black, and one white. One of the urns is selected at
random and one ball is drawn. The ball is black. What is the
probability that the selected urn is urn A?

For the above problem I solved the following:

$p(U_a | B) = \frac{p(B|U_a)P(U_a)}{P(B)}$

with $P(B) = \sum_{U} p(B|U_a)P(U_a) + P(B|U_B)P(U_B) = 2/3 \times 0.5 + 1/3 \times 0.5 = 0.5$

So $p(U_a | B) = \frac{1/3 \times 0.5}{0.5} = \frac{1}{3}$

Anyone can confirm if this is in fact right?

Similarly for the second problem below I used the same method

Urn A contains five balls: one black, two white, one green and one
pink; urn B contains five hundred balls: two hundred black, one
hundred white, 50 yellow, 40 cyan, 30 sienna, 25 green, 25 silver, 20
gold, and 10 purple. [One fifth of A’s balls are black; two-fifths of
B’s are black. One of the urns is selected at random and one ball is
drawn. The ball is black. What is the probability that the urn is urn
A?

$P(U_a|B) = \frac{0.2 * 0.5}{(0.2 \times 0.5 + 0.4 \times 0.5} = \frac{1}{3}$

More unsure of the second answer but would love it if someone could confirm my thinking, thanks

Best Answer

You did fine.

For the first problem there is a more direct solution that avoids the use of the rule of Bayes.


Since both urns have the same number of balls and secondly the choosing of the urn is at random we can conclude that all balls have equal probability to be the drawn ball.

One of the black balls comes from urn A and two from urn B, so the probability that the drawn ball came from urn A equals $\frac13$.

Related Question