## Task 5 - 211235

37 cards, each of which is colored red on one side and blue on the other, are laid on a table so that exactly 9 of them show their blue side on top.

Now, in work steps, cards are to be flipped, and in each individual work step, exactly 20 of the 37 cards are to be flipped.

Investigate whether it is possible to achieve with a finite number of work steps that all 37 cards

a) show their red side on top,

b) show their blue side on top.

If this is possible, determine the smallest number of work steps required for each case!
a) We identify a card with its red side up as 1 and a card with its blue side up as -1. Then, in the initial situation, the sum of all cards is $s=9 \cdot(-1)+(37-9) \cdot 1=19$. If all cards showed their red side, the sum would be $r=37 \cdot 1=37$.

Flipping a card changes the sum of the cards by $\pm 2$: Either a red card (+1) becomes a blue one (-1), reducing the value by 2, or vice versa, increasing the value by 2. Flipping two cards simultaneously thus changes the sum of the cards by $\pm 4$ or 0, in any case by a number divisible by 4. This also holds for repeatedly flipping an even number of cards, such as repeatedly flipping 20 cards.

However, since $r-s=37-19=18$ is not divisible by 4, it is impossible to achieve a situation where all cards show their red side from the initial situation.

b) The cards with the blue side visible at the beginning are cards numbered 1 to 9, while cards numbered 10 to 37 show their red side. We now provide a sequence of two operations such that at the end all cards show their blue side:

1) Flip all cards numbered 4 to 23. Then, exactly the cards numbered 4 to 9 and 24 to 37 show red, and all others show blue.
2) Flip all cards numbered 4 to 9 and all cards numbered 24 to 37. Then, all cards show their blue side.

Thus, there is a sequence of two operations that transforms the initial situation into the target situation with all cards showing their blue side. It remains to show that this cannot be achieved with fewer operations. Since one operation cannot flip all 28 red cards of the initial situation, this is the case.