3
$\begingroup$

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?

$\endgroup$
2
$\begingroup$

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.

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

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.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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