# Probability of selecting specific balls from an urn?

An urn contains seven red balls, seven white balls, and seven blue balls. A sample of 5 balls is drawn at a random without replacement. What is the probability that the sample contains three balls of one color and two of another?

Here was what I tried doing.

I said that the total number of ways to choose 5 balls without any restrictions is $\binom{21}{5}$. This is because there are $21$ balls and $5$ positions that you need to choose.

Next I thought that the number of ways to select the $3$ balls of one color would be $\binom{7}{3}$ since there are $7$ balls of one color. Since there are 3 different colors I also thought you would multiply $\binom{7}{3}$ by 3.I also thought since the remaining two balls must be of a different color there are $2!$ ways to permute the remaining balls.

$$Probability = \frac{3*2!*\binom{7}{3}}{\binom{21}{5}}$$

Only thing is I'm not sure If my answer is right. One problem that I had dealing with was if the two remaining balls are of the same color then I'm not sure multiplying by $2!$ is right but I'm not really sure how to deal with these cases.

==================================================================

Comment: I was wondering if instead of having the same number of balls lets say you had 7 red balls, 8 white balls, and 9 blue balls. Then how would the formula for probability be affected.

Your denominator is correct. For the numerator, we must select one of the three colors from which three balls will be selected, select three of the seven balls of that color, select one of the two remaining colors from which two balls will be selected, and select two balls of that color. Hence, the probability of selecting three balls of one color and two balls of another color when five balls are selected is $$\frac{\dbinom{3}{1}\dbinom{7}{3}\dbinom{2}{1}\dbinom{7}{2}}{\dbinom{21}{5}}$$

Addendum: If you instead have seven red balls, eight white balls, and nine blue balls, you have six cases. They are

1. three red, two white $\binom{7}{3}\binom{8}{2}$
2. three red, two blue $\binom{7}{3}\binom{9}{2}$
3. two red, three white $\binom{7}{2}\binom{8}{3}$
4. two red, three blue $\binom{7}{2}\binom{9}{3}$
5. three white, two blue $\binom{8}{3}\binom{9}{2}$
6. two white, three blue $\binom{8}{2}\binom{9}{3}$

Hence, the probability of selecting three balls of one color and two balls of a different color when five balls are selected from the $7 + 8 + 9 = 24$ balls in the bag is $$\frac{\dbinom{7}{3}\dbinom{8}{2} + \dbinom{7}{3}\dbinom{9}{2} + \dbinom{7}{2}\dbinom{8}{3} + \dbinom{7}{2}\dbinom{9}{3} + \dbinom{8}{3}\dbinom{9}{2} + \dbinom{8}{2}\dbinom{9}{3}}{\dbinom{24}{5}}$$

• I was wondering whether you could have any cases where you would draw 3 blue balls, 1 red, and 1 white ball? – user262291 Apr 9 '16 at 15:10
• That's a different question since choosing three of one color and two of another color when five balls are selected precludes the possibility of selecting three different colors. The probability of selecting three blue balls, one red ball, and one white ball in the first scenario is $$\frac{\binom{7}{3}\binom{7}{1}\binom{7}{1}}{\binom{21}{5}}$$ In the second scenario, the probability is $$\frac{\binom{9}{3}\binom{7}{1}\binom{8}{1}}{\binom{24}{5}}$$ The second scenario makes it clearer what I am counting, namely selections of three blue balls, one red ball, and one white ball. – N. F. Taussig Apr 9 '16 at 18:15

Whenever you can, relate the problem to a known category of familiar problems.
Here, you can treat it the way you compute poker probabilities:

We want $3-2$ of a kind, so numerator will be [Choose kinds] $\times$ [Choose balls from each kind]

$Pr = \dfrac{\dbinom31\dbinom21 \times \dbinom73\dbinom72}{\dbinom{21}5}$

First you use the multi-hypergeometric distribution to calculate the probability that a specific (3, 2, 0) results among the 3 colors:

$$\frac {\displaystyle \binom {7} {3} \binom {7} {2} \binom {7} {0}} {\displaystyle \binom {21} {5}}$$

For the generic case you multiply the above by $3!$.

Another approach is to use basic counting techniques.
A favorable outcome would be XXXYY
Number of ways to select color for X = $3$
Number of ways to select color for Y = $2$
Number of ways to select 3 balls of color X = $7.6.5$
Number of ways to select 2 balls of color Y = $7.6$
Number of ways to permute XXXYY = $5!/(3!2!)$

Total number of favorable outcomes = $3.2.(7.6.5)(7.6)(5!)/(3!2!)$
Number of ways to select the 5 balls = $21.20.19.18.17$

Finally,
$$P_r=\frac{3.2.(7.6.5)(7.6)(5!)}{(21.20.19.18.17)(3!2!)}$$