A game starts with seven coins aligned on a table, all with the crown face up. To win the game, you need to flip some coins in such a way that, in the end, two adjacent coins always have different faces up. The rule of the game is to flip two adjacent coins in each move. What is the minimum number of moves required to win the game?

![](https://cdn.mathpix.com/cropped/2024_05_01_666a1aec7e447b0a6cbeg-016.jpg?height=143&width=842&top_left_y=1650&top_left_x=641)
Assigning the value 1 to heads and -1 to tails and summing the results after each flip, the game starts with a sum of 7 and we want to reach alternating heads and tails, so that the game ends at 1 or -1. We observe that, in each step of the game, we have the following possibilities: we exchange two heads for two tails and the value of the sum decreases by 4; we exchange one head and one tail for one tail and one head and the value of the sum remains unchanged; or we exchange two tails for two heads and the value of the sum increases by 4. Therefore, it is impossible to start from 7 as the initial sum and reach 1, but let's see that, indeed, it is possible to reach -1, that is, four tails and three heads. Since we want to obtain four non-consecutive tails, we need at least four moves.

The four moves, which make the sum go from 7 to 3, from 3 to -1, and then remain at -1, are illustrated in the figure.

![](https://cdn.mathpix.com/cropped/2024_05_01_666a1aec7e447b0a6cbeg-061.jpg?height=629&width=823&top_left_y=385&top_left_x=545)