Expected number of out-of-order pairs
You shuffle the numbers into a uniformly random order. An inversion is a pair of positions where the earlier position holds the larger number (they are out of sorted order).
What is the expected number of inversions?