Skip to content

MinorIndex ​

The minor index of pp: the sum of the ascent positions ∑pi<pi+1i\sum_{p_i < p_{i+1}} i.

MinorIndex(p)the minor index of a one-line permutation pp
Typed signatures
TypePackageApplies
(list | permutation) -> integercombinatoricsalways

Domain: Permutation statistics

Details
  • Complementary to MajorIndex: every position is a descent or an ascent, so MajorIndex(p)+MinorIndex(p)=(n2)\mathrm{MajorIndex}(p) + \mathrm{MinorIndex}(p) = \binom{n}{2}
  • Defined over Permutation as an expression in _x, evaluated by compute-engine — the definition IS the implementation.
  • Takes a Permutation, and also a bare list of integers: this reading compares entries with each other rather than with their positions, so it stands on any sequence.

Definition

Epsil, as the implementation runs it.

on Permutation, over _x

0 if Length(_x) < 2 else Sum(Filter(
                                     Range(1, Length(_x) - 1),
                                     Function(_x[i] < _x[i + 1], i),
                                   ))

Examples

Basic #

the lone ascent, at position 2

live ↗
InMinorIndex([3,1,2])\mathrm{MinorIndex}(\bigl\lbrack3, 1, 2\bigr\rbrack)Out22

ascents at both positions: 1+21 + 2

live ↗
InMinorIndex([1,2,3])\mathrm{MinorIndex}(\bigl\lbrack1, 2, 3\bigr\rbrack)Out33

no ascents

live ↗
InMinorIndex([3,2,1])\mathrm{MinorIndex}(\bigl\lbrack3, 2, 1\bigr\rbrack)Out00

the one-line word 312312

live ↗
InMinorIndex(Permutation⁡([3,1,2]))\mathrm{MinorIndex}({\operatorname{Permutation}}([3, 1, 2]))Out22

the one-line word 312312, as a plain list

live ↗
InMinorIndex([3,1,2])\mathrm{MinorIndex}(\bigl\lbrack3, 1, 2\bigr\rbrack)Out22

the one-line word 24132413

live ↗
InMinorIndex(Permutation⁡([2,4,1,3]))\mathrm{MinorIndex}({\operatorname{Permutation}}([2, 4, 1, 3]))Out44
Properties #

major and minor index split (n2)\binom{n}{2}

live ↗
InMajorIndex([3,1,2])+MinorIndex([3,1,2])=(32)\mathrm{MajorIndex}(\bigl\lbrack3, 1, 2\bigr\rbrack)+\mathrm{MinorIndex}(\bigl\lbrack3, 1, 2\bigr\rbrack)=\binom{3}{2}OutTrue\mathrm{True}
About
Examples7

See also: MajorIndex, Descents, SymmetricGroup