0
$\begingroup$

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?

$\endgroup$
  • 1
    $\begingroup$ The question for the answer you gave in your (now deleted) comment just now ($53\cdot 63^7+53\cdot 63^6+\dots+53$) is if the password is allowed to be of any length up to 8 characters in length. There are $63^8$ passwords of exactly length $8$. There are $63^7$ passwords of exactly length $7$, etc... giving $63^8+63^7+63^6+\dots+63$ passwords of any length $1$ through $8$. You can use your method to get $10\cdot 63^7+10\cdot 63^6+10\cdot 63^5+\dots+10$ invalid passwords which you need to subtract if you are answering the question for passwords of any length up to 8 rather than only 8. $\endgroup$ – JMoravitz Mar 15 '18 at 20:42
  • 1
    $\begingroup$ Note also: $63^8-10\cdot 63^7 = 53\cdot 63^7$ $\endgroup$ – JMoravitz Mar 15 '18 at 20:44
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ I am not sure how what you're saying disagrees with the logic in my post... $\endgroup$ – Robert Hergenroder II Mar 15 '18 at 20:39
  • $\begingroup$ I don't understand why does it disagree. Number of illegal passwords are the same as in your post so what is the problem? $\endgroup$ – ArsenBerk Mar 15 '18 at 20:41
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.