# How many unique codes with this pattern?

If I have a string of 4 chars, composed by 2 alphabetic chars and 2 numeric chars

Expamples:
CB77
HG47
HH33

The possible alphatic chars are:
A B C D E F G H K L M N P Q R S T U V X Y Z

The possibile numeric chars are:
2 3 4 5 6 7 8 9

How many unique codes are possibile?

-

There are $22$ possible choices for the first character. Each of them can be followed by any of the $22$ letters, so there are $22\cdot22$ possible pairs of letters at the beginning of the code. Similarly, there are $8$ possible choices for each digit, so there are $8\cdot8$ possible ways to form the two-digit part of the code. Altogether, then, there are $22\cdot22\cdot8\cdot8=30~976$ possible codes.

The general rule is that when you have to make a string of $k$ choices, and you can make the first choice in any of $n_1$ ways, the second choice in any of $n_2$ ways, and so on, there are $n_1n_2\cdots n_k$ ways to make the whole string of choices. In this problem $n_1=n_2=22$ and $n_3=n_4=8$.

-

If you allow repetitions, then it's $22^2\times 8^2$, without $22\times 21\times 8 \times 7$.

-
 Repetitions are clearly allowed, given the examples. – Brian M. Scott Oct 4 '12 at 7:55 True, but leaving it doesn't hurt... – draks ... Oct 4 '12 at 8:01 Agreed. I just wasn’t sure whether you’d noticed. – Brian M. Scott Oct 4 '12 at 8:03