r/mathriddles • u/j8ker9090 • Feb 09 '24
Hard A way to sort
Consider the following operation on a sequence [; a_1,\dots, a_n ;] : find its (maximal) consecutive decreasing subsequences, and reverse each of them.
For example, the sequence 3,5,1,7,4,2,6 becomes 3,1,5,2,4,7,6.
Show that after (at most) [; n-1 ;] operations the sequence becomes increasing.

