# Conditional Probability Example

I don't understand the following example,

Consider two urns, the first containing two white and seven black balls, and the second containing five white and six black balls. We flip a fair coin and then draw a ball from the first urn or the second urn depending upon whether the outcome was heads or tails. What is the conditional probability that the outcome of the toss was heads given that a white ball was selected?

What is the relationship between coin and selecting a ball ?

This can be found using Bayes' theorem.

Say that $A$ is the even that the outcome of the toss was heads, and $B$ is the even that the white ball was selected.

$P(B | A) = \frac{2}{9}$, because that means the first urn was used.

$P(A) = 0.5$, because the coin is fair.

$P(B) = 0.5 \frac{2}{9} + 0.5 \frac{5}{11}$, by the Law Of Total Probability.

Using Bayes' law, you can get $P(A|B)$ from this.

Suppose you drew a white ball. Both first Urn (A), and the second Urn (B), have a white balls in them (2 and 5 resp.). The choice whether we will draw a ball from Urn A or Urn B depends on whether the coin showed heads or tails.

The question asks you to tell the probability of coin showing a head if a white ball had been drawn. Alternatively, it asks you to tell the probability of the ball being from Urn A (since we chose A if we get head), if it is a white ball.

Let us define W to be the event of ball being white. A of ball being from urn A, and B of ball being from Urn B.