Probability of Generating A Specific Password A program generates a password that is 9 characters long. But for the password to be valid on a certain website, it needs to have at least one lower-case letter, at least one digit, and at least one of these special characters: (!, @, #, %). I need to find the probability that a program generates a valid password. Assuming, that the password is generated only using lower case letters, those 4 special symbols, and digits.
If we let A = The event the program generates a letter, B = the event a symbol is generated, and C = a digit being generated, I thought that the correct way to approach this problem would be to find the probability of all of these occurring.
Since the program was 40 different characters it could choose from, (26 letters, 4 special characters, 10 digits) I found the Pr(A and B and C) to be about 0.016 or 1.6%. Would this be the correct logic? Would I then take this value of 0.016 and multiply it by 9, to fit all 9 character slots in the password?
 A: We could use inclusion-exclusion on the complement event.
The complementary event is having no lower case letters (call this $A$) or no digits (call this $B$) or no special characters (call this $C$). Now by inclusion-exclusion, we have
$$P(A\cup B\cup C)=P(A)+P(B)+P(C)-P(A\cap B)-P(B\cap C)-P(A\cap C)+P(A\cap B\cap C).$$
Can you finish?
A: With $A = \;alphabet\; = 26,\;\; B = \;symbol\; =4,\;\; C = \; digit\; = 10,$
since only probability has been asked for, we can us combinations with inclusion-exclusion to count favorable ways.
Since there are only $4$ symbols in a password of length $9$, we count possibilities with  exactly $1,2,3,4$ symbols and from the balance we exclude cases where one of the remaining types is excluded, thus
favorable ways with exactly one symbol included
$= \dbinom41\left[\dbinom{36}8 - \left(\dbinom{26}8 + \dbinom{10}8\right)\right]$
Compute similarly with $2,3,4$ symbols and add up to get total favorable ways
Finally, divide the total favorable ways by total ways, viz $\dbinom{40}9$  to get the Pr
