Maths Olympiad Prep

Library / IRL ABooklet /155 of 191

IRL ABooklet

Combinatorics Difficulty 6.9 National Olympiad Prove it Ireland

Leonard Larsson's Language
The linguist Leonard Larsson made up a new language in which all words have exactly seven letters and only the twenty letters from AA to TT are used. Furthermore, any pair of distinct words differ in at least two places. (For instance, if the words LEONARDLEONARD and LARSSONLARSSON are part of this language, then LEOPARDLEOPARD and PARSSONPARSSON cannot be words.)
Leonard claims that if he needs more words, the language rules allow him to create more than 7070 million words. His colleague says “I presume you mean more than 6060 million words?”. Prove that indeed these rules allow for more than 6060 million words but not more than 7070 million.

Solution

Let's generalise and consider exactly nn letters in a word, chosen from an alphabet of mm letters, with the restriction that any two distinct words must differ in at least two places. We claim that this allows for at most mn−1m^{n-1} words, and that this bound can be obtained. Since 207−1=64 000 00020^{7-1} = 64\ 000\ 000 lies strictly between 6060 and 7070 million, Leonard's colleague makes a valid point, but we need to prove our claim!

The upper bound follows easily from the pigeonhole principle since there are mn−1m^{n-1} possibilities for the first n−1n-1 letters in a word. Thus, if there are more than this number of words, at least two of them must have the same first n−1n-1 letters and so cannot differ at two or more places.

Conversely, consider the set of near-words consisting of n−1n-1 letters from the alphabet, but with no restriction on the number of differences between two near-words. Clearly, there are mn−1m^{n-1} near-words. Treat the letters as base-nn digits and create a word WW from each near-word ww by appending a single letter s(w)s(w) that is congruent to the sum of the letters in ww modulo nn. This gives a collection of mn−1m^{n-1} words with the right number of letters and the right alphabet. But do they all differ in at least two places?

Suppose the distinct near-words xx and yy give rise to words XX and YY, respectively, by this process. If xx and yy differ in at least two places, so do XX and YY. If xx and yy differ in only one place, then s(x)s(x) and s(y)s(y) are different, and so XX and YY differ in exactly two places.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.