3
$\begingroup$

Assume a computer password consists of 8 to 10 letters and/or digits. (Remember, a lower-case letter is different from the corresponding upper-case one.)

How many different passwords are possible if a password must include at least one uppercase letter, one lower-case letter, and one digit?

$\endgroup$
  • 1
    $\begingroup$ How many letters are allowed? The english alphabet? $\endgroup$ – Daniel R Sep 20 '13 at 8:48
  • $\begingroup$ Are you familiar with the method of Inclusion-Exclusion? $\endgroup$ – Gerry Myerson Sep 20 '13 at 8:51
  • $\begingroup$ English alphabet, $\endgroup$ – needhelp Sep 20 '13 at 9:15
  • 1
    $\begingroup$ And Yeah I think I'm familiar with Inclusion-exclusion $\endgroup$ – needhelp Sep 20 '13 at 9:16
2
$\begingroup$

Unfortunately, we need to do separate counts for length $8$, $9$, and $10$, and add. But the calculations are very similar. We do the case length $9$.

There are $62$ symbols that can be used. It seems that repetitions are allowed, so there are $62^9$ strings of length $9$.

But some of these strings are not valid. There are $52^9$ "bad" strings with no digit, $36^9$ with no lower-case letters, and $36^{9}$ with no upper-case letters.

However, if we find the sum $52^9+36^9 +36^9$, we will be "double counting" the all digits strings, also double-counting the all lower-case strings, also double-counting the all upper-case strings. There are respectively $19^9$, $26^9$, and $26^9$ of these. Thus we end up with a total of $$62^9 -52^9-36^9-36^9+10^9+26^9+26^9$$ valid passwords of length $9$.

$\endgroup$
  • $\begingroup$ i think it should be "double counting" the all digits strings, also double-counting the all lower-case strings, also double-counting the all upper-case strings. There are respectively 2*(10^9), 2*(26^9), and 2*(26^9) $\endgroup$ – G4uKu3_Gaurav Oct 1 '17 at 4:41
  • $\begingroup$ Then valid passwords of length 9 should be: 62^9−52^9−36^9−36^9+2(10^9)+2(26^9)+2(26^9) $\endgroup$ – G4uKu3_Gaurav Oct 1 '17 at 4:44

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.