TITLE: selection of balls of three colors with restrictions
QUESTION [7 upvotes]: I have asked a similar question here and answers were very helpful. I tried doing similar questions and could solve them comfortably. However, I myself came up with a question like this and wondering how to solve this.
Suppose there are 20 black balls, 10  yellow balls and 5 brown balls. Balls of same color are identical. Order of selection does not matter.

How many ways can a selection of 15 balls be made?
How many ways can a selection of 15 balls be made if 2 brown must be selected always?

My approach
(1) number of solutions of $x_1+x_2+x_3 = 15$ with $0\le x_1\le 20; 0 \le x_2 \le 10; 0 \le x_3 \le5$ is the solution. Is this right? if so, is there any formula for this?
(2) Select the 2 brown balls in (only 1 way) and then find number of solutions of  $x_1+x_2+x_3 = 13$ with $0\le x_1\le 20; 0 \le x_2 \le 10; 0 \le x_3 \le3$
Please give directions on how to approach similar problems. thanks.

REPLY [5 votes]: Your approaches to both problems are correct. 
Since balls of the same color are indistinguishable, the number of ways $15$ balls can be selected from $20$ black balls, $10$ yellow balls, and $5$ brown balls is the number of nonnegative integer solutions of the equation 
$$x_1 + x_2 + x_3 = 15 \tag{1}$$
subject to the restrictions $x_2 \leq 10$ and $x_3 \leq 5$.  Note that since $20 > 15$, we do not need a restriction on the number of black balls. 
If there were no restrictions, the number of solutions of the equation 
$x_1 + x_2 + x_3 = 15$ would be equal to the number of ways of inserting two addition signs in a row of $15$ ones, which is $\binom{15 + 2}{2} = \binom{17}{2}$ since we must select which two of the seventeen symbols ($15$ ones and two addition signs) are to be addition signs.
From these, we must remove those solutions in which $x_2 > 10$ or $x_3 > 5$.  Note that it is not possible for both of these conditions to hold simultaneously since $11 + 6 = 17 > 15$.  
Suppose $x_2 > 10$.  Let $y_2 = x_2 - 11$.  Then $y_2$ is a nonnegative integer.  Moreover, substituting $y_2 + 11$ for $x_2$ in equation 1 yields
\begin{align*}
x_1 + y_2 + 11 + x_3 & = 15\\
x_1 + y_2 + x_3 & = 4
\end{align*}
Thus, the number of solutions of equation 1 in which $x_2 > 10$ is equal to the number of ways two addition signs can be placed in a row of four ones, which is $\binom{4 + 2}{2} = \binom{6}{2}$.  
Now, suppose $x_3 > 5$.  Let $z_3 = x_3 - 6$.  Then $z_3$ is a nonnegative integer.  Moreover, substituting $z_3 + 6$ for $x_3$ in equation 1 yields
\begin{align*}
x_1 + x_2 + z_3 + 6 & = 15\\
x_1 + x_2 + z_3 & = 9
\end{align*}
Thus, the number of solutions of equation 1 in which $x_3 > 5$ is the number of ways in which two addition signs can be placed in a row of nine ones, which is $\binom{9 + 2}{2} = \binom{11}{2}$.  
Hence, the number of ways $15$ balls can be selected from $20$ indistinguishable black balls, $10$ indistinguishable yellow balls, and $5$ indistinguishable brown balls is 
$$\binom{17}{2} - \binom{6}{2} - \binom{11}{2}$$
which agrees with the answer ml0105 obtained using generating functions.
You can apply the same method to solve the second problem you posed.