# Number of integer solutions to a system of equations

How many nonnegative integer solutions are there to the pair of equations $x_1 + x_2 + \ldots + x_6 = 20$ and $x_1 + x_2 + x_3 = 7$?

Is my reasoning to the above problem correct?

Take the number of solutions to the latter equation and multiply it to the number of solutions that results from the difference of the two equations. I figured this is because the solution to the former equation relies on the solution of the second solution.

Note: I expected something so elementary would have a duplicate, but I couldn't find one. Let me know if there is and I'll delete the problem.

-

Note that the number of non-negative integer solutions to \begin{align} x_1 + x_2 + x_3 + x_4 + x_5 + x_6 & = 20\\ x_1 + x_2 + x_3 & = 7 \end{align} is same as the number of non-negative integer solutions to \begin{align} x_4 + x_5 + x_6 &= 13\\ x_1 + x_2 + x_3 &= 7 \end{align} Now note that the two equations are independent and hence the number of solutions is $$\# \text{ of solutions to the first equation} \times \# \text{ of solutions to the second equation}$$
So does my reasoning not work? I imagined a tree, where 1 solution to the second equation results in $n$-many solutions in the first equation; hence why I took the product. –  AlanH Feb 4 '13 at 0:47
@Alan: You’re right, but the product that you need to take is the one in Marvis’s solution: each solution to the second equation uses up $7$ of the total of $20$ in the first equation, so your only freedom is to choose $x_4,x_5$, and $x_6$ so as to make their sum $20-7=13$. Your $n$-many is therefore $\binom{13+3-1}{3-1}$-many. –  Brian M. Scott Feb 4 '13 at 1:00