[Math] Number of integer solutions to a system of equations

combinatoricselementary-number-theory

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.

Best Answer

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}$$