There are $2022$ signs arranged in a straight line. Mark tasks Auto to color each sign with either red or blue with the following condition: for any given sequence of length $1011$ whose each term is either red or blue, Auto can always remove $1011$ signs from the line so that the remaining $1011$ signs match the given color sequence without changing the order. Determine the number of ways Auto can color the signs to satisfy Mark's condition.
Problem
Source: 2022 Thailand Online MO P4
Tags: combinatorics
12.04.2022 23:02
Answer:$2^{1011}$.
15.04.2022 15:32
Note that Auto's string must color half of the signs blue and half red or else he won't be able to create sequences with all blue signs or all red signs. Pair the signs into chunks of $2$, creating $1011$ pairs of adjacent signs in total. Call a chunk colorful if it has both red and blue signs. We claim that all chunks must be colorful. Suppose for some non-negative integer $k < 1011$, the first $k$ chunks from the left are colorful while the $(k+1)$-th chunk is not colorful say with both red signs. Then, Mark gives the sequence of $k+1$ blue signs followed by $1010 - k$ red signs. Then, since Auto has less than $1010 - k$ red signs after the $(k+1)$-th chunk, he needs to keep at least one red sign in the first $k+1$ chunks. However, since there are only $k$ blue signs in the first $k+1$ chunks, this will not be possible. Hence, we have settled our claim (note that the proof also includes the case for $k=0$). Indeed, if every chunk is colorful, Auto can create any sequence that Mark gives simply by choosing the color in the $k$-th chunk from the left that matches with $k$-th color from Mark's sequence. Therefore, there are total of $2^{1011}$ colorings.