0

I want to find the possible amount of combinations of a password that is 5 characters long, and each character could either be a lowercase letter or a digit. Also, each password should start with a lower case letter and contain at least two digits. The answer I got was 26 * 10 * 10 * 36 * 36.

Am I correct?

tom786
  • 59
  • 1
    No, that is not correct. That is the number of six character passwords whose first character is a letter, whose second character very specifically is a number, whose third character very specifically is also a number, and whose fourth, fifth, and sixth characters are anything. Ignoring the fact that the length of the password was wrong, you ignored the possibility of the second and/or third character not being a number such as the password pwd42 – JMoravitz Mar 10 '21 at 18:30
  • That does not seem right. There are only $5$ characters. Also there are $6$ ways to choose places for $2$ digits. – Math Lover Mar 10 '21 at 18:31
  • For a corrected approach, if you prefer to do it directly consider breaking into cases based on the number of digits actually used. Pick the locations of the digits in the password, then for each position designated to be a digit choose the digit and for each position designated to be a letter choose the letter. Alternatively, count the passwords who don't work because they had zero or only one digit and subtract that amount away. – JMoravitz Mar 10 '21 at 18:32
  • I redid my equation and got this : 36^5 - 26^5 - (26^4 * 10 *4). But I don't think this accounts for the password starting with a lowercase letter. – tom786 Mar 10 '21 at 18:48

1 Answers1

1

Given there are only $5$ characters you can do this directly by working individual cases.

Case $1$: There are exactly two digits out of last four characters -

$\displaystyle 26 \cdot {4 \choose 2} \cdot 10^2 \cdot 26^2$

Case $2$: There are exactly three digits out of last four characters -

$\displaystyle 26 \cdot {4 \choose 3} \cdot 10^3 \cdot 26$

Case $3$: Last four characters are all digits -

$\displaystyle 26 \cdot 10^4$

Add all of the arrangements from the three cases.

You can also calculate by subtracting cases where there are no digits or only one of the last four characters is a digit, which is given by -

$\displaystyle 26 \cdot (36^4 - 26^4 - 4 \cdot 10 \cdot 26^3)$

Math Lover
  • 51,819