How many solutions in the nonnegative integers does $a + b + c = 30$ have if $a, b, c \leq 20$?

117 Views Asked by At

Find the number of ordered triples of nonnegative integers $a, b,$ and $c$ such that $a+b+c=30$ and $a, b,$ and $c$ are all less than or equal to $20$. Can that result be generalized?

I adapted a combinatorics problem to create that question The original problem was, "Three different boxes have $20$ bottles each. All the bottles in one box have the same color, but bottles of different boxes have different colors. How many ways can you pick the bottles from the boxes so that you pick $30$ in total?"

1

There are 1 best solutions below

4
On

First, let's count all of the possibilities of $a,b,c$, not including the constraint of $\leq20$. We can use stars and bars to find the total number of ways to pick $a,b,c$ is ${32\choose2}=496$.

Next, we know that at most, one of the numbers can be greater than 20 at a time. So, let's count the number of ways that can happen. We have three variables to choose from to be greater than 20, and then, we can assign 21 of the "units" to that variable to enforce it being greater than 20.

Hence, our new constraint is $a+b+c=9$, which by stars and bars is ${11\choose2}=55$.

So, our final answer is $$496-3\cdot55=\color{red}{331}$$