Inverse Permutation

Author

Eric W. Weisstein
December 16, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Combinatorics/InversePermutation.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/InversePermutation.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Combinatorica`

Example

i=InversePermutation[p={3,8,5,10,9,4,6,1,7,2}]

Equal[i[[p]],p[[i]],Range[10]]

Inversions

CanonicalPermutation[p_]:=p /. Thread[Sort[p]->Range[Length[p]]]

p=CanonicalPermutation[{6,5,7,3,8}]

Inversions[p]

ToInversionVector[p]