Skip to content

ToLehmerCode from Permutation ​

Entry i counts the later entries smaller than p(i).

Permutation → PermutationInversion

Its total is the inversion count, which is the Lehmer code's whole point.

Called as CombinatorialMap(x, "ToLehmerCode"). The head's page has its examples.

Live

Explore

Each element of Permutation at a size, and its image, applied in your browser; sizes past 7 are not offered.

Properties

Transport a statistic

Pick a statistic on PermutationInversion. Its distribution over the images of Permutation at each size is computed, and compared with the 323 statistics on Permutation: those that share it are the ones the map sends it to, as far as the sizes computed show.

No statistic is declared on PermutationInversion.