How to find probability of generating a valid password with multiple conditions? A password has exactly $8$ characters. Available are $26$ letters, $10$ digits and $6$ special characters. A valid password must have at least $2$ letters, $2$ digits and $2$ special characters and no character can be repeated.
If a string of $8$ characters is randomly generated, find the probability that it is a valid password.

Yeah, the only thing I got so far is:
Total ways of generating passwords $= 42^8 $
I've tried some things (like count all illegal combinations), but that has so many problems. I don't even know how to approach this problem.
 A: I think in this case it's probably easier to count legal combinations, since there are a lot of restrictions on what is legal (so lots of different ways to be illegal).
There are only a few cases for legal combinations:


*

*4 letters, 2 digits, 2 special

*3 letters, 3 digits, 2 special

*3, 2, 3

*2, 4, 2

*2, 3, 3

*2, 2, 4


To count the first case, there are $\binom 84$ ways to choose which places are letters, then $\binom 42$ ways to choose which of the other places are digits. Then there are $26\cdot 25\cdot24\cdot23$ ways to choose the four letters in order (with them all different), $10\cdot9$ for the digits and $6\cdot5$ for the specials. So there are $\binom 84\binom 42\cdot26\cdot 25\cdot24\cdot23\cdot10\cdot9\cdot6\cdot5$ ways to do that case. You can do the others similarly and add them up.
A: The denominator is the number of strings of length $8$ over the alphabet of size $42$, and so is equal to $42^8$. 
For the numerator, let $A$ denote the set of all strings of length $8$ which contain no repetitions, at least 2 letters, at least 2 digits and at least 2 special characters.  We need to find $|A|$. Observe that $A$ is the disjoint union of a few sets $A_1, A_2, \ldots, A_k$, where $A_1$ is the set of all strings of length $8$ which contain no repetitions, exactly 3 letters, exactly 3 digits and exactly 2 special characters.  There are ${26 \choose 3}$ ways to choose the 3 letters, ${10 \choose 3}$ ways to choose the 3 digits, ${6 \choose 2}$ ways to choose the 2 special characters, and $8!$ ways to arrange the 8 chosen characters as a valid password.  Thus, $|A_1| = {26 \choose 3} {10 \choose 3}{6 \choose 2} 8!$. 
$A_1$ corresponds to the ordered partition $(3,3,2)$ of $8$ into three parts.  You can repeat this process for the other valid partitions such as $(3,2,3), (2,2,4)$, etc. Note that a valid partition satisfies the condition that each part has size at least 2, so that $(1,2,5)$ is not a valid partition.
