MathDB
Swapping Red and Blue Blocks

Source: SMO Junior 2019 Q5

June 29, 2019
combinatorics

Problem Statement

Let nn be a positive integer and consider an arrangement of 2n2n blocks in a straight line, where nn of them are red and the rest blue. A swap refers to choosing two consecutive blocks and then swapping their positions. Let AA be the minimum number of swaps needed to make the first nn blocks all red and BB be the minimum number of swaps needed to make the first nn blocks all blue. Show that A+BA+B is independent of the starting arrangement and determine its value.