Possible combinations of Canadian postal codes with letters in alphabetical order?

960 Views Asked by At

Canadian postal codes (for those of you who don't know) are as follows: letter, digit, letter, digit, letter, digit (letters and digits can be repeated) How many possible postal codes are there if the letters must be in alphabetical order? My best guess is that since the 3 letters can only be in alphabetical order 1/3rd of the time(aaa, aab, aac, aad, aae, etc.), you would use an indirect method by firstly find the total combinations without restrictions, which is 17,576,000 possible combos. Therefore, is (1/3)(17,576,000) the correct way to solve? It feels like I'm forgetting something.....

1

There are 1 best solutions below

7
On

No, that's not right. Say you only had $2$ letters $a$ and $b$. Then you have $8$ possible 3-letter strings, but of those, $aaa$, $aab$, $abb$, and $bbb$ are valid. So, it is not $\frac{1}{3}$ of all possible strings.

In fact, if all three letters are different, then it is in alphabetical order $\frac{1}{6}$ of the time, since they can be in $3!=6$ possible orders. But since you can have repeat letters, it is not $\frac{1}{6}$ of all possible strings either.

Still, start with that: out of all $3$ letter strings with $3$ different letters (of which there are $26 \cdot 25 \cdot 24$), $\frac{1}{6}$ are valid. As N.F.Taussig correctly points out in the comments, this is the same as the number of ways you can pick three different letters, i.e. $26 \choose 3$, as they can only be put in one alphabetical order.

Now try and figure out all valid $3$ letters strings with $2$ letters being the same, and finally find all with all $3$ letters the same (that last one is easy: $26$)

So, the question is: how many valid strings are there where two letters are the same?

Answer:

There are $26 \choose 2$ pairs of letters, and thus also that many with two of the same letter that are alphabetically before the third letter (and there is only one way to make that into a valid string) and also that many where there are two of the same letter that come alphabetically after the third letter (and again there is only one way to make that into a valid string). Hence, there are $2 \cdot {26 \choose 2}$ valid strings where two letters are the same. This gives a total of $${26 \choose 3} + 2 \cdot {26 \choose 2} + 26$$ $3$-letter strings in alphabetical order, and now you just need to multiple by $1000 to get the total number of possible license plates.