Skip to main content
OlympiadHQ

Browse · MathNet

Print

XXI SILK ROAD MATHEMATICAL COMPETITION

counting and probability

Problem

In a language, an alphabet with 25 letters is used; words are exactly all sequences of (not necessarily different) letters of length . Two ends of a paper strip are glued so that the strip forms a ring; the strip bears a sequence of letters. Say that a word is singular if one can cut out a piece bearing exactly that word from the strip, but one cannot cut out two such non-overlapping pieces. It is known that one can cut out non-overlapping pieces each containing the same word. Determine the largest possible number of singular words. (Bogdanov I.)
Solution
Let the alphabet consist of letters . By a piece we always mean a piece of the strip containing exactly consecutive letters; different pieces may contain the same word. Say that a piece is singular if the word it contains is such.

We start with constructing an example containing singular words. Define a word ; this will be the word having non-overlapping copies on the strip. There exist exactly possible -letter sequences, consisting of letters ; put them onto the strip in an arbitrary order, separating each two sequences by an instance of . Each segment of the strip containing one -sequence mentioned above (and no other letters) will be referred to as a part. Notice that the strip contains exactly letters.

Clearly, the obtained strip contains non-overlapping copies of . Now we show that any piece containing a whole part is singular — moreover, that the word it contains is met on no other piece. Since a part can be situated in a piece at different positions (starting from the -st, from the -nd, ..., or from the -th letter of a piece), we will get that there are at least singular words.

Consider an arbitrary piece containing a word . Either this piece contains a unique nonempty prefix which coincides with some suffix of , or there is no such prefix — only in this case we will say that such prefix is empty. Let be the length of the defined prefix. Define similarly a suffix of which coincides with a prefix of , and denote its length by . Notice that the defined prefix and suffix do not overlap whenever (if , we have ).

If the piece contains no whole part, then . If the piece contains a part, then and . Thus, piece contains a part if and only if , and in this case the position of the part at (and hence the position of at the strip) is uniquely determined. Therefore, in this case is met only on piece , so this piece is singular. We have proven that the constructed example works.

It remains to prove that the number of singular words cannot exceed . Enumerate the positions in the strip successively by (the numeration is cyclic modulo ). Let denote the piece starting at position , and let be the word on that piece. Let be positions such that the pieces are pairwise disjoint and contain the same word (from the problem statement). Clearly, those pieces are not singular.

For and , we say that a piece is a rank follower, while is a rank predecessor. All these pieces (followers and predecessors) are distinct; moreover, followers of a fixed rank are pairwise disjoint, and the same holds for predecessors. We will show that among followers of all ranks, at most pieces are singular (we will call this statement a quoted claim in the future); by symmetry, the same bound holds for predecessors. This will yield that there are at least non-singular pieces, which implies the desired bound.

Remark. We present a shorter (yet more ideological) proof of the quoted claim on the number of singular followers. Say that a singular follower's tail is minimal if none of its proper prefixes is a singular follower's tail. In particular, no minimal tail can be a proper prefix of other minimal tail.

For every minimal tail let us write down all -letter sequences starting with ; if the length of is , then the number of such sequences is . No sequence could be written down twice; therefore, if there are minimal tails of lengths , then On the other hand, each singular follower's tail has a prefix which is a minimal tail. For a minimal tail of length , there are at most singular followers whose tails start with — at most one per tail's length. Therefore, the number of singular followers does not exceed since for all .

Finally, if there is a singular follower whose tail is , then such follower is unique. Therefore, all followers of larger ranks whose tails start with correspond to the same copy of . Then the number of such followers (including itself) is at most , as desired again. The claim, and the bound, are proven.
Final answer
2*5^17

Techniques

Counting two waysRecursion, bijectionColoring schemes, extremal arguments