Number of positive integral solutions Find the number of Positive integral solutions of $$15<x_1+x_2+x_3 \le20$$
Now, I know the formulae for similar problems without the inequality. However, I want to understand the basic concept or idea behind solving such types of problems. Please explain me how it is solved (maybe by taking the constant to be the number of objects and the variables to be the boxes.)
 A: The answer is
$${20\choose3}-{15\choose3}=1140-455=685$$
Here's a way to get it without splitting into cases:
First, note that the number of ways that $k$ positive integers can add up to be less than or equal to $N$ is the same as the number of ways that $k+1$ positive integers can add up to be equal to $N+1$.  Stars and bars says that this is equal to $N\choose k$.  In the present case, $k=3$, so $20\choose3$ counts the number of ways $3$ positive integers can have a sum less than or equal to $20$.  But we don't want to count the ones whose sum is less than or equal to $15$, so we subtract the stars-and-bars count for that.
A: We can bash this with generating functions.
The generating functions for all $x_i$ is $(x+x^2+ \cdots )$ so we need to find the coefficients of $\left( \frac{1}{1-x}-1 \right)^3 = \left( \frac{x}{1-x} \right)^3$.
We need to add the coefficients of $x^{16}, x^{17}, x^{18}, x^{19}, x^{20}$. Equivalently, we need the sum of the coefficients of $x^{13}, \cdots, x^{17}$ of $\frac{1}{(1-x)^3}$.
This is just $\dbinom{2+13}{13} + \dbinom{2+14}{14} + \cdots + \dbinom{2+17}{17} = 685$.
A: $\newcommand{\+}{^{\dagger}}
 \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{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
Following my previous answer:
\begin{align}
&\color{#44f}{\large\sum_{S = 16}^{20}{\pars{S + 2}\pars{S + 1} \over 2}}
=\half\sum_{S = 16}^{20}\pars{S^{2} + 3S + 2}
=\color{#44f}{\large 955}
\end{align}

Without 'the zeros':
  \begin{align}
&\color{#44f}{\large\sum_{S = 16 - 3}^{20 - 3}{\pars{S + 2}\pars{S + 1} \over 2}}
=\half\sum_{S = 13}^{17}\pars{S^{2} + 3S + 2}
=\color{#44f}{\large 685}
\end{align}

