[Math] 8 character password

combinatorics

Everyone is asked to create a new 8 character password with at least one number and exactly one special character with the remaining characters being lowercase letters. How many possible passwords are available?

I don't get how to find with restrictions.

26 letters
10 numbers
9 special characters.

Please help me.

Best Answer

We first count the number of 8-character passwords with no numbers at all, but exactly one special character. We

  • Choose the special character: $9$ ways
  • Place it: $8$ ways
  • Choose a letter for each of the remaining positions: $26^7$ ways

So we can do it in $9 \cdot 8 \cdot 26^7$ ways. Now, we count the number of 8-character passwords with exactly one special character and no restrictions on the number of numbers. We

  • Choose the special character: $9$ ways
  • Place it: $8$ ways
  • Choose a letter or a number for each of the remaining positions: $(26 + 10)^7$ ways

The number of such passwords is thus $9 \cdot 8 \cdot (26+10)^7$. If we want to count the number of passwords with at least one number, we subtract the number of passwords with no number from the total number of passwords. Hence the answer is $$9 \cdot 8 \cdot (26+10)^7 - 9 \cdot 8 \cdot 26^7 = 5063929482240$$