Discrete Math - Finding the integer solutions of an inequality For couple of hours I'm contemplating on this question:
How many non-negative integer solutions of the inequality $x_1 + x_2 + x_3 + \ldots + x_6 < 10$?
I've come up with a solution with the aid of my notes:
By adding x$_7$ which is greater than 0 we can rewrite as,
$x_1 + x_2 + x_3 + \ldots + x_6 +x_7= 10$ where $0 \leq x_i, \space 1 \leq i \leq 6$ and  $0 < x_7$
so we can supply $y_i=x_i$ and $y_7=x_7 - 1$ 
Then the equation becomes, $$y_1+y_2+y_3 + \dots +y_6+y_7 = 9$$ This is $C(15, 9)$
Although it is all fine, the point that I couldn't understand is: Why are we supplying a new variable and subtracting $1$ from the one that we initially added in?
 A: The argument boils down to the following: 
Since $x_1+...+x_6$ is less that $10$, it is missing something from $10$. Denote this quantity by $x_7$. By doing this you transformed the inequality into an equation, which in this case (and actually often) is easier to solve than an inequality.
Now for the second part: since you need $x_1+...+x_6$ to be strictly less than $10$, it follows that $x_7 \geq 1$. But the technique which you learned (stars and bars probably) works for variables which are non-negative, it doesn't work with restrictions of this form . To fix this note that $x_7-1 \geq 0$, and denote this by a new variable.
It would had probably been more intuitive to observe that $x_1+..+x_6 <10$ in integers is equivalent to $x_1+..+x_6 \leq 9$. Now denote by $x_7$ (or $y_7$) the missing quantity from $9$, which could be $0$, and reduce the problem directly to the second equation.
A: Initially $y_7$ represents the "slack" between the sum of the first six and the upper number $10.$ That is (first six) + $x_7$ = 10. Since you want the first six to add to less than 10, that restricts $x_7$ to be positive, hence $x_7>0.$ But now the constraints of nonnegative only apply to the first six, while the seventh must be positive. By subtractiong $1$ from the $y_7$ its restriction becomes nonnegative like the others, and also one subtracts 1 from the right side which was 10 to get the new right side of 9.
A: To answer your question as to:$$\text{Why are we supplying a new variable and subtracting $1$ from the one that we initially added in?}$$

My answer (as to the way I see it) is simple: it restricts the combinations of integer solutions that does not satisfy the inequality.
Consider a simpler case where we have
$$x_{1}+x_{2}<5$$ where $0 \leq x_{i}, 1 \leq i \leq 2$. Now, we let $y_{i}=x_{i}$ and $y_{2}=x_{2}-1$, rewriting the equation as
$$y_{1}+y_{2}=4.$$
For this equation, we have $\displaystyle{5 \choose 4}=5$ integer solutions. These combinations of integer solutions, for $y_{1}+y_{2}$ are 4+0, 1+3, 2+2, 3+1, and 0+4. You can see that the inequality holds for all these given combinations of integer solutions. But by not subtracting a $1$ for the new variable added in, the inequality breaks as there are combinations of integers equal to $5$, such as $5+0$, $4+1$, ...,$0+5$.
So in your case, supplying a new variable and subtracting $1$ allows for the combinations of integer solutions that satisfy the inequality. By subtracting $1$ from both sides, you can see that you are solving for the combinations of integer solutions that are equal to $9$, hence will never exceed $10$.
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
The solution is given by $\ds{\pars{~\mbox{note that}\ 0 < a < 1~}}$:
\begin{align}&\color{#66f}{%
\sum_{S=0}^{9}\ \sum_{x_{1}=0}^{\infty}\ldots\sum_{x_{6}=0}^{\infty}\delta_{x_{1} + \cdots + x_{6}\,,\,S}}\ =\
\sum_{S=0}^{9}\ \sum_{x_{1}=0}^{\infty}\ldots\sum_{x_{6}=0}^{\infty}
\oint_{\verts{z}=a}\frac{1}{z^{-x_{1} - \cdots - x_{6} + S + 1}}
\,\,\frac{\dd z}{2\pi\ic}
\\[5mm]&=\oint_{\verts{z}=a}\sum_{S=0}^{9}\frac{1}{z^{S + 1}}
\pars{\sum_{x=0}^{\infty}z^{x}}^{6}\,\,\frac{\dd z}{2\pi\ic}
=\oint_{\verts{z}=a}\frac{1}{z}\,\frac{1 - 1/z^{10}}{1 - 1/z}
\frac{1}{\pars{1 - z}^{6}}\,\,\frac{\dd z}{2\pi\ic}
\\[5mm]&=\oint_{\verts{z}=a}\
\frac{1}{z^{10}\,\pars{1 - z}^{7}}\,\,\frac{\dd z}{2\pi\ic}\ -\
\overbrace{\oint_{\verts{z}=a}\
\frac{1}{\pars{1 - z}^{7}}\,\,\frac{\dd z}{2\pi\ic}}^{\ds{=\ \dsc{0}}}
=\sum_{k=0}^{\infty}\binom{-7}{k}\pars{-1}^{k}
\oint_{\verts{z}=a}\frac{1}{z^{10 - k}}\,\frac{\dd z}{2\pi\ic}
\\[5mm]&=\binom{-7}{9}\pars{-1}^{9}
=\binom{7 + 9 - 1}{9}\pars{-1}^{9}\pars{-1}^{9}=\binom{15}{9}
=\color{#66f}{\large 5005}
\end{align}
