Probability of creating a password with 2 digits and 6 letters I'm having a little trouble with an exercise, due to a flawed logic that I need to fix. I apologize in advance if anything of this is silly, or for my language as I'm not a native English speaker.
I have an alphabet of 21 letters and 10 digits (0-9) and I need to calculate the probability of creating a password that has a total length of 8 characters, with exactly 2 digits and 6 letters.
First, I defined the total of outcomes, which are $31^8$: I've imagined 8 boxes, each one can have 31 (the total length of the alphabet) possible characters.
Now, for the likely outcomes I've imagined to calculate all the ways to take 2 digits out of 10 ($\binom{10}{2}$) and multiply them for the possible ways to take 6 letters from 21 total letters($\binom{21}{6}$). I thought of combinations because no order is apparently required.
The solution is different on these outcomes: I was right on $31^8$ but the likely outcomes are calculated as $\binom{8}{2}*10^2*21^6$ for a result of
$P(E) = \frac{\binom{8}{2}*10^2*21^6}{31^8}$.
I can't understand this solution, nor what I'm doing wrong. Can anybody help me out? 
 A: Here you should not do $\binom{10}{2}$ because you can make passwords with 2 same digits in it,like 22,33 .
Here you just have to choose number of places for digits among 8 given places, $\binom82$ ways.
Now since you can place same digits and letters, say for 2 places for letters you can choose first letter in 10 way and next letter also 10 way, thats why $10^2$ and the same with letters.
A: Let's think about how you obtained $31^8$ possible outcomes.  You realized that there were $31$ choices for each of the eight positions in the password, including $21$ letters and $10$ digits.
Since there are eight positions, there are $\binom{8}{2}$ ways to choose the positions of the digits.  Each of these two positions can be filled with a digit in $10$ ways, giving us the factor $10^2$.  Each of the remaining six positions can be filled with a letter in $21$ ways, giving us the factor $21^6$.  Hence, the number of favorable cases is 
$$\binom{8}{2}10^221^6$$
What are you doing wrong?
The number $\binom{10}{2}$ counts the number of ways of selecting two of the ten digits.  Therefore, you have selected two different digits, but digits may be repeated.  Similarly, $\binom{21}{6}$ counts the number of ways of selecting six different letters, but letters may be repeated.  You also did not choose the positions of the letters.
