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.

Here you have a program in Visual Basic to be run in Excel, that lists the numbers for your first case.
Sub Macro1403106()
'
' Macro1403106
'
CONT = 1

For I = 0 To 17
For J = 0 To 17
For K = 0 To 17
For L = 0 To 17

Sum = I + J + K + L

If Sum = 17 Then
Cells(CONT, 1) = I
Cells(CONT, 2) = J
Cells(CONT, 3) = K
Cells(CONT, 4) = L
CONT = CONT + 1
End If

Next L
Next K
Next J
Next I

End Sub

With 1140 solutions as indicated by Stefan4024.
