Sequence of 1's and 2's

120 Views Asked by At

I found this problem in the book "Challenging mathematical problems with elementary solutions" vol. 2 by A.M Yaglom and I.M Yaglom (it is the problem 123) and in the book I have it doesn't show the full solution and I am not sure that What they say there is right. The problem is:

Show that there exist arbitraly long sequences of 1's and 2's in which no digit or sequence of digits occurs three times in succession.

First, I observed that if we have a sequence like this, if we change the 1's with 2's and 2' with 1's the sequence will Fulfil the conditions too. Lets Say that We have such a sequence with $n$ digits. We add at the final $1$. If there is no digit or sequence of digits that occurs three times in succession, than We continue. If we have one of these, We change the 1's in 2's and 2's in 1's. But later i found that this isn't necesarly right. An example is "21122112211". We add 1 and We have 3 1's, so the sequence transforms in 122112211221 and 1221 repeats for 3 times. But maybe We can build a sequence such that We won't have such a thing.

Do you have Any ideea if this may work or What is the solution of this problem?

1

There are 1 best solutions below

0
On BEST ANSWER

As @lulu mentioned in a comment, the Thue-Morse sequence is an infinite sequence with this property.

We can prove by long induction on $n$ that no sequence of length $n\ge 1$ occurs triply repeated:

First, assume that $n$ is odd. A basic property of the Thue-Morse sequence is that repeated single symbols only occur at odd positions -- that is, $a_{2n-1}=a_{2n}$ is possible, but $a_{2n}=a_{2n+1}$ is not. So if an odd-length sequence appears even two times in succession, it cannot have any neighboring symbols equal, because one of the copies of it would appear at a position of wrong parity. So the repeated sequence must have a strict alternation between 1s and 2s. But this means it begins and ends with the same symbols, so if there are three copies next to each other, there will be a repeated symbol at each of the two joins between copies. But these repetitions will also have different parity, which is again impossible.

On the other hand, suppose $n$ is even. Then taking just those symbols that are at even indices in the original Thue-Morse sequence will create a sequence of length $n/2$ that appears at half the index in the T-M sequence. (This is because the sequence of even-indexed symbols of the T-M sequence is the same as the sequence itself). But since $n/2<n$, the induction hypothesis says that this is impossible.