Maths Olympiad Prep

Track / Stage 7 / 205 of 300 #1605 of 1964

Problem 1605

National Olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.3 Find the answer

Given the natural nn. We shall call word sequence from nn letters of the alphabet, and distance ρ(A,B)\rho(A, B) between words A=a1a2…anA=a_1a_2\dots a_n and B=b1b2…bnB=b_1b_2\dots b_n , the number of digits in which they differ (that is, the number of such ii, for which ai≠bia_i\ne b_i). We will say that the word CC lies between words AA and BB , if ρ(A,B)=ρ(A,C)+ρ(C,B)\rho (A,B)=\rho(A,C)+\rho(C,B). What is the largest number of words you can choose so that among any three, there is a word lying between the other two?

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Next problem →

Official solution

1. Claim: The largest number of words you can choose so that among any three, there is a word lying between the other two is n+1 n + 1 for n≠2 n \neq 2 and n+2 n + 2 for n=2 n = 2 .

2. **Construction for n≠2 n \neq 2 **:
- Consider all words consisting of k k letters "a" followed by n−k n - k letters "b" for all 0≤k≤n 0 \leq k \leq n . This gives us n+1 n + 1 words.

3. **Construction for n=2 n = 2 :
- Consider all words consisting of letters "a" and "b". This gives us the words "aa", "ab", "ba", and "bb", which are 4 words in total.

4. Proof**:
- We need to show that any set S S of words with the described property has ∣S∣≤n+1 |S| \leq n + 1 if n≠2 n \neq 2 and ∣S∣≤n+2 |S| \leq n + 2 if n=2 n = 2 .

5. Distance Property:
- For any three words A,B,C A, B, C , we have ρ(A,C)+ρ(C,B)≥ρ(A,B) \rho(A, C) + \rho(C, B) \geq \rho(A, B) with equality if and only if for each i i , either ci=ai c_i = a_i or ci=bi c_i = b_i .

6. Binary Strings:
- For any 1≤i≤n 1 \leq i \leq n , at most two distinct letters occur in the i i -th position in words in S S . Thus, we can assume all words in S S are binary strings of length n n .

7. **Case n≤2 n \leq 2 **:
- For n=2 n = 2 , the claim follows directly from the construction. So, assume n≥3 n \geq 3 .

8. Interpretation as Subsets:
- Interpret each string from S S as a subset of the set [n]={1,2,…,n} [n] = \{1, 2, \ldots, n\} . Assume S S contains the string consisting of n n zeros.

9. Claim 1: For any distinct non-empty A,B∈S A, B \in S , either A∩B=∅ A \cap B = \emptyset or A⊂B A \subset B , or B⊂A B \subset A .
- Proof: For any distinct non-empty A,B∈S A, B \in S , either ∅ \emptyset lies between A,B A, B , meaning that A,B A, B are disjoint, or A A lies between ∅ \emptyset and B B , which implies that A⊂B A \subset B .

10. Claim 2: No three non-empty subsets in S S are pairwise disjoint.
- Proof: Assume otherwise, then there exist non-empty A,B,C∈S A, B, C \in S such that A∩B=B∩C=C∩A=∅ A \cap B = B \cap C = C \cap A = \emptyset . WLOG B B lies between A A and C C , but then taking some b∈B b \in B implies that either b∈A b \in A or b∈C b \in C , which is absurd.

11. Chain Argument:
- Let S′=S∖{∅} S' = S \setminus \{\emptyset\} . If the subsets in S′ S' form a chain, we have ∣S′∣≤n |S'| \leq n . Suppose this is not the case. Take disjoint X,Y∈S′ X, Y \in S' so that ∣X∣+∣Y∣ |X| + |Y| is maximum. Then for each Z∈S′∖{X,Y} Z \in S' \setminus \{X, Y\} , either Z⊂X Z \subset X , or Z⊂Y Z \subset Y , or X,Y⊂Z X, Y \subset Z .

12. **Bounding ∣S∣ |S| **:
- If [n]∈S′ [n] \in S' , then X∪Y=[n] X \cup Y = [n] and S1,S2 S_1, S_2 must be empty, thus ∣S′∣≤3≤n |S'| \leq 3 \leq n . Suppose [n]∉S [n] \not \in S . The subsets from S1 S_1 form a chain, so ∣S1∣≤∣X∣−1 |S_1| \leq |X| - 1 and similarly ∣S2∣≤∣Y∣−1 |S_2| \leq |Y| - 1 . The subsets in S3 S_3 form a chain by Claim 1, implying ∣S3∣≤n−∣X∣−∣Y∣ |S_3| \leq n - |X| - |Y| .

13. Final Calculation:
∣S∣=∣S′∖{X,Y}∣+3=∣S1∣+∣S2∣+∣S3∣+3≤(∣X∣−1)+(∣Y∣−1)+(n−∣X∣−∣Y∣)+3=n+1 |S| = |S' \setminus \{X, Y\}| + 3 = |S_1| + |S_2| + |S_3| + 3 \leq (|X| - 1) + (|Y| - 1) + (n - |X| - |Y|) + 3 = n + 1

The final answer is n+1 \boxed{ n + 1 } for n≠2 n \neq 2 and n+2 n + 2 for n=2 n = 2 .

Source: NuminaMath-1.5, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.