The language of Au tribe contains only two letters and . Some sequences of these letters are words, and each word contains not less than and not more than letters. Moreover, if one writes down two words consecutively (with no space between them) then the resulting sequence is never a word. Find the maximal possible number of words in such language. (I. Bogdanov)
Solution
Answer. .
First solution. If all sequences whose number of letters is at least and at most are words, then, obviously, the condition of the problem is satisfied; in this case, the number of such words is . It remains to show that this number is the largest possible.
The total number of sequences of length not exceeding is . If there are no -letter words among the words in the language, then the total number of words does not exceed . Suppose, on the contrary, that the language contains a -letter word . Then for each word consisting of or fewer letters, the sequence of letters cannot be a word, and all sequences of the form are obviously distinct. Therefore, if the language has words of or fewer letters, then the number of words of at least letters does not exceed . Thus, the total number of words does not exceed , which is what was required to prove.
Second solution. Here is another proof that the number of words in the language does not exceed . Let be the set of all sequences of or fewer letters, and be the set of all -letter sequences. Then contains sequences, and contains sequences. Therefore, it is possible to assign to each sequence a sequence so that all sequences are distinct. Note that then all sequences of the form are also distinct (since their -letter endings are distinct).
By the condition, in each of the triples there are at most two words of the language. Therefore, at least sequences of or fewer letters are not words, and the total number of words does not exceed .