Skip to content

Inversions

The number of inversions of a permutation : pairs with (its Kendall-tau distance from the identity).

Inversions(p)the inversion count of a one-line permutation

Domain: Permutation statistics

Details
  • Ranges from (the identity) to (the reversal )
  • Generating function over is the q-factorial
  • Equidistributed with MajorIndex on (MacMahon), so both are Mahonian statistics
  • Aggregates over a whole collection compose from built-ins: folds the stat over the lazy family

Examples

See also: MajorIndex, Descents, SymmetricGroup