Skip to content

FirstDescent ​

The smallest descent position, or n when p is increasing.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000654via Permutation✓
FirstDescent(p)The smallest descent position, or nn when pp is increasing.
Typed signatures
TypePackageApplies
(list<integer> | permutation) -> numbercombinatoricsalways

Domain: Permutation statistics

Details
  • 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.
  • FindStat St000654: p(n+1) = 0, so position n always descends.

Definition

Epsil, as the implementation runs it.

on Permutation, over _x

Length(_x) if Length(_x) < 2 else Length(_x) if Count(Filter(
                                                              Range(
                                                                     1,
                                                                     Length(_x) -
                                                                     1,
                                                                   ),
                                                              Function(_x[i] >
                                                                       _x[i + 1], i),
                                                            )) == 0 else Min(Filter(
                                                                                    Range(1, Length(_x) - 1),
                                                                                    Function(_x[i] >
                                                                                             _x[i + 1], i),
                                                                                  ))

Examples

Basic #

the one-line word 312312

live ↗
InFirstDescent(Permutation⁡([3,1,2]))\mathrm{FirstDescent}({\operatorname{Permutation}}([3, 1, 2]))Out11

the one-line word 312312, as a plain list

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

the one-line word 24132413

live ↗
InFirstDescent(Permutation⁡([2,4,1,3]))\mathrm{FirstDescent}({\operatorname{Permutation}}([2, 4, 1, 3]))Out22
Properties #

FindStat's value for [1,2]

live ↗
InCombinatorialStat(Permutation⁡([1,2]),FirstDescent)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1, 2]), \text{FirstDescent})Out22

Known value · FindStat St000654

FindStat's value for [2,1]

live ↗
InCombinatorialStat(Permutation⁡([2,1]),FirstDescent)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([2, 1]), \text{FirstDescent})Out11

Known value · FindStat St000654

FindStat's value for [1,2,3]

live ↗
InCombinatorialStat(Permutation⁡([1,2,3]),FirstDescent)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1, 2, 3]), \text{FirstDescent})Out33

Known value · FindStat St000654

About
Examples6
CrosswalkFindStat

See also: FirstAscent, Descents