Problem

Source: SRMC 2018 P3

Tags: combinatorics, Combinatorics of words



Given the natural $n$. We shall call word sequence from $n$ letters of the alphabet, and distance $\rho(A, B)$ between words $A=a_1a_2\dots a_n$ and $B=b_1b_2\dots b_n$ , the number of digits in which they differ (that is, the number of such $i$, for which $a_i\ne b_i$). We will say that the word $C$ lies between words $A$ and $B$ , if $\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?