Let \(\sigma \in S_4\) be the permutation \(\left(\begin{matrix} 1 & 2 & 3 & 4\\ 2 & 4 & 3 & 1\end{matrix}\right)\).
What is \(\text{{\#}inv}(\sigma)\)?
The answer is 4.
The inversions of \(\sigma\) are the pairs \((1,4)\), \((2,3)\), \((2,4)\), and \((3,4)\).