Inversions in sequences

This page shows the 44 = 256 sequences of length 4 with possible entries from 0...3. These are the integers 0...255 in base 4.

It shows their place-based and element based inversion sets, and all four possible vectors related to them. and are the left and right inversion counts, and  is the inversion vector. The fourth possible vector is unused, but added as for completeness' sake.

While inversion sets and the related vectors uniquely define permutations, this is not true for sequences in general.

The place-based inversion sets are the same as those of permutations. There are 35 sequences with the inversion set of permutation $$\mathit{0}$$, while that of $$\mathit{23}$$ is unique. The inversion sets of the permutations $$\mathit{1}$$, $$\mathit{2}$$, $$\mathit{3}$$, $$\mathit{4}$$, $$\mathit{6}$$, $$\mathit{8}$$, $$\mathit{9}$$, $$\mathit{12}$$, $$\mathit{13}$$, $$\mathit{16}$$ and $$\mathit{18}$$ appear 15 times each, while those of $$\mathit{5}$$, $$\mathit{7}$$, $$\mathit{10}$$, $$\mathit{11}$$, $$\mathit{14}$$, $$\mathit{15}$$, $$\mathit{17}$$, $$\mathit{19}$$, $$\mathit{20}$$, $$\mathit{21}$$ and $$\mathit{22}$$ appear 5 times each.

The element-based inversion sets are multisets, as different pairs of places can have the same pair of elements. There are 103 different multisets, corresponding to 40 different inversion vectors. So there are 40 − 24 = 16 inversion vectors that permutations can not have — e.g. (4, 0, 0, 0 ), (0, 3, 0 , 0 ) and (0, 0, 2 , 0 ).