The Bank of Pittsburgh issues coins that have a heads side and a tails side. Vera has a row of 2023 such coins alternately tails-up and heads-up, with the leftmost coin tails-up. In a move, Vera may flip over one of the coins in the row, subject to the following rules: On the first move, Vera may flip over any of the $2023$ coins. On all subsequent moves, Vera may only flip over a coin adjacent to the coin she flipped on the previous move. (We do not consider a coin to be adjacent to itself.) Determine the smallest possible number of moves Vera can make to reach a state in which every coin is heads-up. Luke Robitaille
Problem
Source: USA TSTST 2023/7
Tags: combinatorics, USA TSTST
26.06.2023 19:37
The answer is $\boxed{4044}$. In general, replacing $2023$ with $4n+3$, the answer is $8n+4$. Bound Observe that the first and last coins must be flipped, and so every coin is flipped at least once. Then, the $2n+1$ even-indexed coins must be flipped at least twice, so they are flipped at least $4n+2$ times. The $2n+2$ odd-indexed coins must then be flipped at least $4n+1$ times. Since there are an even number of these coins, the total flip count must be even, so they are actually flipped a total of at least $4n+2$ times, for a total of at least $8n+4$ flips in all. Construction For $k=0,1,\dots,n-1$, flip $(4k+1, 4k+2, 4k+3, 4k+2, 4k+3, 4k+4, 4k+3, 4k+4)$ in that order; then at the end, flip $4n+1$, $4n+2$, $4n+3$, $4n+2$. This is illustrated below for $4n+3=15$. [asy][asy] unitsize(12); int m = 3; int n = 4*m+3; int[] aux = {1, 2, 3, 2, 3, 4, 3, 4}; int[] a = {}; pen[] cols = {mediumblue, mediumred}; for (int i = 0; i <= m; ++i) { for (int j = 0; j < aux.length; ++j) { a.push(aux[j]+4*i); } } for (int i = 0; i < 4; ++i) { a.pop(); } transform t = scale(1, -1); for (int i = 1; i <= n; ++i) { label((string) i, t*(0, i), cols[i % 2]); } for (int i = 0; i < a.length; ++i) { dot(t*(i+1, a[i]), cols[a[i] % 2]); } for (int i = 1; i < n; ++i) { draw(t*((-0.5, i+0.5)--(a.length+0.5, i+0.5)), gray(0.7)); } for (int i = 0; i < 2*n-2; i += 8) { draw(t*((i+0.5, 0.5)--(i+0.5, n+0.5)), gray(0.7)); } for (int i = 4; i < n; i += 4) { draw(t*((-0.5, i+0.5)--(a.length+0.5, i+0.5)), black + 1.4); } [/asy][/asy] It is easy to check this works, and there are $4044$ flips, as desired.
27.06.2023 02:38
The answer is $4044$. Number the coins from $1$ to $2023$. Obviously, Vera must flip each odd coin an odd number of times and each even coin an even number of times. We first have the following claim. Claim: No even coin can be flipped $0$ times. Proof: If some coin is never flipped, then either none of the coins to its left are flipped or none of the coins to its right are flipped. But for every even coin, there exist odd coins on both of its sides, which must be flipped at least once: contradiction. $\blacksquare$ Therefore there must be at least $2\lfloor 2023/2\rfloor=2022$ total flips of even coins. Furthermore, the number of the coin flipped must alternate between odd and even, so there are at least $2021$ total flips of odd coins. However, we have the additional condition that each odd coin is flipped an odd number of times, and since there are an even number ($1012$) of odd coins, there must be an even number of odd coin flips, hence we need at least $2022$ of them, which gives at least $4044$ total coin flips. For a construction, flip $2,1,2,3$ in that order. Then flip $4m,4m+1,4m,4m+1,4m+2,4m+1,4m+2,4m+3$ for $m=1,2,\ldots,505$ in that order. This gives exactly $8\cdot 505+4=4044$ flips, so we are done. $\blacksquare$
28.06.2023 09:25
Answer: $\boxed{4044}$. To show attainability, take $S_m=(4m, 4m+1, 4m, 4m+1, 4m+2, 4m+1, 4m+2, 4m+3)$ and let the coins be numbered $1,2,3,\ldots, 2023$ in order. Then take: $$2,1,2,3, S_2, S_3, S_4,\ldots, S_{505}$$which works since $S_k$'s last is $4k+3=4(k+1)-1$ so we only ever flip adjacent coins, and odd numbers are flipped once or thrice (now heads), even numbers are flipped twice (still heads). To prove the bound, notice that both the first and last coins are flipped so each coin is flipped at least once by the Discrete Intermediate Value Theorem. Assume FTSOC we have three consecutive coins $i-1, i,i+1$ not including $1$ or $2023$ that are flipped once, twice, once respectively in order. Then $i$ is even so $4\leq i\leq 2020$. We have a contradiction as either $i-2$ is not flipped or $i+2$ is not flipped, but $2\leq i-2\leq 2022$. Therefore, in every four consecutive coins $4m-2, 4m-1, 4m, 4m+1$ excluding $1$ or $2023$, we must have flipped them at least $2+1+2+3=8$ times. Since $1$ and $2023$ are flipped at least once and $2022$ is flipped at least twice, summing over $m=1, 2, 3,\ldots, 505$, we need at least: $$1+1+2+8\times 505=4044$$moves as desired.
29.06.2023 09:57
Replace $2023$ with $4m+3,$ for $m=505$. We claim the answer is $8m+4$. The problem splits into two parts. Part 1: We need at least that many flips. Call each initially heads-up coint a good coin. Note that the first and the last coin must both be flipped, and so all coins must be flipped at least once. However, all good coins must start and end in the same state, and so each one of the good coins must be flipped at least two times, for a total of $2(2m+1)=4m+2$ flips among good coins. Now, note that each one of these flips are not consecutive, and so we must have at least $4m$ more flips among not-good coins (apart from the first and the last coin), for a total of at least $1+1+(4m+2)+4m=8m+4$ flips. Part 2: That many flips suffice. My construction is the same as Evan's, hence I won't bother writing it Hence, the answer to the problem is $8m+4=4044$.
30.06.2023 03:35
Fun fact: the Vera in this problem is Vera Krekanova, the current Chair of the Board of Directors of the Pittsburgh Branch of the Federal Reserve Bank of Cleveland.
08.01.2024 04:57
The answer is $1010 \cdot 4 + 4 = 4044$. In particular, the answer for $4n+3$ coins is always $8n+4$. Label the cards $c_1, c_2, \dots, c_{2023}$. Construction: We construct by groups of four. In particular, starting from the rightmost coin, we can perform $$HTHT \to HTHH \to HTTH \to HHTH \to HHHH \to HTHH \to TTHH \to THHH \to HHHH.$$After these eight moves, the next move may be on the rightmost $T$ of the next group of four, so we may proceed inductively (note that for $3$ coins, we can finish in $4$ moves). Bound: Observe that every coin is flipped at least once because in order to flip both the first and last coins in the row, every coin in between must be flipped at least once too. Hence, every coin that originally shows $H$ is flipped at least twice. Claim. For some even $i$, if $c_{i+1}$ is flipped only once, the $c_{i-1}$ must both be flipped three times as long as $c_i$ is not the last coin flipped, and a similar result holds for $(c_{i+2}, c_{i+3})$. Proof. Suppose that $c_{i+3}$ is only flipped once. However, $c_{i+2}$ must be flipped twice, and the two coins flipped before and after flipping $c_{i+2}$ are in the set $\{c_{i-1}, c_{i+3}\}$. There are at least three flips that must fall in this set by assumption, which is a contradiction. Similarly, $c_{i-1}$ must also be flipped three times. $\blacksquare$ It follows that there does not exist an index $i$ with $i \neq 1$ such that $c_i$ and $c_{i+2}$ are both flipped once. Then, of the $2n+2$ coins that originally show tails, at least $n$ of them are flipped three times, so the total number of flips is $$T \geq 3n + (n+2) + 2(2n+1) = 8n+4,$$as needed.
08.01.2024 05:21
when i did this in contest i got something around $2022^2$ after around four hours of hard thinking. therefore i achieved the impressive score of $010$ on day three. i love combo
07.07.2024 13:36
Solved with Om245. Rather nice problem, enjoyed it immensely. We solve the problem for the general case where we have a $4n+3$ for some $n\in \mathbb{N}_0$ number of coins. We claim that the minimal number of flips required is given by the function, \[M(4n+3)=8n+4\]We start off by providing a construction. We simply give the number of the coin to be flipped in each move where the coins are numbers $1$ through $n$ from left to right. For $n=3$ consider the following sequence of moves, \[1 \to 2 \to 3 \to 2\]Now, we show that if $M(4n-1)=8n-4$ then $M(4n+3)=8n+4$. Consider the sequence of moves, \[1 \to 2 \to 3 \to 2 \to 3 \to 4 \to 3 \to 4\]which makes all the first 4 coins $H$. Then, we are adjacent to the $5^{\text{th}}$ coin so, we can apply the inductive hypothesis that we can flip all the leftmost $4n-1$ coins to $H$ in $8n-4$ moves, so we need a total of $8n+4$ moves as desired. Now, we prove the bound. Let a coin be called odd if it is at an odd numbered position and even otherwise. Then, it is not hard to see that since all odd coins are initially $T$ they must all be flipped atleast once. In particular both the first and last $T$ coins must be flipped atleast once, which due to the nature of Vera's move implies that all the coins are flipped atleast once. Next, since the even coins are initially $H$ and they need to stay $H$ in the final state they must be flipped an even number of times, and thus must be flipped atleast twice. Looking at the odd coins, they must be flipped atleast once. Further, for every even coin, atleast one of its two neighboring odd coins must be flipped atleast twice. This is because each even coin must be flipped atleast twice as mentioned before, so if both its neighbors were visited once, unless we start on the considered even move (and there is exactly one starting coin), we must have entered the considered even coin once using (i.e the coin which was flipped right before this even coin) one of its neighbors and entered it for the second time using the other. But then, we cannot escape from the coin without visiting one of its neighbors again! Thus, atleast half the odd coins were visited atleast twice (atleast $n+1$ coins) and since they must be flipped an odd number of times these coins were visited atleast 3 times. In total, we cannot avoid making atleast, \[M(4n+3) \ge 2(2n+1) + 3(n+1) +n -1 = 8n + 4\]flips (in case its unclear the removed flip is due to the fact that starting(the first coin Vera flips) from an even numbered coin, neither of its neighbors is forces to be visited twice), which is indeed the bound we wanted.
24.12.2024 21:35
Merry Christmas Eve We claim the answer is $\boxed{4044}$ with the following construction. Start with the first block of four and do this $$THTH$$$$HHTH$$$$HTTH$$$$HTHH$$$$HHHH$$$$HHTH$$$$HHTT$$$$HHHT$$$$HHHH$$Repeat this on the next $504$ blocks of $4$ for a total of $505 \cdot 8 = 4040$ moves. To finish on the last $3$ perform the following moves $$THT$$$$HHT$$$$HTT$$$$HTH$$$$HHH$$A total of $4$ moves, so $4040+4=4044$ moves is indeed attainable. To prove this is optimal suppose we started on the $k^{\text{th}}$ coin from the left. And assume we flip the Leftmost coin before the rightmost coin. Then we must move at least $k-1$ times to the left, and then at least $2022$ times to the right. However we must do at least $2\cdot 1011$ moves (left right/ right left pairs) to correct for the $T$ we flipped twice left of spot $k$, and the $H$ we flipped once on the right of spot $k$. Therefore we must make at least $2 \cdot 1011 +2022 + k -1 = k + 4044 \ge 4044$ moves and we are finished.
21.01.2025 13:57
Answer is $4044$. We will prove that for $4k+3$ coins, the answer is $8k+4$. The problem is equavilent to the following one. New Problem Statement: $f$ is a continuous function defined in $[1,m]$ taking values between $1$ and $2023$. $f(n)=2l+1$ has odd number of solutions and $f(n)=2l$ has even number of solutions. Find the minimum value of $m$. Lower Bound: Since $1,2023$ are taken values (becuse they are odd), each even number must be visited at least twice. Thus, $m\geq 2.1011+2021$ and $m$ must be even so $m\geq 4044$. Construction: First, answer is $4$ for $3$ because $THT\rightarrow TTT\rightarrow TTH\rightarrow THH\rightarrow HHH$ satisfies. Assume that $8k+4$ holds for $4k+3$. Let's show that $8k+12$ holds for $4k+7$. We start from the second coin from last and finish at the first coin. Suppose that we made $8k+7$ moves and the last $4k+3$ coins are heads. We turn the fourth, third, second, third, fourth, third, second and first which completes our induction as desired.$\blacksquare$ $$ \begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|} \hline T&H&T&H&H&H&H&H&H\\\hline &3&2&1&0&&&&\\\hline &&4&5&&&&&\\\hline 8&7&6&&&&&&\\\hline \end{array} $$