Find the number of non-negative integer solutions of $x+y+z=14$ given that $0 \leq x,y,z \leq 9$

I know that similar questions have been answered before. Anyway, this can be solved using generating sequences or using star and bar argument along with PIE.

My question is a bit different. I feel like this can also be somehow manipulated and solved with the help of a dummy variable. Please help me with that, if that's possible.


1 Answer 1


See that when you make $x\ge 9$ others are always less than $9$. So count all possiblities than count possiblites when one of the numbers is greater than $9$ and multiply it by $3$ and subtract from total.

So let $N$ be the number of solutions to $x+y+z=14: x,y,z\ge 0$

let $n$ be the number of solutions to $x'+y+z=5:x', y,z\ge 0$

Answer: $N-3n$

  • $\begingroup$ Be careful. If $x > 9$, then $x - 10$ is a nonnegative integer. If we let $x' = x - 10$, we obtain $x' + y + z = \color{red}{4}$. $\endgroup$ Jun 15, 2018 at 9:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .