powered by
inversions() counts the number of inversions of a permutation.
inversions(x)
The total number of inversions in a list.
a permutation of 1, 2, ..., n.
Input must be a list of numbers.
inversionv
inversions(c(3,1,2))
Run the code above in your browser using DataLab