Number of passwords - no repeated numbers Am currently studying for a discrete math exam and I'm having problems with the following question:
Q: How many 8 character passwords can be created from the 26 letters of the alphabet(a-z) and the 10 digits (0-9) that don't contain repeated numbers?
The thing which is throwing me here is that I can repeat letters but not numbers.
My solution is to add the possible combinations from each of cases where the password has 0, 1, 2, 3, 4, 5, 6, 7, 8 numbers, so:
$Total = 26^8 + 26^7{10\choose 1}+ 26^6{10\choose 2}+ 26^5{10\choose 3} + 26^4{10\choose 4}+ 26^3{10\choose 5}+ 26^2{10\choose 6}+ 26^1{10\choose 7} + {10\choose 8}$
However this seems pretty long-winded and I'm not sure if its correct. Am hoping someone can help?
 A: This is almost correct. You've counted all possible orders of letters but only the ways to choose numbers. As a result, we have to count all possible orderings. Additionally, as JMoravitz explains above, we need to count all the ways to intersperse numbers and letters.
Take the fourth term in your sequence, where we have 5 possibly-repeating letters and 3 distinct numbers: $26^5 {10 \choose 3}$. We need to consider all ways to order the 3 numbers ($3!$) and the ways to pick slots for numbers. Of 8 total characters, 3 are numbers: ${8 \choose 3}$. Thus, we have
$$26^5 {10 \choose 3} 3!{8 \choose 3}$$
We then have our final expression.
$$\sum_{i=0}^8 26^{8-i} {10 \choose i} i! {8 \choose i}$$
Note that we can simplify this expression a bit by instead considering that for $i$ slots, we have 10 options for the first slot for numbers, 9 for the second slot for numbers etc. Then, we have
$$\sum_{i=0}^8 26^{8-i} \frac{10!}{(10-i)!}{8 \choose i}$$
*You could convince yourself that both expressions are equivalent by expanding ${n \choose k} = \frac{n!}{k!(n-k)!}$.
