What is the number of solutions of the equation $x_1+x_2+\cdots+x_{10} = 100$ in positive integers not exceeding 30? (inclusion-exclusion principle) [duplicate]

Possible Duplicate:
Enumerating number of solutions to an equation

Determine the number of solutions of the equation $x_1+x_2+\dots+x_{10} = 100$ in positive integers not exceeding $30$.

Hint: First, ﬁnd how many solutions this equation has if all $x_i$ are positive integers and one of them, say $x_1$, is constrained to be $> 30$.

To do this, consider numbers $x_1 − 30, x_2, x_3, \dots, x_{10}$.

Second, for a subset $S$ of $\{1, 2, \dots , 10\}$ ﬁnd how many solutions the equation has if all $x_i$ are positive integers and in addition $x_j > 30$ for all $j \in S$.

Third, apply the Inclusion-Exclusion Principle. Notice what happens if $|S| \ge 4$.

-

marked as duplicate by Brian M. Scott, EuYu, Gerry Myerson, Did, TMMOct 29 '12 at 9:42

The method is fully explained in this answer to a similar problem, and a more general result may be found in this answer. – Brian M. Scott Oct 29 '12 at 5:34

The equation $$x_1+x_2+...+x_{10}=100$$ with condition $1\leq x_i \leq 30$, $i\in\{1,2,...,10\}$ is equivalent with this one $$y_1+y_2+...+y_{10}=90$$ with conditions $0\leq y_i=x_i-1 \leq 29$, $i\in\{1,2,...,10\}$. Now we use formula
$${\binom{m}{k}}_{s}=\sum_{i=0}^{m}(-1)^{i}\binom{m}{i}\binom{m+k-si-1}{m-1}\,$$
in present case we have that $k=90,s=29,m=10$