# Probability of urns

Four identical urns each contain 3 balls. In urn one, all three balls are black; urn two, 2 black 1 white; urn three, 1 black and 2 are white; urn four, all balls are whites.

One of the urn is picked at random, and a ball is chosen from the urn, which turns out to be white. What is the probability that all 3 balls in the selected urn are white?

This might be a silly question, but I am very confused. I know that there are 4 urns in total and only one urn contains three white balls. The part which I don't understand is if the probability of getting the urn with all white balls is 1/4 and it asks that all 3 balls in urn are white? So $1/4 * 1$?

Let $U_i$ be the $i$th urn just like you described, and let $A =\{\text{Picked a white ball}\},B_i = \{\text{Pick$U_i$}\}.$ Then the event "all 3 balls in the selected urn are white" is the same as event $B_4$. Thus, if we use conditioning, the probability we are interested in is \begin{align*} P(B_4|A)&=\frac{P(B_4A)}{P(A)}\\ &=\frac{P(A|B_4)P(B_4)}{P(A)}\\ &=\frac{P(A|B_4)P(B_4)}{P(A|B_1)P(B_1)+P(A|B_2)P(B_2)+P(A|B_3)P(B_3)+P(A|B_4)P(B_4)}\\ &=\frac{1\cdot \frac{1}{4}}{0(1/4)+(1/3)(1/4)+(2/3)(1/4)+1(1/4)}\\ &=\frac{1}{2}. \end{align*}

For this question you simply have to use bayes' rule: $$P(A \mid B) = \frac{P(B \mid A) \, P(A)}{P(B)}$$

First let us see what is the probability of selecting any of the urns. Since the urns are indistinguishable and there are 4 of them, the probabilities of selecting any of the urns is: $$P(U_1) = P(U_2) = P(U_3) = P(U_4) = \frac{1}{4}$$ where $U_i$ represents the $i^{th}$ urn.

We know one urn has all black balls, a second has 2 black and 1 white, a third has 2 white and 1 black, and the final one has 3 white ones. Counting how many white balls and black balls there are and looking at their proportion relative to the total number of balls, we find that the probability of selecting a white or black ball is: $$P(ball_{white}) = P(ball_{black}) = \frac{3 +2 + 1}{4 \cdot 3} = \frac{6}{12} = \frac{1}{2}$$

Your problem asks this: "Given that the ball selected was white, what is the probability that it came from the urn containing only white balls". Without loss of generality, let us assume that $U_4$ is the urn that contains white balls only. You want to find: $$P(U_4 \mid ball_{white})$$

Now we can use bayes' rule to rewrite the problem into one that is more suitable as follows: $$P(U_4 \mid ball_{white}) = \frac{P(ball_{white} \mid U_4) \, P(U_4)}{P(ball_{white})}$$

$P(ball_{white} \mid U_4) = 1$, because if you select a ball from an urn that only contains white balls, you are guaranteed to get a white ball hence the probability is 1.

And we have already computed the probabilities $P(U_4)$ and $P(ball_{white})$ above. Substituting these values into the bayes' rule form of our problem, we get: $$P(U_4 \mid ball_{white}) = \frac{1 \cdot \frac{1}{4}}{\frac{1}{2}} = \frac{1}{4}\cdot \frac{2}{1} = \frac{1}{2}$$

Therefore, the answer to your problem is $\frac{1}{2}$.

There are six white balls, which are equally likely to be the one picked.
Three of them were in the fourth urn, so the probability it was the fourth urn is $3/6$.
(Certainly, it wasn't the first urn, so the probabilities have changed from $1/4$ each.)

We want calculate $P(U_4|W)$. But $P(U_4|W)=P(W|U_4)\frac{P(U_4)}{P(W)}...(*)$.

Now, $P(W|U_4)=1$, cause $U_4=(W,W,W)$. Also, $P(U_4)=\frac{1}{4}$ cause the urn was selected randomly.

For $P(W)$ we have:

$P(W)=P(W|U_1)P(U_1)+P(W|U_2)P(U_2)+P(W|U_3)P(U_3)+P(W|U_4)P(U_4)$.

The first summand is 0, cause $P(W|U_1)=0$ since $U_1=(N,N,N)$. On the other hand, $P(W|U_2)=\frac{1}{3}$, $P(W|U_3)=\frac{2}{3}$ and $P(W|U_4)=1$, while $P(U_2)=P(U_3)=P(U_4)=\frac{1}{4}$.

Therefore have $P(W)=\frac{1}{3}\frac{1}{4}+\frac{2}{3}\frac{1}{4}+\frac{3}{3}\frac{1}{4}=\frac{6}{12}=\frac{1}{2}$. So, in $(*)$ we have $P(U_4|W)=\frac{1}{4}\times\frac{2}{1}=\frac{1}{2}$

• That reasoning is incorrect. The fact that we have 1 white ball in from the chosen urn changes the probability. Suppose we had 20 urns, 19 with 3 black balls and 1 with 3 white balls. Having chosen an urn, and taken 1 white ball from the urn, there is 100% chance that the urn contains 3 white balls, not 1/20 (original probability of having chosen the urn with 3 white balls). – Frentos Jan 16 '16 at 8:08
• Your new answer is correct :-). – Frentos Jan 16 '16 at 8:31
• Thanks @Frentos. Indeed I forgot the Monty Hall Problem – sinbadh Jan 16 '16 at 8:32

That problem can be generalized as follows, without removing any relevant information:

There is some number of urns containing balls of various colours. Of those balls, $n$ are white. While $m$ of the white balls are in urns that contain only white balls, all other white balls are in urns that contains also balls of other colours.

If you now draw one ball at random, and that ball turns out to be white, then what is the probability that the urn contains only white balls?

Formulated that way, it is immediately obvious that the answer is $m/n$: There are $n$ ways to draw a white ball, and $m$ of those are from a white-only urn.

Note that for this question, all other details (like the number of urns, or the exact number of non-white balls, or the fact that all urns have the same number of balls, or that no two urns have identical content) are irrelevant; all that matters is that you draw each ball with the same probability.

In your case, $m=3$ (there's one urn with only white balls, and that contains 3 balls), and $n=6$ ($0+1+2+3$), thus the probability is $3/6=1/2$.

One could also make a "tree diagram" for this. There are four "branches", presumably equally probable, with each urn appearing with probability $\ \frac{1}{4} \$ from the random selection. The probability of drawing a white ball from the urn selected is $\ 0 \ \cdot \ \frac{1}{4} \ \ , \ \ \frac{1}{3} \ \cdot \ \frac{1}{4} \ \ , \ \frac{2}{3} \ \cdot \ \frac{1}{4} \ \ , \ \ 1 \ \cdot \ \frac{1}{4} \$ at the end of each "branch". So the total probability of drawing a white ball is $\ 0 \ + \ \frac{1}{12} \ + \ \frac{2}{12} \ + \ \frac{3}{12} \$ . The "all-white-ball" urn accounts for the $\ \frac{3}{12} \$ term , which is then one-half of the total. So the conditional probability that this is the urn that has been drawn from upon obtaining a white ball is $\ \frac{1}{2} \$ . (This approach is just a way of viewing what the formal calculation from the definition of conditional probability tells us.)