Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Want to put together a secret code. The code consists of 2 different digits and 3 different English letters (26 options). How many different codes can be put together?

I tried to think of it this way: $$10*9*26*25*24=1,404,000$$

Because I first choose two digits and then three letters. The answer by the book is:

$$\binom{10}{2}\binom{26}{3}*5!=14,040,000 $$

I understand why they did it, but I do not know what I'm missing to get answer similar to their own.

Thank you very much.

share|cite|improve this question
up vote 7 down vote accepted

Before you can put the code together, you need to choose which spaces are going to be numbers and which spaces are going to be letters. There are $5$ spaces altogether (since you are making a code from $5$ symbols) and there are $2$ spaces for numbers. Therefore, there are $5 \choose 2$ ways to pick which spaces will be where the numbers go and which spaces will be where the letters go. Thus, your answer should be:

$${5 \choose 2}*10*9*26*25*24=14,040,000$$

share|cite|improve this answer
OP says the answer is the value above multiplied by 5! - Where does 5! come from? Thanks in advance. – NoChance Mar 26 at 18:49
They multiplied by $5!$ because there are that many ways one can arrange the $5$ different symbols. However, they used $5!$ because at first, they used combinations, which completely disregards order, so they put all of their ordering into the $5!$. However, the OP's solution uses permutations like $_{10}P_{2}=10*9$ and $_{26}P_{3}=26*25*24$ which orders the numbers and letters by themselves so all we need to do is decide which spaces are numbers and letters, which we do with $5 \choose 2$. – Noble Mushtak Mar 26 at 18:52

Algebraically, $$ \binom{10}{2}\binom{26}{3}5! = \frac{10!}{2!8!}\frac{26!}{23!3!} = \frac{10\times 9 \times 26 \times 25 \times 24 \times 5!}{2!3!} = 10\times 9 \times 26 \times 25 \times 24 \times 10 . $$ Te difference is that although you considered all the possible choices of letters and digits, you forgot to consider all the possible ways to arrange the chosen items, which is $5!$.

share|cite|improve this answer

Hint. You counted the codes in which the digits come first, followed by the numbers.

share|cite|improve this answer

Obviously something's fishy with the first slot, as it can't be 0. Let's split the solution into 2:

1) First slot is a letter. We have 26 options for the first slot, then choose two more for letters: $\binom{4}{2} \times 25 \times 24$, then multiply by $10 \times 9$.

2) First slot is a digit: We have 9 options for it, then we choose 4 slots for the second digit: $9 \times \binom{4}{1} \times 9$ and the rest are chars. The full solution is

$$ 26 \times \binom{4}{2} \times 25 \times 24 \times 10 \times 9 +9 \times \binom{4}{1} \times 9 \times 26 \times 25 \times 24 $$

share|cite|improve this answer
Could you please justify the 5! appearing in the OP's proposed answer - Thanks. – NoChance Mar 26 at 19:10
You have 2 different digits and 3 different letters, i.e. 5 different symbols that you can put in any order, hence $5!$ – Alex Mar 26 at 19:11
I see, thank you. – NoChance Mar 26 at 19:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.