Question 103
Let $\pi=\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ be a permutation of the numbers $1,2, \ldots, n$. The entanglement of $\pi$ is the number of pairs of $(i, j)$ natural numbers with $1 \leq i\lt j \leq n$ and $a_{j}\gt a_{i}$. Prove that for every integer $k$ with $0 \leq k \leq\binom{ n}{2}$ there is a permutation of the numbers $1,2, \ldots, n$ with entanglement $k$.