2
$\begingroup$

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.

  • 1
    use stars-and-bars2017-02-18
  • 0
    I'm new here; I don't understand why this is flagged as off-topic. Reading [help/on-topic] did not help.2017-02-19

3 Answers 3

1

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.

  • 0
    I believe this is the correct answer, and is much simpler than how I solved to get 330.2017-02-18
1

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?

1

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.

  • 0
    How do you factor in the different options of numbers with the same jumps, eg. 55566677 and 55577788?2017-02-18
  • 0
    I think these are both taken care of: the first sequence corresponds to jumps at positions 3 and 6, and the partition 2 = 1 + 1. The second corresponds to the same positions of jumps, but the partition 3 = 2 + 1. I'm not sure why I'm getting a different answer from @Akay, whose solutions is much simpler anyway...2017-02-18
  • 0
    I believe that (11C7) or 330 is the correct answer.2017-02-18
  • 0
    I follow your logic with the jumps but I still think you are forgetting to chose the numbers following 5.2017-02-18
  • 0
    I had a slight miscalculation, I think it is right now. But again, @Akay's method is clearly better XD2017-02-18
  • 0
    Yes your solution looks good now.2017-02-18