A game starts with 7 coins aligned on a table, all with the head side facing up. To win the game, you need to flip some coins so that in the end, two adjacent coins are always with different sides facing up. The rule of the game is: in each move, you have to flip two adjacent coins. What is the minimum number of moves required to win the game?

![](https://cdn.mathpix.com/cropped/2024_05_01_04afcf84596e2b884570g-1.jpg?height=128&width=843&top_left_y=1318&top_left_x=618)
If we assign the value of 1 to heads and -1 to tails and sum the results after each flip, the game starts with a sum of 7 and we need to reach alternating heads and tails, so the game ends at 1 or -1. We observe that at each step of the game, we have the following possibilities: we swap two heads for two tails and the sum decreases by 4; we swap one head and one tail for one tail and one head and the sum remains unchanged; or we swap two tails for two heads and the sum increases by 4. Therefore, it is impossible to go from an initial sum of 7 to 1, but it is possible to reach -1, which is 4 tails and 3 heads. Since we need to obtain 4 non-consecutive tails, we need at least 4 moves. The 4 moves are illustrated in the following diagram:

![](https://cdn.mathpix.com/cropped/2024_05_01_04afcf84596e2b884570g-4.jpg?height=622&width=808&top_left_y=1962&top_left_x=701)