Problem

Source: SMO Open 2022

Tags: combinatorics, permutations, minimum, colorings



Let $n,k$, $1\le k\le n$ be fixed integers. Alice has $n$ cards in a row, where the card has position $i$ has the label $i+k$ (or $i+k-n$ if $i+k>n$). Alice starts by colouring each card either red or blue. Afterwards, she is allowed to make several moves, where each move consists of choosing two cards of different colours and swapping them. Find the minimum number of moves she has to make (given that she chooses the colouring optimally) to put the cards in order (i.e. card $i$ is at position $i$). NOTE: edited from original phrasing, which was ambiguous.