# How many codes can be formed from three letters (A-Z) followed by two digits ($0$-$9$)?

### Problem:

A code consists of 3 letters followed by 2 digits. How many codes can we create if a)repetition is allowed b)repetition is not allowed?

### Attempt:

The code should looks like this LLLDD (L for letter and D for digit) so if repetition is allowed, the number of possible codes is $$(26^3)(10)^2$$ and if repetition is not allowed the number of possible codes is $$26 \mathrm{ P }3 \times 10 \mathrm{ P }2.$$

### My concern:

How does $$(26^3)(10)^2$$ or $$26 \mathrm{ P }3 \times 10 \mathrm{ P }2$$ guarantee that the code has the correct pattern (LLLDD) and not other patterns like LDLDL, LLDDL, it's what permutations do after all (order is important), right?

In both cases, you are counting the number of ways to create LLL and DD separately. Since there is only one way to put them together to create LLLDD, multiply and you're done.

If you wanted to count LDLDL and LLDDL, among other arrangements, you would need to choose the positions of the letters. Or of the numbers. Either way, it's an additional multiplication by ten.

• could you elaborate on how to count LDLDL and LLDDL? – AmirWG Nov 22 at 13:12
• or even give me a reference on how they are counted – AmirWG Nov 22 at 13:16
• @AmirWG There are $\binom{5}{3}=10$ ways to select the positions of the letters. The remaining positions will be numbers. – Daniel Mathias Nov 22 at 13:28

Alternative explanation.

how does $$(26^3)(10)^2$$ or $${}26 \mathrm{ P }3 \times 10 \mathrm{ P }2$$ guarantee that the code has the correct pattern (LLLDD) and not other patterns like LDLDL , LLDDL , it's what permutations do after all (order is important), right?

The formulas do not guarantee the pattern. However, the formulas are still correct. The original question is to enumerate the number of ways that the pattern LLLDD can occur. The formulas are accurate, under the assumption that your attention is confined to the LLLDD pattern.

The fact that the formulas may also be correct for other patterns is totally irrelevant.