# Probability of particular subset of balls occurring in a larger set chosen from a total?

If I have 3 balls chosen out of 6 (2 blue, 2 red, and 2 green) with replacement, what is the chance a chosen ball will be blue? How about two blue balls?

I think I can reason this out, but I'm curious about the approach using permutations and combinations.

So far, I'm thinking I have 6 balls in total, so all possible permutations would be 6! = 720, and then all permutations of 3 would be 6!/3! = 120, but this is where I'm stuck (and end up thinking in circles too hard, likely making an easy problem into something way more difficult).

I'm thinking for one blue ball, we have a probability of 1/3 of choosing one each time, so for three choices this is still just 1/3...but it doesn't feel right. Any suggestions on how to tackle this?

• Think about $X=$ "Number of blue balls" having a Binomial distribution with $p=1/3$ ("success" is getting a blue ball). – Mick A May 6 '15 at 1:24
• You say you haven't covered the binomial distribution. This is as I suspected, and the reason I wrote my answer as I did. No factorials, no binomial coefficients, no Boolean indicators. This is really a very basic problem, and a good one to get you ready for what comes next in your course. – BruceET May 7 '15 at 6:35

Your expressions with permutations might work for sampling without replacement. But for sampling with replacement, you need another approach.

First, the probability of a blue ball on any one draw is just 2/6 = 1/3.

Second, the probability of getting exactly one blue ball out of three is found as follows. Suppose the first ball is blue and the other two are not. That is $$(2/6)(4/6)(4/6) = (1/3)(2/3)(2/3) = 4/27.$$ But you need to multiply this by three, because the order of colors might be BNN, NBN, or NNB (where B=blue, and N=not blue). So the answer is $12/27 = 4/9.$

Third, the probability of getting at least one blue ball out of three can best be found by subtracting the probability of no blue ball from 1. That is, $1 - (2/3)^3 = 19/27.$

The way you have phrased your first question it might be interpreted in any of these three ways I have just shown.

Originally, I left the probability of getting exactly 2 blue balls unanswered in hopes you would try it on your own. But with several other answers to that part already, that train seems to have left the station.

You can start with the probability of getting blue balls on the first two tries and then one that isn't blue on the third: $$(1/3)(1/3)(2/3) = 2/27.$$ But then you need to multiply by 3 because there are three possible arrangements: BBN, BNB, NBB, in my previous notation. All three have probability 2/27, for a total probability of $6/27 = 2/9.$

@Mick A is correct that any of these problems might be solved by letting $X \sim Bin(3, 1/3)$ and the using the formula for binomial probabilities to find probabilities such as $P(X = 1),$ $P(X \ge 1),$ and $P(X = 2).$ However, the wording of the problem is consistent with an attempt to prepare you for the binomial distribution coming up in the next chapter, so I chose a more elementary explanation.

If it is drawing with replacement then you have a population of 6 items containing 2 favoured items, drawn with replacement 3 times. The count of favoured cases in the sample has a Binomial Probability Distribution, with parameters $n=3, p=1/3$.

We use combinations in this case to count ways to select $k$ draws where favoured cases occur (successes) and $n-k$ draws where it does not (failures) and multiply by the probability of filling each draw in that manner. This gives the probability that $k$ of $n$ draws will be a success.

$$\mathsf P(X=k) = {^n\mathrm C_k} p^k (1-p)^{n-k} \\[1ex] \mathsf P(X=0) = \frac{3!}{0!3!} \frac{2^3}{3^3} = \frac{8}{27} \\[1ex] \mathsf P(X=1) = \frac{3!}{1!2!} \frac {2^2}{3^3} = \frac{12}{27} \\[1ex] \mathsf P(X=2) = \frac{3!}{2!1!}\frac{2}{3^3} = \frac{6}{27} \\[1ex] \mathsf P(X=3) = \frac{3!}{3!0!}\frac{1}{3^3} = \frac{1}{27}$$

However, if it were with replacement, then you would have a population of 6 items, 2 of which are favoured (blue), and selecting a sample of 3 items (without replacement).   (We assume equal probability of selecting any particular balls.)

This is what is known as a Hypergeometric Probability Distribution.

We use combinations in this case to evaluate the probability thusly:   The probability of getting exactly one of the favoured items in the sample is: the count of ways to get one of two favoured and two of the four unflavoured divided by the count of ways to select any three of six items.

$$\mathsf P(X=1) = \frac{{^2\rm C_1}\cdot{^4\rm C_2}}{^6\rm C_3} = \frac{2!\cdot 4!/2!2!}{6!/3!3!} = \frac{3}{5}$$

The probability of getting exactly two favoured balls is similarly:

$$\mathsf P(X=2) = \frac{{^2\rm C_2}\cdot{^4\rm C_1}}{^6\rm C_3} = \frac{2!/2!\cdot 4!/1!3!}{6!/3!3!} = \frac{1}{5}$$

So the probability of getting at least one favoured ball is:

$$\mathsf P(X\geq 1) = \frac{{^2\rm C_1}\cdot{^4\rm C_2}+{^2\rm C_2}\cdot{^4\rm C_1}}{^6\rm C_3} = \frac{3}{5}$$

And the probability of the complementary event (of getting none of the favoured balls) is:

$$\mathsf P(X=0) = \frac{{^2\rm C_0}\cdot{^4\rm C_3}}{^6\rm C_3} = \frac{2}{5}$$

