# r-Combinations with repetition

How many different solutions does the following inequality have, in which $x_1$ and $x_2$ must be non-negative integers and $x_3$ must be a positive integer?

$x_1 + x_2 + x_3 \leq 13$

Struggling with this question. I know how to do it if all $x$'s are non-negative but the one positive $x$ is throwing me off.

Hint:

We can make a change of variables and use a throwaway variable to make things easier.

Let $y_1=x_1$, let $y_2=x_2$, let $y_3=x_3-1$ and let $y_4=13-x_1-x_2-x_3$.

What can you say about each of the values of $y_1,y_2,y_3,y_4$? What can you say about the sum $y_1+y_2+y_3+y_4$?

We have changed the problem now to the related problem of counting non-negative integer solutions to the system: $\begin{cases} y_1+y_2+y_3+y_4=12\\0\leq y_1\\0\leq y_2\\ 0\leq y_3\\ 0\leq y_4\end{cases}$ which should be in a known form.

• The sum is 12. I assume the $x3 -1$ is to account for the fact we aren't including $x3 = 0$? – BlackBruceLee Oct 29 '17 at 22:01
• @BlackBruceLee quite. It allows $y_3$ to equal zero despite $x_3$ not being able to equal zero. The sum is indeed twelve. The use of $y_4$ was to replace the $\leq$ sign in the original problem with a $=$ in the new problem (as that is the form that most people learn first and are more comfortable with). – JMoravitz Oct 29 '17 at 22:03
• Do you recognize then what problem you can solve using the $y$'s instead of the $x$'s? Do you recognize that the number of solutions to this new problem is in fact the same number of solutions you have to your original problem? And finally, do you recognize how to solve the new problem? – JMoravitz Oct 29 '17 at 22:04
• Is it $(12+4-1)C3$? So $15C3$ – BlackBruceLee Oct 29 '17 at 22:08
• @BlackBruceLee Correct. Good job. – JMoravitz Oct 29 '17 at 22:08