Probability of drawing all red balls before any green ball

Question:

Suppose that a box contains $r$ red balls, $g$ green balls, and $b$ blue balls. Suppose also that balls are drawn from the box one at a time, at random, without replacement. What is the probability that all $r$ red balls will be obtained before any green balls are obtained?

Solution(Partial):

I know this solution for $1$ red, $1$ green and $1$ blue balls:

$$\begin{array}{c|l|c} \color{red}{red} & \color{green}{green} & \color{blue}{blue} \\ \hline \\ \color{blue}{blue} & \color{red}{red} & \color{green}{green} \\ \hline \\ \color{red}{red} & \color{green}{green} & \color{blue}{blue} \\\hline \\ \color{green}{green} & \color{red}{red} & \color{blue}{blue} \\\hline \\\color{green}{green} & \color{blue}{blue} & \color{red}{red} \\\hline \\ \color{blue}{blue} & \color{green}{green} & \color{red}{red} \\ \end{array}$$

This means,that there are $3$ outcomes for this event with the sample space of $6$.So, probability is $\frac{1}{2}$.

But I don't know how to generalize this.

• You can ignore the green balls, they have nothing to do with anything; drawing a green is just a delay. And never mind drawing one at a time; the question is about the first $r$ balls you get (not counting greens of course). The question is, if you draw $r$ balls from a box containing $r$ red and $b$ blue balls, what's the probability of drawing all red balls? The answer is $1/\binom{r+b}{r}$.
– bof
Oct 2 '13 at 11:50
• @bof mixed up green and blue, it's the blue balls that are irrelevant here. The argument remains unscathed. Oct 2 '13 at 11:53
• But my instructor's solution says ignoring blue balls: "The presence of blue balls is irrelevant in this problem, since whenever a blue ball is drawn it is ignored. Hence the answer is $1/\binom{r+g}{r}$" Oct 2 '13 at 11:57
• That's what Daniel Fischer explained to you. Oct 2 '13 at 12:07

To count the sequences of $r+b+g$ draws in which all of the red balls precede all of the green balls, note that they are obtained by starting with the sequence

$$\underbrace{RR\ldots RR}_r\underbrace{GG\ldots GG}_g$$

and inserting the $b$ blue balls arbitrarily into the sequence. This is a straightforward stars-and-bars problem; the link has both a formula and a pretty decent explanation of it, but if you have questions, leave a comment. Bear in mind that in any given sequence the $r$ red balls can actually be arranged in $r!$ orders, the blue balls in $b!$, and the green balls in $g!$, so that a given sequence of colors actually corresponds to $r!b!g!$ different sequences of balls drawn. However, since this is the same for each sequence of colors, it does no harm to count sequences of colors instead of sequences of balls.

Once you have that, you need only count the possible sequences of colors. You have to choose $r$ positions for the red balls, $b$ for the blue balls, ...

• I can't understand why $r!b!g!$ and why not $(r+b+g)!$ ? Oct 2 '13 at 13:59
• What I understand from your answer is this: One has to consider all the $3!r!b!g!$ sequences, as there are three colors, so we can arrange "sequences of colors" in $3!$ ways. Out of these $3!r!b!g!$ sequences, one has to consider only those sequences which have reds before greens. Am I right? Oct 2 '13 at 15:13
• And this works for 1 red,1 green and 1 blue! $$\frac{3}{3!1!1!1!}$$ Oct 2 '13 at 15:23
• @Sush: It’s $r!b!g!$ because you’re permuting the groups of red, blue, and green balls separately within their assigned sets of positions. For example, if $b=g=2$ and $r=1$, the color sequence $RBGBG$ can be drawn in $2!2!1!=4$ ways: $RB_1G_1B_2G_2$, $RB_1G_2B_2G_1$, $RB_2G_1B_1G_2$, and $RB_2G_2B_1G_1$, where $B_1$ and $B_2$ are the two blue balls and $G_1$ and $G_2$ are the two green balls. There are $5!$ sequences altogether, but only $4$ of them produce the color sequence $RBGBG$. // There are not $3!r!b!g!$ sequence of balls; there are $(r+b+g)!$ sequences. And yes, among these ... Oct 2 '13 at 19:56
• ... you want to count those in which all of the red balls precede all of the green balls. Since each color sequence corresponds to the same number of actual sequences of individual balls ($r!b!g!$), you can do this either by counting color sequences or by counting sequences of individual balls. Oct 2 '13 at 19:59

The presence of blues is not relevant to the probability. Imagine that the reds and greens are all distinct, and lined up in a row at random. We remove them one at a time, starting on the left.

There are $(r+g)!$ equally likely ways that the balls can be arranged. There are $r!g!$ ways to arrange them so that the reds are all before the greens. Thus the required probability is $\dfrac{r!g!}{(r+g)!}$.

This can be rewritten more compactly as $\dfrac{1}{\binom{r+g}{r}}$.

• Will you please elaborate why the presence of blues is irrelevant? (My instructor couldn't explain that!) I will be obliged. Oct 2 '13 at 15:03
• Imagine that all the balls (including blue) have been lined up in a row, at random. Then all the reds are before any green if and only if when we remove all the blues, all the reds are before any green. Oct 2 '13 at 15:08
• You are welcome. I take it everything is clear now. Oct 2 '13 at 15:32

Here is a variation on Brian's answer. The ball colors can occur in ${(r+g+b)!\over r!g!b!}$ distinct orders, all of which are equally likely to occur.

We now count the number of "good" orders. Start with $r+g+b$ blank spaces and choose $b$ of them to be filled with blue balls. The remaining spaces can only be filled in one "good" way, so the number of good orders is $r+g+b\choose b$.

The required probability is $${{r+g+b\choose b} \over {(r+g+b)!\over r!g!b!}},$$ which simplifies to the expression in André's answer.

• You bridged the gap!Thanks. Oct 10 '13 at 6:24