Skip to content

SortingIndex on Permutation ​

The total distance the entries move in selection sort.

On Permutation

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.

ObjectValue
[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.