How many passwords of length 8 with digits non-decreasing sequence and start with 5? Passwords have length of 8 characters.
The usable characters are the 10 digits 0,1,2,3,4,5,6,7,8,9.
How many passwords with digits only have non-decreasing sequence of digits and start with 5?
The sequence of eight digits $D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8$ is non-decreasing if $D_1 \leq D_2 \leq D_3 \leq D_4 \leq D_5 \leq D_6 \leq D_7 \leq D_8$
How can we solve this using combinations in a way that takes into account the possibilities of using any number of digits 5, 6, 7, 8 and 9.
 A: Consider them case-by case.
Obviously you can only use 5,6,7,8,9 and you have 7 slots. If you use only one integer (this is allowed), you have 5 passwords. Then, consider 2 integers. How many combinations are there? It is $\binom{5}{2}$. Now that you've chosen them (e.g. 5 and 6), how many non-decreasing ways to put them together? This is stars-and-bars with 1 bar (new integer's starting position) and 6 stars. Then for 3 integers: $\binom{5}{3}$, you have 2 bars and 5 stars, and so on. Can you take it from here?     
A: One way to choose a password is to just choose where the strict increases in the password are, and how big they are. For example, the password 
(5, 5, 5, 7, 7, 7, 8, 8)
has strict increases after positions 3 and 6, the first being a jump of size 2, and the second of size 1. Also, any sequence of positions to increase at, and jump sizes at those sites of total height at most 4 -- since we can't use digits bigger than 9 -- corresponds to a password. 
One way to count these guys is to split them up first by what the last digit in the password is, i.e. how much total 'jumping' we did, and then by partitions of that number. 
For example, say the last digit is 8. Then we jumped by 3 total: the three partitions of 3 are
$3 = 1 + 1 + 1 = 2 + 1,$
and the jumps could go in any of 7 possible positions (after any of the digits in the password except the last). Thus, in this case, there are 
$\binom{7}{1} + \binom{7}{3} + 2 \binom{7}{2} = 84$ 
possible passwords.
Just do this for the other possible total jump heights 1, 2 and 3: the counts come out to 
(Total jump = 0) One password only: all 5's. 
(Total jump = 1, only partition of 1 is 1) $\binom{7}{1} = 7$.
(Total jump = 2, partitions of 2 are 2 and 1 + 1) $\binom{7}{1} + \binom{7}{2} = 28$.
(Total jump = 4, partitions of 4 are 4, 3 + 1, 2 + 2, 2 + 1 + 1, 1 + 1 + 1 + 1) $\binom{7}{1} + 2 \binom{7}{2} + \binom{7}{2} + \binom{7}{1}\binom{6}{2} + \binom{7}{4} = 210.$
Thus there are a total of $1 + 7 + 28 + 84 + 210 = 330$ such passwords. 
A: Having picked 5 first, you have to choose a $7$ element multiset from $5$ integers for the remaining positions. And for each of these multisets, there is only one way to arrange them in nondecreasing order. For example the $7$-tuple $(5,5,6,6,7,8,9)$ is uniquely represented by the multiset $\{9,5,5,7,8,6,6\}$ (or $ \{5,6,5,6,7,8,9\} $ - order does not matter).
So count the multisets instead.
$$
\binom{5+7-1}{7}
$$
To see why this is true, imagine $5+7$ bars divided by $7-1$ bars.
