Problem

Source: Kyiv City MO 2024 Round 2, Problem 10.4

Tags: combinatorics, permutations



There are $n \geq 1$ notebooks, numbered from $1$ to $n$, stacked in a pile. Zahar repeats the following operation: he randomly chooses a notebook whose number $k$ does not correspond to its location in this stack, counting from top to bottom, and returns it to the $k$th position, counting from the top, without changing the location of the other notebooks. If there is no such notebook, he stops. Is it guaranteed that Zahar will arrange all the notebooks in ascending order of numbers in a finite number of operations? Proposed by Zahar Naumets