Template:Permutations of 8 elements; inversions triangle

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Image set Permutations of 8 elements; inversions triangle

This is the inversion set of a permutation of 0...7. Each of the 28 hexagons represents a pair of places. Each dark gray hexagon represents an inversion, i.e. the elements on these places are out of their natural order. The two brown vectors are the left and right inversion-count. They count the inversions in the diagonals of the triangle. Interpreted as factorial numbers they give the permutation's sorting rank in the rev-colex and lex order of all permutations of 0...7. In the single hexagon on the top is the total number of inversions, which is the sum of both vectors. See Inversion (discrete mathematics).