finding all solutions of an equation using counting lets say I have
$$ x_1 + x_2 + x_3 + x_4 = 17 $$
What are all the solutions for $$ x_i \ge 0? \quad \text{ where }  i=1,2,3,4$$
How about if $$ x_i \ge 0 \text{ ?} $$ And if $$ x_i \gt 1 \quad\text{ where } i =1,2,3,4$$
I tried following the example of the book. For the last one I got $$ C(4+10-1, 4-1) $$
No clue if it's correct. And confused on how to tackle the first two. Thanks.

Well this is a classic stars and bars problem. If $x_i \ge 0$ then you have:
$$\binom{17 + 4 - 1}{4-1} = \binom{20}{3} = 1140 \text{ solutions}$$
For the second problem write $x_i = 2 + k_i$, then the equation is reduced to $k_1 + k_2 + k_3 + k_4 = 9$, which can be easily solved simularly to the first problem.
