They are asking the average number of inversion. basically what $i$ learned about averages from dbms indexing is.
Aaverage apart from the standard definition can be calculated as $( best \ case + worst \ case )/2 $
and inversion is like $ 9,5$.
So, best case will be sorted array $- 1,2,3,4,5$ no inversion .$ = zero$
$worst \ case = 9,5,4,3,2,1$ . here total number of inversion will be $n(n-1)/2$ as . $9$ can be paired with any $5$ elements $(5,4,3,2,1)$ will form a inversion pair. similarly $5$ with $4$.elements .
So, we can say if we have $n$ elements then. it will be $(n-1)+(n-2)+(n-3)...+2+1$ which is the sum of first $n-1$ natural numbers. So, it is $n(n-1)/2$
So, expected average number of inversion $= (n(n-1)/2 + zero (best \ case)) /2= n(n-1)/4$
So, option is B.
Second question.
we all know that insertion sort has complexity due to swapping and movements, if we have $n$ $n$ inversion pair then the movements and comparison will be restricted to $n$ only . like if inversion is $1$ , then array must be sorted and only the inversion should exist at the end, like $1,2,3,5,4$. otherwise more than one inversion pair will form. so to sort this. for two it will be $1,2,3,7,5,4$. so to sort this type of array using insertion sort atmost $N$ swaps wiill be required, so D,