#P12122. Expected Number of Inversions After Two Random Swaps

    ID: 14220 Type: Default 1000ms 256MiB

Expected Number of Inversions After Two Random Swaps

Expected Number of Inversions After Two Random Swaps

Consider an array of size (n=51) that initially contains the integers (1, 2, 3, \dots, 51) in increasing order. We perform the following operation twice: choose two distinct positions (i,j) uniformly at random from ([1,51]) and swap the elements at these positions. After two independent random swap operations, let (\sigma) be the resulting permutation. An inversion is defined as a pair ((i,j)) with (1 \le i < j \le 51) such that (\sigma(i) > \sigma(j)).

Your task is to compute the expected (average) number of inversions in the array after these two swaps. (Any detailed derivation using linearity of expectation and case analysis is welcome, but you only need to output the final numerical result rounded to two decimal places.)

Note: All formulas must be typeset in LaTeX. For example, an inversion is any pair ((i,j)) satisfying (\sigma(i) > \sigma(j)).

inputFormat

There is no input for this problem.

outputFormat

Output the expected number of inversions (rounded to two decimal places).

sample

94.47