How many non-decreasing sequences of $7$ decimal digits are there? ($3334559$ and $0223448$ are two examples).
Solution:
If we add a $0$ to the beginning and a $9$ to the end, every sequence of $7$ nondecreasing decimal digits defines a unique sequence of $8$ non-negative gaps which must sum to $9$ (e.g. for $3334559$ the gaps are $3+0+0+1+1+0+4+0 = 9$, and for $0223448$ the gaps are $0+2+0+1+1+0+4+1 = 9$). We need $7$ separators to count the partitions (the digits themselves separate the gaps), and we then find that there are $\binom{9+7}{7} = 11,440$ of them.
I am having some trouble in understanding the very first statement of this solution, in spite of the given example. I just couldn't understand what they exactly meant there. Could anybody explain this to me more lucidly?
However,the second sentence is consistent to the stars and bars idea and I have no doubt in understanding it.
PS:This is the #$6$ problem from here.
Added:
I guess now I have understood the trick, but this seems something new to me. I was wondering how to approach this problem in different way? Any ideas?