How many 8-character passwords are there if each character is either A-Z, a-z, or 0-9, and where at least one character of each of the three types is used?
The complement of "at least one of each" is "either A-Z, a-z, or 0-9 is NOT used"
I defined a set |A|=62^8, all possible passwords. I then defined three more sets: B - those passwords without A-Z, C - those passwords without a-z, and D - those passwords without 0-9.
|B| = 36^8, |C|=36^8, and |D| = 52^8.
Then by counting the complement, |A| - |BUCUD| = |A|-|B|-|C|-|D| + |BinterC| + |BinterD| + |CinterD|.
|BintersectC| = Those without A-Z and without a-z = 10^8, etc.
Therefore I got $$62^8 - 36^8 - 36^8 - 52^8+ 10^8 + 26^8 + 26^8$$ as the answer.
Not sure if I counted my sets right, please let me know!