find the total number of possible way to reach to a particular sum suppose you have given a sum like : 5.
we have to find the total number of possible way to reach to 5.
for example
1 + 1 + 1 + 1 + 1 = 5
2 + 1 + 1 + 1     = 5
1 + 2 + 1 + 1     = 5
1 + 1 + 2 + 1     = 5
1 + 1 + 1 + 2     = 5
2 + 2 + 1         = 5
2 + 1 + 2         = 5
1 + 2 + 2         = 5
1 + 1 + 3         = 5
1 + 3 + 1         = 5
3 + 1 + 1         = 5
2 + 3             = 5
3 + 2             = 5
1 + 4             = 5
4 + 1             = 5
5                 = 5
above is the total number of way to reach to a particular sum, which is nothing but : 16

(Related to stars and bars, but a bit more explicit).
Represent $5$ as $u\;u\;u\;u\;u$. 
Between any two $u$s you can insert or not insert a separator.  Once you have done this you will have uniquely determined an ordered sum to $5$.
For instance $u*u\;u\;u*u$ corresponds to $1+3+1$.  
Or conversely, $2+3$ corresponds to $u\;u*u\;u\;u$.
Since there are $4$ different possible separators to insert or not insert, there are $2^4$ ways to do the problem.
These ideas should generalize to other numbers than $5$.
