Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The following proof is much tighter than the meandering process I followed to get to it. Let me know if the meandering would be interesting!

Call a position i in s "hard-red" (respectively, "hard-blue") if every positive-length substring of s beginning at i is red (respectively, blue); otherwise call i "soft". A position is "hard" if it is hard-red or hard-blue.

There are 3 possible cases:

1. s has no hard positions.

2. s has a positive but finite number of hard positions, with the last being i.

3. s has an infinite number of hard positions.

Case 1

Every position is soft, meaning that if we start a substring of s at that position and continue to grow it by appending digits from s, eventually (after a finite number of steps) the colour of the substring will change. So we can set w₀ arbitrarily to the first digit of s, then grow w₁ from position 2 of s until it has the same colour as w₀. Then we can grow w₂ from the next digit in s until it has the same colour, and so on. This results in all words having the same colour, including the first.

Case 2

Set w₀ to the first i-1 digits of s, and w₁ to the i-th digit of s. All positions > i are soft, meaning that, as for case 1, we can repeatedly grow substrings by appending digits from s until the substring turns the same colour as w₁.

Case 3

Since s has an infinite number of hard positions, it must have an infinite number of hard-red positions, an infinite number of hard-blue positions, or both. Suppose w.l.o.g. that it has an infinite number of hard-red positions (it may or may not also have an infinite number of hard-blue positions). Define p(k) to be the k-th hard-red position in s. Set w₀ to the first p(1)-1 digits of s, and for k >= 1 set word w_k to the substring of s beginning at p(k) and ending at p(k+1)-1. w₁, w₂, w₃, ... all begin at hard-red positions, so are all red. □



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: