In a permutation , of n distinct integers, an inversion is a pair such that and .
If all permutations are equally likely, what is the expected number of inversions in a randomly chosen permutation of ?
View worked solution
Answer: B
To find the expected number of inversions in a randomly chosen permutation of distinct integers, we can use the linearity of expectation.
Let the permutation be . An inversion is a pair such that and .
For any pair of indices with , let be an indicator random variable defined as:
Since all permutations are equally likely, by symmetry, the probability that is exactly (as it is equally likely that or ).
Therefore, the expected value of each indicator variable is:
The total number of such pairs with is given by the combination :
Let be the total number of inversions, so . By the linearity of expectation:
Thus, the expected number of inversions is .
Free practice · Your answers on this page are not saved.
