There are $ n$ markers, each with one side white and the other side black. In the beginning, these $ n$ markers are aligned in a row so that their white sides are all up. In each step, if possible, we choose a marker whose white side is up (but not one of the outermost markers), remove it, and reverse the closest marker to the left of it and also reverse the closest marker to the right of it. Prove that, by a finite sequence of such steps, one can achieve a state with only two markers remaining if and only if $ n - 1$ is not divisible by $ 3$. Proposed by Dusan Dukic, Serbia
Problem
Source: INDIA IMOTC - 2006 TST 1 PROBLEM 3
Tags: modular arithmetic, invariant, combinatorics, IMO Shortlist
05.06.2006 16:25
One implication is easy by induction on $n$. We say that a positive integer $n\ge 3$ is "good" if starting with $n$ white tokens, we can reach a state with only two tokens. We can prove that if $n$ is good, then $n+3$ is good as well: if the tokens are numbered $1,2,\ldots,n$ from left to right, say, then we take tokens $2,4,3$ (in this order), and we're left with the same situation, except that with $n-3$ tokens instead of $n$. Since it's obvious that $3$ and $5$ are good, it follows that all $n$ for which $3\not|n-1$ are good. Conversely, we have to prove that if $3|n-1$, then $n$ is not good. Denote white by $a$ and black by $b$. We denote a sequence of tokens by the corresponding word in $a$ and $b$ (and we disregard the spaces that are left after eliminating some of the tokens). The rules for elimination tell us that $aaa=bb,aab=ba,baa=ab,bab=aa$. We write these in condensed form as $a^3=b^2,a^2b=ba,ba^2=ab,bab=a^2$. These look just like some relations in a group, don't they? . In fact, they're satisfied by the elements $a=(123),b=(12)$ of the group $S_3$ of permutations of a set with three elements, so if we show that in this new setting, with $a,b$ as above, if $3|n-1$ then $a^n$ is not equal to a word in two letters among $a,b$, then we're done. This is simple: notice that $3|n-1\Rightarrow a^n=a\not\in\{a^2,b^2,ab,ba\}$.
07.06.2006 13:39
My congrats: it is a very cool solution. I have solved it with old tricks: colouring, parity and stuff like that... It is a bit different, so it may interest some of you. I assign 0 to black coins and +1 or -1 to white ones. I choose the sign with this rule: the sign is + iff the number of black coins to the left is even. In other words, I start from left with + signs and every time I encounter a black coin I change the sign. It is easy to see that the sum of the coins can only stay the same, increase by 3, or decrease by 3. The sum mod 3 is therefore invariant. Moreover, the black coins are always an even number. Thus, when there are only 3 coins left, you will always have 3 whites (sum = +3) or 1 white + 2 blacks. In this case, the game can be solved only if the white one is in the middle. The sum is then -1. The sum starts at +n, thus if n=1 (mod 3), then the sum is always 1 mod 3. But when we are with 3 coins left, the sum can be only 3 or -1 and never 1 mod 3. [] EDIT: Well, my proof can be simplified further: I have considered what happens when there are 3 coins left. Silly my... why not 2 coins left? In that case, they can be either both white (sum = +2) or both black (sum = 0). It can never be 1 mod 3.[]
07.06.2006 16:58
that is very cute, grobber!
29.10.2006 15:00
grobber wrote: $a^{3}=b^{2},a^{2}b=ba,ba^{2}=ab,bab=a^{2}$. These look just like some relations in a group, don't they? . In fact, they're satisfied by the elements $a=(123),b=(12)$ of the group $S_{3}$ of permutations of a set with three elements, What does this mean? I don't really understand. can somebody help?
21.03.2007 15:28
I found still another solution: In my solution, we remember the holes that occur. Now we take away coins until, for the first time, we take a coin next to a hole. as we were able to take it away, it must have been reversed two times. this implies that, in fact, both coins next to it are already taken away. now, the first steps can be commuted arbitrarily. therefore we could as well take at first the three coins that lie next to each other(the middle one at the end) and then proceed in the old way. but taking these three coins leaves us with $n-3$ white coins. this reduces the problem from $n$ to $n-3$ coins and we can proceed by induction.
26.03.2007 03:51
Interesting... people came up with all three of these solutions at MOP! Not being particularly clever at combinatorics, I worked out a bunch of cases until I found the second solution . There is yet another slightly messier solution where you use strong induction. It involves considering how you could have arrived at any given position with 3 markers, but I forget exactly how it goes.
21.11.2007 10:59
let 1 denote white, 0 black. 11 is already in the desired state, 111 turns to 00 in one move. these be the base cases. then notice that in three moves 11...1 becomes 11...1 with 3 fewer 1's, so by induction we've covered all $ n \equiv 2,3\pmod{3}$. for the converse, find an invariant (this is the more interesting part ).
25.11.2007 17:11
oh, it is'nt easy. Can you post you solution more details?
26.11.2007 11:53
yo!, I found the invariant of this problem but I can't prove that when there are 2 markers on a row, they are in same color. Who can help me??
26.11.2007 23:22
what do you mean by two markers in a row are the same color? because certainly it can happen that not all markers are the same color, and then there'll certainly be two adjacent markers of different colors. do you maybe mean two markers left at the end?
27.11.2007 06:07
, my English is quite bad. but I think when there are only 2 markers on a row (when the game ends), they are the same color. Who can help me prove that? Thanks a lot!
27.11.2007 06:58
okay, so it's what i thought... to prove that isn't hard... let whites be +1, let blacks be -1. then every time we make a move, the product of the cards stays the same. at the beginning it's +1, so at the end, we must have two + or two -
14.04.2014 21:14
12.08.2014 08:31
Indeed, Juan's one-liner is basically equivalent to grobber's dihedral group solution.
06.02.2017 05:12
24.10.2017 02:31
Label the markers $1, \cdots , n$. It's easy to see by induction that we can get two markers in the end if $n \equiv 0, 2\pmod{3}$ if we remove markesr $2, 4, 3$ in this order. Now we will prove via induction that for $n \equiv 1 \pmod{3}$ it would be impossible to get down to two markers, for $n \equiv 0 \pmod{3}$ we would get two black markers and for $n \equiv 2 \pmod{3}$ we would get two white markers. The base cases $n = 2, 3, 4$ are easy to see. If for $n$ we can get down to two markers,those two markers must be markers $1, n$ and also there must be some sequence of steps for which we can get down to three markers. Let the marker be $i$. Thus for $n$ we consider two subproblems before getting down to three, one for the markers $1, 2 \cdots i$, the other for markers $i, i+1, \cdots n$ with the constraint that we can't remove markers $1, i, n$. This is valid since flippings in the former subproblem can't affect any in the latter subproblem and vice versa with the exception of $i$. So we just keep track of the color of $i$. Note that the two subproblem each have size less than $n$ which sum to $n+1$. Now, we do case work: $n \equiv 0 \pmod{3}$. The subproblems are of size $0 \pmod{3}$ and $1 \pmod{3}$ or both size $2 \pmod{3}$. By induction, the former case is impossible and in the latter case $1$, $i$ and $n$ are white after the subproblem. Then when we have three markers and flip $i$, the first and last markers become black as desired. $n \equiv 1 \pmod{3}$. Suppose we can get down to three markers at some point for contradiction. The subproblems are of size $0 \pmod{3}$ and $2 \pmod{3}$ or both size $1 \pmod{3}$. By induction, the latter case is impossible and in the former case we would have $1$, $i$, and $n$ be black, black, white respectively, so that we can't flip $i$. $n \equiv 2 \pmod{3}$. The subproblems are of size $1 \pmod{3}$ and $2 \pmod{3}$ or both size $0 \pmod{3}$. By induction, the former case is impossible and in the later case $1$, $i$, and $n$ are black, white, black respectively and after flipping $i$ we get two white end markers.
24.10.2017 02:40
JuanOrtiz wrote:
Can someone explain how to come up with this invariance?
23.04.2018 15:42
mathadventurer wrote: JuanOrtiz wrote:
Can someone explain how to come up with this invariance? Bump !
27.04.2019 03:54
It is very hard to come up with this invariance without first thinking of the group $D_6$, however if you don't know group theory, just look at the equivalences bwb=ww www=bb bww=wb wwb=bw Then you should be able to construct something similar to the group $D_6$, and set up some invariance.
22.07.2019 20:13
pandadude wrote: It is very hard to come up with this invariance without first thinking of the group $D_6$, however if you don't know group theory, just look at the equivalences bwb=ww www=bb bww=wb wwb=bw Then you should be able to construct something similar to the group $D_6$, and set up some invariance. Can you explain it with full details, I am just learning group theory and I don’t understand. Thank you!
08.08.2019 00:30
The dihedral group of order $2n$ is constructed by two elements, $r$ and $s$, which correspond to transformations of a regular $n$-gon. In particular, $r$ corresponds to a rotational symmetry of the $n$-gon that sends vertices to adjacent vertices, and $s$ to a rotation. We will consider $D_6$, the symmetries of an equilateral triangle. Interpret the state of the game as a expression by writing $r$ when we see a white marker, and $s$ when we see a black marker. So when we start, our expression is $r\cdot r\cdot r\dots = r^n$. When ever we make a valid move, we end up with an expression that is equal to the original in $D_6$. This is because we are replacing $r^3$ with $s^2$, $r^2s$ with $sr$ and so on, and $r^3=s^2, r^2s = sr$ in $D_6$. Therefore, when we start with $n\equiv 1\pmod 3$ markers, our expression has the value $r^{3k+1} = r$, as the order of $r$ is $3$. But since none of $rr, rs, sr, ss$ evaluate to $r$, it is impossible that we have two markers appearing at any point.
27.12.2019 17:09
First, we will show that if $3\nmid n-1$, it is possible. Consider the sequence of moves $$OOOOO\to XXOO\to XOX\to OO$$This shows that if there are 5 white markers at the end, we can remove 3 of them. Using this repeatedly, if $n\equiv 2\pmod 3$, we can get it down to 2 white markers, and if $n\equiv 0\pmod 3$, we can get it to 3, after which one move gets us down to 2 markers. Now, we will show $3|n-1$ is impossible. Since we always flip two markers at once, the number of black markers remains even. Now, if we have a state where black markers are at positions $x_1,x_2,\ldots, x_{2k}$, and there are $m$ markers left, I define the leekiness of the arrangement to be $$m-x_1+x_2-x_3+\ldots+x_{2k}\pmod 3$$. It is not hard to show, through casework, that the leekiness is indeed an invariant. Suppose $n\equiv 1\pmod 3$. Then, its initial leekiness is $1$. So, if we get it down to 2 markers, the arrangement should still have a leekiness of 1. However, there are only 2 possible arrangements of markers at 2 markers, namely $XX$ and $OO$, and these have leekinesses of 0 and 2 respectively. Thus, $n\equiv 1\pmod 3$ is impossible.
10.02.2020 23:15
This is essentially the same group theory solution, but I believe with a lot more motivation. In particular, the approach is direct and doesn't involve magically noticing the dihedral group of order $6$. Therefore, the part about showing $n\equiv 1\pmod{3}$ can't be done will read less like a concise solution, and more like how I came up with the solution. Firstly, we kill the easy part by noting that \[WWWWW\to BBWW\to BWB\to WW,\]so we can reduce $n$ whites to $n-3$ whites for $n\ge 5$. This shows that we can resolve $3\nmid n-1$ case. Now we'll show that if a string of $n$ whites can be reduced to a string of length $2$, then $3\nmid n-1$. After playing with this problem for a bit, one realizes that this is essentially word manipulation (in the group theory sense) with relations \begin{align*} w^3&=b^2 \\ w^2b&=bw \\ bw^2&=wb \\ bwb&=w^2. \end{align*}Indeed, let $G$ be the group with generators $b$ and $w$ with the above relations. We see that if we can reduce a string $A$ to a string $B$ using the operation of the problem, then $A$ and $B$ are equal in the group $G$. Note that the reverse implication is technically not logically true, but it's irrelelvant for this direction of the proof, since we'll just show that $w^n$ is not equal to any of $w^2,wb,bw,b^2$ in the group $G$ for $n\equiv 1\pmod{3}$. Our goal now is to determine $G$. Combining the third and fourth relations, we have \[b^2wb=b(bwb)=bw^2=wb,\]so $b^2=\mathrm{id}$. We also have \[(wb)^2=wb(bw^2)=w^3=b^2=\mathrm{id}\]and \[(bw)^2=(bwb)w=w^3=b^2=\mathrm{id}\]Thus, $\boxed{b^2=(wb)^2=(bw)^2=w^3=\mathrm{id}}$. It's not hard to see using these and the original relations that any word of length four or more can be reduced to a word of length at most $3$. Furthermore, it's easy to check that all words can be reduced to some word in the set \[\{\mathrm{id},b,w,w^2,bw,wb\}.\]We're technically not done, since it is theoretically possible that one of these words could be further reduced through some tricky maniuplation. However it's very unlikely that using the relations given that we'd be able to reduce any of these words further, so to show that this is indeed the case, all we have to do is present a group of order $6$ that satisfies our relations. We would like $bw\ne wb$, since otherwise, our group collapses to a much smaller size. There is exactly one nonabelian group of order $6$, and that is the symmetric group on $3$ elements (or the dihedral group of order $6$). Thankfully this works just fine with say $w=(123)$ and $b=(12)$, so in fact, our group $G$ consists of the $6$ distinct elements \[\{\mathrm{id},b,w,w^2,bw,wb\}.\]Now, if we could show that $w^n\not\in\{b^2,w^2,bw,wb\}$ for $n\equiv 1\pmod{3}$, we'd be done. Indeed, we see that $w^3=w$, and \[w\not\in\{b^2,w^2,bw,wb\}=\{\mathrm{id},w^2,bw,wb\}.\]This completes this direction of the solution, so we're done.
24.02.2020 14:35
as we can see 4 is not good and 7 is also not good so we assume like in induction that 3(k-1) +1 is also not good now we prove that 3k+1 is also not good now if we take the 3nth white and then 3n -2 white and the white which we get in the middle of the two black markers we get a 3(k-1) +1 sequence of white markers. which by our hypothesis is not possible.Now if we take some other arrangemets in the starting so after q moves where q>3 and less than 3n-1 we see they are the arrangements of the previous 3k +1s hence not possible
19.07.2020 22:57
Inductive Construction: Let $k$ be a positive integer. We provide an inductive construction for $n = 3k+2$ and $n=3k$. Note that the base cases $n=2$ and $n=3$ are trivial. Denote a white marker by $W$, and a black marker by $B$. We represent the row of markers as a string of length $n$. Note that the original state is $$WWWWW \dots $$We will prove that we can reduce the number of white markers by $3$ and still keep all the markers white. But this is achievable by removing the $1$st, $2$nd, and $2$nd markers from the left, in that order: $$WWWWW \dots \to BBWW \dots \to BWB \dots \to WW \dots$$completing the induction. Proof of Impossibility: Let $k$ be a positive integer. We will show that $n=3k+1$ is impossible. We set up an invariant. For each marker located $x$ places from the left, consider the function $$ f(x) = \begin{cases} 1 & \text{if marker $x$ is white and the number of black markers to the left of $x$ is even} \\ 0 & \text{if marker $x$ is black} \\ -1 & \text{if marker $x$ is white and the number of black markers to the left of $x$ is odd} \end{cases}$$ Let $S$ be the sum of $f(i)$ for all $1 \leq i \leq n$. Note that $S \equiv 1\pmod 3$. The key observation is that after each step, $S$ is invariant$\pmod 3$. Suppose that marker $i$ was removed. Note that there are only three values of $f(i)$ that are changed: $f(i-1), f(i),$ and $f(i+1).$ Moreover, note that since $f(i-1),f(i)$ and $f(i), f(i+1)$ have opposite parities, the sum $S$ is decreased by $3 f(i)$, and so stays the same$\pmod 3$. Now suppose for the sake of contradiction that we were able to reach a state with $2$ markers. Note that the total number of black markers is always even, so in the end the two markers must either be both black or both white. Now $S \equiv 0 \pmod 3$ or $S \equiv 2 \pmod 3$, and we have our desired contradiction. $\blacksquare$
04.08.2020 10:19
Let $P(n)=1$ if $n$ fulfills the condition and $P(n)=0$ otherwise. The proof that $P(n)=1$ if $3\nmid n-1$ is quite simple. Note that if $n>4,$ we can remove three white pieces from the row. To do this, we utilize the following diagram, where $X$ indicates a black piece and $O$ indicates a white piece. So given any consecutive $5$ white pieces, we can do the following steps: \[\cdots OOOOO\cdots\]\[\cdots XXOO\cdots\]\[\cdots XOX\cdots\]\[\cdots OO\cdots\]which means we now can induct from $n$ to $n+3.$ Obviously $n=2$ just works, and $n=3$ goes from $OOO$ to $XX,$ so that also works. Now we show that $P(n)=0$ if $3\mid n-1.$ To do this, define the inverse operation as well. Note that this is an associative operation, so we just need to think about the operation $A^n$ for some integer $n,$ where $A$ is the original element (remove and reverse) and $A^{-1}$ is the inverse. So we define the infinite group of all orderings that can be achieved from $4$ white markers, $A,$ and $A^{-1}.$ Let $Q(n)$ be the function on the original operation and its inverse for $n\geq 2.$ Then $P(n)=1$ implies $Q(n)=1,$ and also note that $Q(n)=Q(n+3)$ because we can reverse our steps to add three white pieces to the row. Thus \[Q(4)=Q(7)=\cdots.\]Now we just show that $Q(4)=0$ by showing that we cannot get from $4$ white pieces to $2$ black pieces, $2$ white pieces, or $1$ black and $1$ white piece. We obviously can't have $1$ black and $1$ white piece because it cannot even reach the state of all white pieces. This is because the parity of the black pieces is invariant. Now it is obvious we can get from $2$ black or $2$ white to all white, since we went from all white to those cases. Also note that the $2$ black case is equivalent to the $3$ white case. Now we show that it isn't possible if we start with $n\equiv 1\pmod{3}$ whites. Let the minimum number of consecutive white pieces we can remove or insert into one place be $k.$ We clearly know that $k\mid 3,$ so we just have to show $k\neq 1.$ Since each operation changes the number of pieces in the row by $1,$ and the group operation is associative, we just need to show that $A$ does not just remove a white piece and $A^{-1}$ does not just add a white piece, which is obvious. Clearly $P(1)=0,$ so we don't even need to consider that case in our main proof.
10.01.2022 23:27
Group theory . Firstly, if $n=2,3$, then it is clearly achievable. For higher $n$ that are still $\equiv 2,3 \pmod{3}$, the series of moves \[WWWWW\cdots \mapsto BBWW\cdots \mapsto BWB\cdots \mapsto WW\cdots\]is valid since $n\geq 5$. This removes 3 '$W$'s, which allows us to induct downwards. $\square$. If $n\equiv 1\pmod{3}$, it is impossible. We consider the dihedral group $D_6$, where we parse the list of white and black markers as a composition of actions on an equilateral triangle; white represents clockwise rotation and black represents swapping the bottom pair. By inspection, this satisfies \[WWW=BB\]\[WWB=BW\]\[BWW=WB\]\[BWB=WW\]Thus, each move preserves the total transformation. Finally, since $W^{3k+1} = W \notin \{WW,BW,WB,BB\}$, we can never get to a state with two markers and we are done. $\blacksquare$.
25.02.2022 20:58
We say a marker is a $valence$ marker if it's one of the two outer markers and a $core$ marker otherwise. We say that we operate on a marker if we remove it and let the $singleton$ be the last marker operated on. Notice that if a marker ends up black it was flipped an even under of times and white otherwise. the construction for $n=3k$ and $n=3k-1$ are easy to find. we claim that if $n \equiv 0,1,2$ (mod $3$) then the valence markers are both black, different colors, and both white respectively. We will proceed with induction. Indeed, notice that this result clearly holds for $n=2,3,4$. So, assume it holds for all $n<k$. This gives three cases. Case 1: $n \equiv 0$ (mod $3$) Notice that the singleton splits the set of markers into two groups. Since we will not remove the singleton until the end, it acts as a sort of sub-valence marker as it will not be removed until the very end. Notice that the singleton must end with its white side facing up to be removed on the last move. Let the black marker be in position $N$ from the left. i. If $N \equiv 0,1$ (mod $3$) then this splits this case into two sub-cases of $a \equiv 0$ and $1 \equiv 2$ (mod $3$). Notice that the $b \equiv 0$ (mod $3$) leaves the singleton flipped an even number of times and the $a \equiv 1$ (mod $3$) flipped the singleton the number of times opposite to one of the valence markers. It is known that the singleton is flipped an odd number of times since it must end up on the white side. Thus, the two valence markers were flipped an even number of times. ii. If $N \equiv 2$ (mod 3) then this splits into two sub-cases of $a \equiv 2$ and $b \equiv 2$. Each of these cases flips the singleton an odd number of times. Flipping the singleton an even number of times in total leaves it black. Contradiction. So this case is impossible. Case 2: $n \equiv 1$ (mod $3$) i. If $N \equiv 1,2$ (mod $3$) then the two sub-cases are $a \equiv 2$ and $b \equiv 0$. $b \equiv 2$ makes one valence marker white and the $a \equiv 0$ case makes the other valence marker black. This also makes the singleton white. ii. if $N \equiv 0$ (mod $3$) then we get that $a \equiv b \equiv 1$ if the two valence markers are the same color then we flipped the singleton an even number of times. This is contradiction. Thus, the two valence markers are different colors. Case 3: $n \equiv 2$ (mod $3$) i. If $N \equiv 2,0$ then the two subcases are $a \equiv 1$ and $b \equiv 2$. For the singleton to be white, the valence markers are clearly both white ii. If $N \equiv 1$ then the subcase is $a \equiv b \equiv 2$ leaves the singleton black. Contradiction. This completes the induction. $\square$ Thus, if we assume that in $n=3k+1$ then we end with one black marker and one white marker. But, the number of black markers is clearly always even. Thus, this is impossible. $\blacksquare$
18.05.2022 17:42
if: we can always delete 3 markers at the end if there are 5 or more at the start. only if: suppose that a counter $x$ exists, starting from 0; from left to right, each instance of a B marker increases $x$ by $1$, and each instance of a W marker negates $x$. Then, the final value of $x$ is invariant mod 3. I pretty much knew immediately that there would be an invariant, and this 2-liner still took me close to 3 hours. It also seems to be isomorphic to other "nicer" solutions.
08.10.2022 18:31
19.02.2023 01:45
Let the characteristic sequence of a state of marker parity be determined in the following way: start from the left. The first number of your sequence will be the number of white markers before the first black marker. The second number will be the same number when the first black marker and the ones to the left of it are removed. For example, the characteristic sequence of BBWWBBWBBW will be $(0,0,2,0,1,0,1)$. Note that the parity of the number of black markers is invariant, so the number of terms in the sequence is odd. If the characteristic sequence is $(a_1,a_2,\dots,a_{2k+1})$ then let the characteristic index of the sequence be $a_1-a_2+a_3-\dots +a_{2k+1}$. Suppose we flip a WWW. Then, the characteristic sequence goes from $(\dots, a+b+3 , \dots)$ to $(\dots,a,0,b,\dots)$. Suppose we flip a BWW. Then, the characteristic sequence goes from $(\dots,a,b,\dots)$ to $(\dots, a+1,b-2,\dots)$. Suppose we flip a WWB. Then, the characterstic sequence goes from $(\dots,a,b,\dots)$ to $(\dots,a-2,b+1,\dots)$. Suppose we flip a BWB. Then, the characterstic sequence goes from $(\dots,a,1,b,\dots)$ to $(\dots,a+b+2,\dots)$. In each case, it is easy to check that the index $\pmod 3$ is invariant. This index $\pmod 3$ always starts the same as $n$. Note that the only possible endings are WW or BB since the number of black markers is always even. Clearly, the index $\pmod 3$ must be $0$ or $2$. Now, to prove that this is sufficient: $\dots$WWWWW $\to$ $\dots$WWBB $\to$ $\dots$BWB $\dots$WW and we are done by induction.
24.09.2023 21:17
You are the dihedral group in the shape of my heart. Claim: This is impossible for $3 \mid n - 1$. Proof. Let $b, w$ be elements of $D_3$ such that $b$ is a reflection and $w$ is a rotation. Then $bwb = ww, bww = wb, wwb = bw, www = bb$. This then implies that $w^n = w \in \{ww, wb, bw, bb\}$ which is false. $\blacksquare$ Claim: This is possible for all other $n$. Proof. Note that we can easily construct the cases $n = 2$ and $n = 3$. Then repeating the pattern $wwwww \to bbww \to bwb \to ww$ which trims off $3$ of the $w$s finishes. $\blacksquare$
09.04.2024 16:58
This solution is basically the polar opposite of the above lol. If $3\nmid n-1$, then we can reduce a configuration of $n$ markers to $n-3$ markers by choosing markets $2,4,3$ in that order in a row of five. The base cases are trivial so our construction is complete. For our proof, we will consider the process going backwards. Let black be $0$ and white be $1$. We start with two bits and each time, we choose two consecutive bits, flip them, and add a $1$ between them. We want to prove that we can never reach a string of length $3k+1$ with all $1$s. We may check that the strings of length $3$ we can reach are $111,110,011,010$. We may check that the strings of length $4$ we can reach are $0101,1010,0100,1011,1101,0010,1100,0011$. We will now prove the main claim, which will immediately finish. Claim. In a string of length $3k+1$, there will always be a $10$ or $01$ somewhere other than the edge of the string. Proof. We perform a finite case check. Note that this was true for strings of length $4$, so we will induct on $k$. If $k$ works, then the string can be seen as $?01?$ or $?10?$, where the $?$ are nonempty strings. In what follows, we assume that both sides of the string are padded with a $?$. The reachable strings of length $3k+2$ are $011,110,100,001,111$. The reachable strings of length $3k+3$ are $1111,0101,1010,1011,1101,1000,0001,0010,0100,0110$. Now note that we need exactly $?11111?$ for a counterexample(since we can't reach $?00000?$ from these), so the only way there is a counterexample is if there is a reachable string that is $0111,0011,1001,1100,1110$. But none of these appear in the above list, so we are done. $\blacksquare$ Remark. The reason that I decided to chase this bash is that it basically had to work. The strings of length $4$ we can reach are exactly all $?01?$ and $?10?$, so this is kind of the most information you could possibly extract out of a string with length $3k+1$(if a configuration with $?01?$ or $?10?$ can win, then the problem is false, and if the problem is true, then the configuration must have a $?01?$ or $?10?$).
08.07.2024 03:08
The if direction is easy: We show that we can get from $m$ white markers in a row to $m-3$ white markers in a row: $$\dots WWWWWW \dots$$$$\dots WBWBW \dots $$$$\dots BWBW\dots $$$$\dots WWW \dots.$$This means that for all $n$ congruent to $0,2$ modulo $3,$ we can either reach $WW$ or $WWW \rightarrow BB,$ reaching the state of two markers. Now the other direction. First, notice that the parity of the number of black markers does not change over all operations. We index the white markers with $(-1)^{w_i},$ where $w_i$ is the number of black markers to the left of the $ith$ white marker. The sum of all indices is invariant modulo $3$ under all operations. The only possible sum of indices of states with 2 markers is $0$ or $2$ as it is either $WW$ or $BB.$ Therefore, we cannot start with an index sum of $3n+1$ and reach an index sum of $0$ or $2$ by invariance. Therefore, we have shown the "only if" direction too. Q.E.D
16.07.2024 02:27
Let $D_6$ be the dihedral group of order $6$. Then we will denote the white and black markers as $w$ and $b$, where $w$ and $b$ correspond to a $120^\circ$ and vertical reflection respectively in group $D_6$. For example, $wwwbbw = w^4b^2 = w$. We can manually check that $www = bb$, $bwb = ww$, $bww = wb$, and $wwb = bw$(and these are also all of our possible ending positions too). So it follows that the corresponding dihedral position is invariant regardless of what moves we make. Now, note that our beginning position $w^{3k+1} = w$ since $w^3 = 1$. Now since $w \neq bb, ww, wb, bw$ we find that it is impossible if $n \equiv 1\pmod{3}$. It is also clear that if $n \equiv 0, 2\pmod{3}$ then we get a valid possible ending, so we are done.