Skip to content

MajorIndex

The major index of : the sum of the descent positions .

MajorIndex(p)the major index of a one-line permutation

Domain: Permutation statistics

Details
  • Introduced by MacMahon, who proved it equidistributed with Inversions over
  • Both are Mahonian, so their common generating function is the q-factorial

Examples

Implementation

referenceenginenotatio

Checked against the implementation over every permutation of 1..6.

nativeenginetypescriptpackages/collections/src/stats.ts:majorIndex

See also: Inversions, Descents, SymmetricGroup