SortingIndex on Permutation
The total distance the entries move in selection sort.
Selection sort swaps n into place, then n - 1, and so on; the fold carries the total and the word.
Called as CombinatorialStat(x, "SortingIndex"). The head's page has its examples.
Live
Distribution
Over SymmetricGroup at each size, tallied here in your browser; sizes past 8 are not offered.
FindStat St000224
The sorting index of a permutation.
| Object | Value |
|---|---|
[1] | 0 |
[1,2] | 0 |
[2,1] | 1 |
[1,2,3] | 0 |
[1,3,2] | 1 |
[2,1,3] | 1 |
[2,3,1] | 2 |
[3,1,2] | 3 |
Data from FindStat, the combinatorial statistic finder; the page at findstat.org/St000224 has the rest.