Combinatorica`
Combinatorica`
Inversions
Inversions[p]
counts the number of inversions in permutation p.
Details and Options
- To use Inversions, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
Inversions[p]
counts the number of inversions in permutation p.