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

combinationscombinatoricspermutations

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?

Best Answer

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.