Maths Olympiad Prep

Library / /15 of 24

Combinatorics Difficulty 5.6 AIME, harder Prove it United States

Problem:

Sir Alex is coaching a soccer team of nn players of distinct heights. He wants to line them up so that for each player PP, the total number of players that are either to the left of PP and taller than PP or to the right of PP and shorter than PP is even. In terms of nn, how many possible orders are there?

Solution

Solution:

We want to determine the number of permutations π\pi of 1,,n1, \ldots, n such that every number is involved in an even number of inversions. The key observation is that the number of inversions kk is involved in has the same parity as π(k)k\pi(k)-k. This is since π(k)k\pi(k)-k can be interpreted as the number of ii with π(i)<π(k)\pi(i)<\pi(k) minus the number of ii with i<ki<k, meaning that ii is counted with a weight of ±11(mod2)\pm 1 \equiv 1 \pmod{2} if and only if ii is in an inversion with kk.

From this, it follows that such permutations are the ones that permute the even and odd numbers, so the answer is n2!n2!\left\lfloor\frac{n}{2}\right\rfloor!\left\lceil\frac{n}{2}\right\rceil!.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.