Skip to content

Records ​

The number of records (left-to-right maxima) of pp: positions ii with pi>pjp_i > p_j for all j<ij < i.

Records(p)the record count of a one-line permutation pp
Typed signatures
TypePackageApplies
(list | permutation) -> integercombinatoricsalways

Domain: Permutation statistics

Details
  • The first position is always a record vacuously, so Records(p)≥1\mathrm{Records}(p) \geq 1 for n≥1n \geq 1
  • Equidistributed with CycleCount over SnS_n (Foata's bijection), so both follow the unsigned Stirling numbers of the first kind [nk]\left[{n\atop k}\right]

Examples

Basic #

33 alone; nothing after tops it

live ↗
InRecords([3,1,2])\mathrm{Records}(\bigl\lbrack3, 1, 2\bigr\rbrack)Out11

the identity sets a new record everywhere

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

22, then 33

live ↗
InRecords([2,3,1])\mathrm{Records}(\bigl\lbrack2, 3, 1\bigr\rbrack)Out22
Properties #

the reversal attains the minimum, 11

live ↗
InRecords([4,3,2,1])\mathrm{Records}(\bigl\lbrack4, 3, 2, 1\bigr\rbrack)Out11
About
Examples4

See also: CycleCount, StirlingS1, SymmetricGroup