Fred needs to choose a password for a certain website. Assume that he will choose an 8-character password, and that the legal characters are the lowercase letters a, b, c, . . . , z, the uppercase letters A, B, C, . . . , Z, and the numbers 0, 1, . . . , 9. (a) How many possibilities are there if he is required to have at least one lowercase letter in his password? (b) How many possibilities are there if he is required to have at least one lowercase letter and at least one uppercase letter in his password? (c) How many possibilities are there if he is required to have at least one lowercase letter, at least one uppercase letter, and at least one number in his password? (Introduction to Probability, Blitzstein and Nwang, p.38)
Part a) is no problem, but I don't know how to define the events for b) and c). Any hint for defining the events to be able to use inclusion-exclusion?
EDIT1
Here is how I did part a).
The question is how many ways are there to choose a password having at least one lowercase letter.
- Define $A_i$ as the set of all passwords with lowercase letter at the $i^{th}$ position.
- $|A_i| = 26^1 \; 62^{8-1}$
- $|A_i \cap A_j| = 26^2 \; 62^{8-2}$
- $|\cap_{i=1}^8 A_i| = 26^i \; 62^{8-i}$
\begin{equation} |\cup_{i=1}^8 A_i| = \sum_{i=1}^8 \binom{8}{i} 26^i \; 62^{8-i} (-1)^{i+1} \end{equation}
I would like to solve the other parts in exactly the same manner, however, I don't know how to define my sets $A_i$ etc. in this case.
EDIT2
I try part c) with @AlexR's approach:
$|C| = |\Omega| - (|\neg U| + |\neg L| + |\neg N|) + (|\neg U \cap \neg L| + |\neg U \cap \neg N| + |\neg L \cap \neg N|) - |\neg U \cap \neg L \cap \neg N| = 62^8 - (36^8 + 36^8 + 52^8) + (10^8 + 26^8 + 26^8) - 0^8$
The probability of this to happen would be $0.7312$.