• Thanks! That seems to explain it a bit, but I'm confused as this is a question in my book where I have not even touched the binomial distribution. I've just covered linear combinations and expectation of random variables. I did word it slightly differently, where they specifically ask for the expectation and variance of the number of blue balls picked (In slightly rewording it (my mistake), using "chance" might have lead to the binomial distribution discussion. I think its very valuable, but I'm still confused. :( – Topher May 6 '15 at 5:33

Thanks! That seems to explain it a bit, but I'm confused as this is a question in my book where I have not even touched the binomial distribution. I've just covered linear combinations and expectation of random variables. I did word it slightly differently, where they specifically ask for the expectation and variance of the number of blue balls picked (In slightly rewording it (my mistake), using "chance" might have lead to the binomial distribution discussion. I think its very valuable, but I'm still confused.

Okay.   In this case let $X_i$ be the Boolean indicator that a favoured item is drawn on the $i^{th}$ draw.   Then since there are two favoured items in the population of six, then: $\mathsf E(X_i)= 1/3$ for all draws.   (Interestingly this bit is true whether we are drawing with or without replacement.)

The count of favoured items drawn in a run is the sum of the indicators. $$X=\sum_{i=1}^3 X_i$$

Since expectation is linear the expected count of favoured items in the run is the sum of the expected value of these indicators. \begin{align}\mathsf E(X) & = \mathsf E(\sum_{i=1}^3 X_i) \\ & = \sum_{i=1}^3 \mathsf E(X_i) \\ & = 1\end{align}

The expected square of the count is slightly more involved.

\begin{align} \mathsf E(X^2) & = \mathsf E(\sum_{i=1}^3 X_i \sum_{j=1}^3 X_j) \\[1ex] & = \mathsf E\left(\sum_{i\in\{1,2,3\}} X_i^2 + \mathop{\sum\sum}_{ \substack{ i\in\{1,2,3\}\\[0ex] j\in \{1,2,3\}\setminus\{i\}}} X_iX_j\right) \\[1ex] & = 3\mathsf E(X_i^2) + 6\mathsf E(X_iX_j\mid i\neq j) \\[1ex] & = 3(\tfrac 1 3) +6(\tfrac 1 9) \\[2ex] & = \tfrac 5 3 \end{align}

The second last step trips people up when the first encounter it. \begin{align} \mathsf E(X_i^2) & = 1^2\;\mathsf P(X_i=1) + 0^2\;\mathsf P(X_i=0) \\[1ex] & = \tfrac 1 3 \\[2ex] \mathsf E(X_iX_j\mid i\neq j) & = 1\cdot\mathsf P(X_i=1\cap X_j=1)+ 0\cdot\mathsf P(X_i=0 \cup X_j=0) \\[1ex] & = \tfrac 1 9 \end{align}

You know have the mean and enough to find the variance, since $\mathsf{Var}(X)=\mathsf E(X)^2-\mathsf E(X)^2$

NB: If we are drawing without replacement then \begin{align} \mathsf E(X_iX_j\mid i\neq j) & = \dfrac {\quad\binom{2}{2}\quad}{\binom{6}{2}} \\[1ex] & = \tfrac 1 {15} \\[2ex] \therefore \mathsf E(X^2) & = \tfrac 7 5 \end{align}

For the case with two blue balls:

Define the probability of drawing a blue ball with one single draw as $p$ and the probability of the complementary event - no blue ball with a single draw as $1-p$.

You draw three times. Any distinguishable permutation with two blue balls and one ball with another colour (e.g. first draw blue, second draw other colour, third draw blue again) will have the same probability $P(B)$:

$P(B)=p^2(1-p)=\left(\cfrac{2}{6}\right)^2\cdot\cfrac{4}{6}=\cfrac{2}{27}$

The number of distinguishable permutations is in general counted as: $\cfrac{n!}{n_1!n_2!...}$

where $n$ is the total number of elements in the permutation and $n_1, n_2...$ indicate the number of elements in subsets $1,2,....$ within which the elements cannot be distinguished from each other. (that's the multinomial formula btw)

The way the problem presents itself here is that you have just two subsets, blue and non-blue. So you can apply the binomial formula which is a special case of the multinomial formula:

$\cfrac{n!}{k!(n-k)!}$

this is aka the Combination formula, and written as:

$_nC_k=\binom{n}{k}=\cfrac{n!}{k!(n-k)!}$

where $k$ is the number of elements in one of the subsets, here the one with blue balls.

Note that "being indistinguishable within the subset" is sometimes a bit difficult to grasp in the context of probability questions - as one could for example give both blue balls distinct numbers, e.g. 1 and 2, and with the formula above, for example the case with the first ball being blue ball 1 and the 2nd ball being blue ball 2, and the case with the opposite are counted together as one case only. However, this "summarized case" will get double the probability assigned.

Multiplying the number of distinguishable permutations with two blue balls with the probability of any such distinguishable permutation caclulated above gives the probability to get (exactly) two blue balls with three draws (event $X$):

$P(X)=\binom{3}{2}\cfrac{2}{27}=\cfrac{2}{9}$

(to generalize, you can write the probability that the number $X$ of blue balls drawn equals $k$ as follows:

$P(X=k)=\binom{n}{k}p^k(1-p)^{n-k}$

which is the formula for the probability mass function of the binomial distribution (http://en.wikipedia.org/wiki/Binomial_distribution)).