# Counting numbers of possible password

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?

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

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$.