# Find the number $r$ of of solutions in integers of the equation $a + b + c = 25$…

...where $a$ is at least 2 and at most 4, $b$ is at least 3 and at most 6, and $c$ is at least 4 and at most 8.

In this solution, I cannot understand this part:

The required number $r$ is the number of solutions in integers of the revised equation $x + y + z = 16$, where the upper bounds for x, y, and z are 2, 3, and 4.

I tried adding the numbers, like $2+3+4$, but I don't know how the book got from

$$a + b + c = 25; 2\leq a\leq4, 3\leq b\leq6, 4\leq c\leq8$$ to $$x + y + z = 16; x\leq 2, y\leq3, z\leq4$$

I can see that the upper bounds for $x, y,$ and $z$ are the lower bounds for $a, b,$ and $c$, but how did the book change the 25 into a 16?

-
in fact, the upper bound of $x,y,z$ are upper bounds of $a,b,c$ minus lower bounds of them. –  jouge Jul 12 '13 at 18:32

Make the substitutions $x=a-2, y=b-3, z=c-4$ then $$x+y+z=(a-2)+(b-3)+(c-4) = a+b+c-(2+3+4)=25-9=16$$
Rick Decker has given the straightforward algebraic approach; here’s another way to think about it. Solutions in non-negative integers to $a+b+c=25$ correspond in a one-to-one fashion with ways to distribute $25$ identical, indistinguishable balls among $3$ boxes labelled $A$, $B$, and $C$: $a$ is the number of balls in Box $A$, $b$ the number in Box $B$, and $c$ the number in Box $C$. Now suppose that you are required to put at least $2$ balls into Box $A$, at least $3$ into Box $B$, and at least $4$ into Box $C$: the number of ways to do this is the number of integer solutions to $a+b+c=25$ that satisfy the conditions $a\ge 2$, $b\ge 3$, and $c\ge 4$. In other words, it’s your problem (ignoring, for the moment, the upper limits).
Since the balls are completely indistinguishable, so that it doesn’t matter which balls end up in which box, but only how many, we might as well begin simply by putting $2$ balls into Box $A$, $3$ into Box $B$, and $4$ into Box $C$. That leaves $25-(2+3+4)=16$ balls to be distributed, and they can be distributed arbitrarily amongst the three boxes: no matter how we distribute them, the minimum requirements are met, and every way of meeting the minimum requirements can be produced in this fashion. Thus, at this point we’re really just counting the ways to distribute $16$ balls amongst the $3$ boxes. In terms of solutions to equations, this is just counting the number of solutions in non-negative integers to the equation $a'+b'+c'=16$.
Note that if $a,b$, and $c$ are the numbers of balls in the boxes including the ones that we put there initially to meet the minimum requirements, then $a'=a-2$, $b'=b-3$, and $c'=c-4$: we’ve essentially made the substitution that Rick suggests.