[Math] How many ways balls can be selected

combinatoricspermutations

I am trying to solve

In how many ways can 25 balls be selected from a bag containing 15 identical red balls, 20 identical blue balls and 25 identical green balls?

Should not be the answer be –

$$ 60C3 – 15C3 -20C3 – 25C3 +3 $$

3 IS ADDED TO take a uniuqe case from each of the three 3 same colours of ball selected.

But the answer is 281 .

Where i am wrong ?

How i can achieve this ?
Thanks in advance.

Best Answer

Imagine that you have $25$ identical balls and three boxes, one labelled RED, one labelled BLUE, and one labelled GREEN. Your problem is equivalent to asking how many different ways there are to distribute your $25$ balls amongst the boxes, if you can put at most $15$ balls into the RED box and at most $20$ balls into the BLUE box.

If there were no upper limits, the answer would be $\binom{25+3-1}{3-1}=\binom{27}2$; see here. However, some of these violate the upper limits, so to get the actual answer, we’ll have to subtract those.

First calculate the number of distributions that put too many balls into the RED box. That requires putting $16$ balls into the RED box and then distributing the remaining $9$ balls however you please amongst the three boxes. This can be done in $\binom{9+3-1}{3-1}=\binom{11}2$ ways.

Now calculate the number that put too many (i.e., at least $21$) balls into the BLUE box; the same reasoning shows that there are $\binom{4+3-1}{3-1}=\binom62$ ways to do this.

We don’t have enough balls to put too many balls into more than one box, so the final result is $$\binom{27}2-\binom{11}2-\binom62=351-55-15=281\;.$$

Added: Here’s another way to look at it that may be more familiar to you. Let $x_1,x_2$, and $x_3$ by the number of red, blue, and green balls, respectively, that you select. Then you’re counting integer solutions to $x_1+x_2+x_3=25$ that satisfy the conditions $0\le x_1\le 15$, $0\le x_2\le 20$, and $0\le x_3\le 25$.