$4-$

[Examples and counterexamples. Constructions]

One hundred cards were laid out in a row in ascending order: $00,01,02,03, \ldots, 99$. Then the cards were rearranged so that each subsequent card was obtained from the previous one by increasing or decreasing exactly one of the digits by 1 (for example, after 29 can come 19, 39, or 28, but not 30 or 20). What is the maximum number of cards that could remain in their original positions?
Evaluation. After the rearrangement, the sums of the digits of adjacent numbers differ by one. Therefore, either the parity of the sum of the digits of each ticket number matches the parity of its position, or, conversely, these parities are different for all ticket numbers. Before the rearrangement, the parities matched exactly half the time: in every second ten. Thus, the result of the comparison changed for 50 ticket numbers, and they could not have remained in place.

Example, where exactly 50 ticket numbers remain in place (highlighted in bold): we flip the tens with the first odd

![](https://cdn.mathpix.com/cropped/2024_05_06_26f3e6a31f0097f83768g-22.jpg?height=48&width=1397&top_left_y=2034&top_left_x=-1)

## Answer

50 ticket numbers.

Submit a comment