Discrete math and integer solutions problem How do we find the number of nonnegative integer solutions of the inequality:
$$x_1 + x_2 + \cdots + x_6 < 10\text{ ?}$$
Answer is $5005$, can someone elaborate and show me the steps required to solve this discrete math problem?
 A: We have $9$ identical candies, and there are $6$ kids wanting candy. How many ways are there to distribute $9$ or fewer candies between the $6$ kids?
Equivalently, imagine that there is a $7$-th kid who will get any lefover candies. The number of ways to give out $9$ or fewer candies to $6$ kids, with some possibly getting $0$ candies, is the number of ways to distribute $9$ candies among $7$ kids. 
This is a standard Stars and Bars problem that you are likely familiar with, perhaps in the less sweet form of counting the solutions of $x_1+x_2+\cdots +x_7=9$. 
A: HINT
Imagine the $x_1,x_2,\ldots,x_6$ as letter boxes that you have to put letters into. 
Let $x_7$ be a bin, where the letters you post don't count for anything.
You have nine letters to post and seven boxes to post them in.
If you put all nine in $x_7$ then $x_1+x_2+\cdots+x_6=0$. 
If you put eight in $x_7$ then $x_1+x_2+\cdots+x_6=1$. 
If you put seven in $x_7$ then $x_1+x_2+\cdots+x_6=2$.
How many ways are there of posting nine letters in seven boxes, when order doesn't matter?
A: The number of solutions is the sum of the solutions of the equations:
$$\sum_{i=1}^6 X_i=j,j=0,\ldots,9$$
The number of solutions of each one is $\binom{j+6-1}{6-1}$ (according with this) so the total is:
$$\sum_{j=0}^9 \binom{j+5}{5} $$
A: Suppose we wanted to know the number of integer solutions of $x_1 + x_2 + ... + x_n = k$.  This is equivalent to the combinatorics question "How many ways are there to distribute $k$ indistinguishable balls into $n$ distinguishable boxes?".  It is a well-known combinatorics theorem that the answer to this question is $\binom{n+k-1}{k}$.  
Therefore, the total number of solutions is going to have to take into account the number of possibilities for $0$ balls, $1$ ball, and so forth up to $9$.  Thus, the following expression gives us what we want:
$$\sum_{k = 0}^9 \binom{k + 5}{k}$$
