BasicCountingPattern Basic

Problem - 4266

There are $5$ red balls and $4$ green balls in a bag. One ball is retrieved a time until all the balls are taken out. How many possible ways are there such that all the red balls are taken out before all the green balls are taken out?


There are several ways to solve this problem. The answer is $C_{5+4-1}^{5}=56$.

In general, if there are $a$ red balls and $b$ green balls, then the number of possibilities that red balls are all retrieved first is $$C_{a+b-1}^{a}=\frac{(a+b-1)!}{a!\cdot (b-1)!}$$

$\underline{Solution\ 1}$

As long as the last ball is green, the requirement will be satisfied. Therefore, this problem is equivalent to arrange $a$ red balls along with $(b-1)$ green balls. For each sequence under this arrangement, we can append the remaining green ball at the end to satisfy the requirement. Hence, the answer is $$C_{a+b-1}^a=\frac{(a+b-1)!}{a!\cdot (b-1)!}$$

$\underline{Solution\ 2}$

We can model this problem in a similar way as # 4263. The benefit of this is that it can be extended to the case with three colors easily.

In the $(5\times 4)$ grid shown below, every shortest path from point $A$ to point $B$ is corresponding to one way of retrieving the $9$ balls when eastern bound step represents retrieving a red ball and northern bound step represents retrieving a green ball.

If all the red balls are retrieved before green balls, then the route must hit the east vertical boundary of this grid. In this case, point $C$ must be reached before the route terminates at point $B$. Hence, the answer is equivalent to count the shortest routes from point $A$ to point $C$, which is $$C_{5+4-1}^5$$

report an error