Multiple choice

In a permutation a1 ... an, of n distinct integers, an inversion is a pair (ai, aj) such that i < j and ai > aj.

If all permutations are equally likely, what is the expected number of inversions in a randomly chosen permutation of 1. . . n?

  1. $\frac{n(n-1)}{2}$
  2. $\frac{n(n-1)}{4}$
  3. $\frac{n(n+1)}{4}$
  4. $2n[\log_2n]$
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Let $a_1....a_n$ be 1.....3 here n =3 consider all permutation 123, 132, 231,213, 312, 321. Let us consider 312 here the inversions are {(3,1), (3,2)} So in a randomly chosen permutation we need to select two no. following inversion property on an average $no.\ of\ inverstions\ \dfrac{1}{2}\ nC_2$ $$ = \dfrac{1}{2} \dfrac{n!}{2!(n-2)!} \Rightarrow \dfrac{1}{2}\dfrac{n(n-1)}{2}$$ $$ = \dfrac{n(n-1)}{4}$$

if $n=3 \Rightarrow \dfrac{3(3-1)}{4} = [1.5] \cong 2$

Solving this question taking a random example would be much easier