inversions {Tex4exams} | R Documentation |
inversions() counts the number of inversions of a permutation.
inversions(x)
x |
a permutation of 1, 2, ..., n. |
Input must be a list of numbers.
The total number of inversions in a list.
inversions(c(3,1,2))