Skip to content

FirstAscent ​

The smallest ascent position, or n when p is decreasing.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000990via Permutation✓
FirstAscent(p)The smallest ascent position, or nn when pp is decreasing.
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 St000990.

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 ↗
InFirstAscent(Permutation⁡([3,1,2]))\mathrm{FirstAscent}({\operatorname{Permutation}}([3, 1, 2]))Out22

the one-line word 312312, as a plain list

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

the one-line word 24132413

live ↗
InFirstAscent(Permutation⁡([2,4,1,3]))\mathrm{FirstAscent}({\operatorname{Permutation}}([2, 4, 1, 3]))Out11
Properties #

FindStat's value for [1,2]

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

Known value · FindStat St000990

FindStat's value for [2,1]

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

Known value · FindStat St000990

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

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

Known value · FindStat St000990

About
Examples6
CrosswalkFindStat

See also: FirstDescent, Ascents