Probability & Random Variables


Answer & solution
Answer: B (no official key was published)
1. There are choose(n,2)=n(n−1)/2 pairs of distinct positions i<j.
2. For any fixed pair, exchanging their two entries pairs every ordering ai>aj with an equally likely ordering ai<aj. Distinctness excludes equality, so the inversion probability is 1/2.
3. Let Iij be 1 for an inversion and 0 otherwise. Then E[Iij]=1/2 and total inversions I=Σi<j Iij.
4. Linearity gives E[I]=Σ E[Iij]=n(n−1)/4, B. Although different pairs' indicators may be dependent, linearity does not require independence.
Solution: For each of the n(n−1)/2 index pairs i<j, define an indicator for aᵢ>aⱼ. Symmetry gives probability 1/2 for each pair. By linearity of expectation, the expected inversion count is [n(n−1)/2]×1/2=n(n−1)/4, option B. Independence among those indicators is unnecessary.