Problem
COM-B1-M06-P024 Reverse Order in \(27\) Moves
#24
★★★★★ Level 5 of 5
Starting from \(12345678\), one move swaps two adjacent symbols. Can \(87654321\) be obtained in exactly \(27\) moves?
An adjacent swap changes inversion parity.
The initial number of inversions is \(0\). Each adjacent swap changes inversion parity. After \(27\) moves, inversion parity would be odd. But in \(87654321\), the number of inversions is \(C(8,2)=28\), which is even. Contradiction; exactly \(27\) moves are impossible.
Challenge with a composite invariant: inversion parity is tied to the number of moves.