### Basic Examples

Basic Examples

This permutation has 3 numbers greater than 1 before 1, 2 numbers greater than 2 before 2, and so on:

{4,3,2,1};

Therefore this is its inversion vector:

{3,2,1,0};

Here is a check:

[{3,2,1,0}]

In[]:=

True

Out[]=

The positive integer 23 gives {3,2,1,0} in the factorial base, so {3,2,1,0} is an inversion vector:

IntegerDigits[23,MixedRadix[{4,3,2,1}]]

In[]:=

{3,2,1,0}

Out[]=

Every inversion vector must end in 0, because the largest entry in a permutation list has nothing but smaller entries before it:

[{0,1,2,3}]

In[]:=

False

Out[]=