4. Out of 43 coins arranged in a row, 8 coins are facing "tails" up, and 35 are facing "heads" up. In one step, any 20 coins can be flipped. Is it possible after a finite number of steps for all the coins to be facing "heads" up? In the minimum number of steps, how is this possible? Explain your answer!
Solution. Let in the first step $x$ "tails" turn into "heads". Then 20-x "heads" will turn into "tails". After this step, the number of "tails" and "heads" is:

$$
\begin{aligned}
& \text { "tails": }(8-x)+(20-x)=28-2 x, \\
& \text { "heads": } x+(35-(20-x))=2 x+15
\end{aligned}
$$

In this way, after the first step, we will have an even number of "tails" and an odd number of "heads". If in the second step, y "tails" are turned into "heads", then the number of "tails" and "heads" after this step will be

$$
\begin{aligned}
& \text { "tails": } 28-2 x-y+(20-y)=48-2 x-2 y \\
& \text { "heads": } y+2 x+15-(20-y)=2 x+2 y-5
\end{aligned}
$$

which means that the parity of the number of "tails" and the number of "heads" does not change. Clearly, to achieve the desired goal in one step, we need to turn 20 "tails". This is not possible in the first step, but if in the first step we turn 4 "tails" and 16 "heads", we will get $28-2 \cdot 4=20$ "tails" and $2 \cdot 4+15=23$ "heads". Now, in the second step, all 20 "tails" will be turned into "heads", which means that all coins can be turned into "heads" after 2 steps.

## 2nd year