Combinatorica`
Combinatorica`

Inversions

Inversions[p]

counts the number of inversions in permutation p.

Details