Question: 2. Let A be an array of n distinct numbers. If i < j and A[i] > A[j] , then the pair (i, j) is
2. Let A be an array of n distinct numbers. If i < j and A[i] > A[j] , then the pair (i, j) is called an inversion of A. Suppose that the elements of A form a uniform random permutation of 1, 2, ..., n. Compute the expected number of inversions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
