Olympiad Maths Prep

Track / Stage 7 / 223 of 300 #1623 of 2000

Problem 1623

National olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.5 Prove it

A [b][u]word[/u][/b] is formed by a number of letters of the alphabet. We show words with capital letters. A [b][u]sentence[/u][/b] is formed by a number of words. For example if A=aaA=aa and B=abB=ab then the sentence ABAB is equivalent to aaabaaab. In this language, AnA^n indicates AAAn\underbrace{AA \cdots A}_{n}. We have an equation when two sentences are equal. For example XYX=YZ2XYX=YZ^2 and it means that if we write the alphabetic letters forming the words of each sentence, we get two equivalent sequences of alphabetic letters. An equation is [b][u]simplified[/u][/b], if the words of the left and the right side of the sentences of the both sides of the equation are different. Note that every word contains one alphabetic letter at least.

a)\text{a})We have a simplified equation in terms of XX and YY. Prove that both XX and YY can be written in form of a power of a word like ZZ.(ZZ can contain only one alphabetic letter).

b)\text{b}) Words W1,W2,,WnW_1,W_2,\cdots , W_n are the answers of a simplified equation. Prove that we can produce these nn words with fewer words.

c)\text{c}) nn words W1,W2,,WnW_1,W_2,\cdots , W_n are the answers of a simplified system of equations. Define graph GG with vertices 1,2,n{1,2 \cdots ,n} such that ii and jj are connected if in one of the equations, WiW_i and WjW_j be the two words appearing in the right side of each side of the equation.(Wi=Wj\cdots W_i = \cdots W_j). If we denote by cc the number of connected components of GG, prove that these nn words can be produced with at most cc words.

[i]Proposed by Mostafa Einollah Zadeh Samadi[/i]

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

### Part (a)

We need to prove that for every solution (X,Y)(X, Y) of a simplified equation, both XX and YY can be written in the form of a power of a word like ZZ (where ZZ can contain only one alphabetic letter).

1. Assume a simplified equation: Consider a simplified equation X=YX = Y. Since XX and YY are different words, we can write XX and YY as sequences of letters. Let X=x1x2xmX = x_1 x_2 \cdots x_m and Y=y1y2ynY = y_1 y_2 \cdots y_n where xix_i and yjy_j are letters of the alphabet.

2. Equal lengths: If m=nm = n, then X=YX = Y implies xi=yix_i = y_i for all ii, which contradicts the assumption that XX and YY are different words. Therefore, mnm \neq n.

3. **Assume m>nm > n**: Without loss of generality, assume m>nm > n. Then XX can be written as X=ZkX = Z^k for some word ZZ and integer kk such that ZZ is a prefix of XX and YY. Similarly, YY can be written as Y=ZlY = Z^l for some integer ll.

4. **Construct ZZ**: Since XX and YY are different, klk \neq l. Therefore, X=ZkX = Z^k and Y=ZlY = Z^l where ZZ is a word consisting of a single letter repeated multiple times.

5. Conclusion: Both XX and YY can be written in the form of a power of a word ZZ where ZZ contains only one alphabetic letter.

\blacksquare

### Part (b)

We need to prove that words W1,W2,,WnW_1, W_2, \cdots, W_n that are the answers of a simplified equation can be produced with fewer words.

1. Consider the rightmost words: Consider the rightmost words on either side of the equation, say WiW_i and WjW_j. If both have equal length, they are equal, and we are done.

2. Unequal lengths: Assume WiW_i is longer than WjW_j. We can re-express WiW_i as WiWjW_i'W_j and substitute this back into the equation, replacing all copies of WiW_i to yield WiWj=WkWj\ldots W_i'W_j = \ldots W_k W_j.

3. **Cancel WjW_j**: Cancel WjW_j from each side to get another simplified equation in nn words, Wi=Wk\ldots W_i' = \ldots W_k.

4. Repeat the process: Repeat this process until the rightmost words on each side are of equal length, allowing us to equate them and express the substituted words in the form of n1n-1 words.

5. Conclusion: Reversing the substitutions lets us express the original nn words in terms of these n1n-1 words.

\blacksquare

### Part (c)

We need to prove that nn words W1,W2,,WnW_1, W_2, \cdots, W_n that are the answers of a simplified system of equations can be produced with at most cc words, where cc is the number of connected components of the graph GG.

1. **Construct graph GG**: Define graph GG with vertices {1,2,,n}\{1, 2, \cdots, n\} such that ii and jj are connected if in one of the equations, WiW_i and WjW_j appear on the right side of each side of the equation.

2. Spanning tree: Consider a spanning tree of each component of GG. Delete all equations whose edges are not in a spanning tree. Now there are ncn-c edges in total, so ncn-c remaining equations.

3. Algorithm from part (b): Pick one of the equations and perform the algorithm from part (b) on it. This lets you express W1,,WkW_1, \ldots, W_k in terms of fewer words, say W1,,Wk1W_1', \ldots, W_{k-1}'.

4. Group vertices: Group the vertices of GG into kk groups: one group for the vertices representing words which become expressed in the form Wi\ldots W_i' for each 1ik11 \leq i \leq k-1, and one group for the remaining vertices.

5. **Construct new graph GG'**: Construct a graph GG' that corresponds to the situation after all the W1,,WkW_1, \ldots, W_k have been replaced by all the W1,,Wk1W_1', \ldots, W_{k-1}'. This graph will have k1k-1 vertices representing the words W1,,Wk1W_1', \ldots, W_{k-1}', as well as nkn-k vertices representing the unaffected words.

6. Number of components: Show that the number of components of GG' is at most cc. Each group contains at least one vertex, and the new graph GG' is identical to the original GG except that the two vertices representing WiW_i and WjW_j are merged into one new vertex.

7. Repeat the process: Repeat this process until we get cc isolated vertices. Reversing the substitutions, we can express the nn words in terms of cc words.

\blacksquare

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.