Counting: passwords

61 Views Asked by At

Sorry if this has been beaten to death.

A password can contain capital and lowercase letters, digits, and underscores.

$63^8$ total passwords, correct?

If we add the stipulation that the first character cannot be a digit-- why wouldn't the number of illegal passwords be $10*63^7$, resulting in $63^8-10*63^7$ legal passwords?

2

There are 2 best solutions below

2
On

Because there are $10$ options for the first character of the password if it starts with a digit; and for the rest of the characters, there are $63$ options still so $10 \cdot 63^7$ is the number of illegal passwords.

0
On

Your logic is correct for 8 digit passwords. For each digit, you could have $26*2+10+1=63$ choices. So, without restrictions,total number of passwords would be $63^d$ where d is the number of characters in the password. If the first character cannot be a digit, then we would only have $53$ choices for the first character, which then yields $53*63^{d-1}$ choices.