# Number of 8-digit Passwords with at least 1 digit and/or 1 symbol

I think I know how to calculate the number of 8-digit passwords with 1 digit or 1 symbol. The sets are lowercase (26), uppercase (26), symbols (32), digits(10). That means there are $(26 + 26 +32 + 10)^8 = 94^8$ total passwords and I just have to remove the all letter combinations $(52)^8$, so $94^8 - 52^8$.

For the number of passwords with a digit and a number, I am confused.

All Combos: $94^8$

All Letters: $52^8$

Letters + Digits: $62^8$

Letters + Symbols: $84^8$

I think I need inclusion/exclusion. I know that I am removing too many numbers, if I just subtract $94^8 - 52^8 - 62^8 - 84^8$, but I'm not sure how to build the intersections.

## 2 Answers

The passwords which aren't allowed are:

i) those with no symbol, but at least one digit: there are $62^n-52^n$ of these
ii) those with no digit, but at least one symbol: there are $84^n-52^n$ of these
iii) those with no digits or symbols: there are $52^n$ of these.

Overall, therefore, $62^n-52^n+84^n-52^n+52^n=62^n+84^n-52^n$ aren't allowed, so $94^n-84^n-62^n+52^n$ are allowed.

Hint You're right that inclusion-exclusion is the right tool here: If $D$ is the set of words built out of letters and digits and $S$ that of words built out of letters and symbols, then by definition the set of disallowed words is precisely $D \cup S$. By inclusion-exclusion, the number of such words is $$|D \cup S| = |D| + |S| - |D \cap S|,$$ but by definition a word is in $D \cap S$ iff it is built only of letters, and you know how many of these there are, too.