Skip to content

SmallerChildPathLeafLabel ​

The label of the leaf reached from the root of the increasing binary tree of p by always following the child with the smaller label.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000724via Permutation✓
SmallerChildPathLeafLabel(p)The label of the leaf reached from the root of the increasing binary tree of p by always following the child with the smaller label.
Typed signatures
TypePackageApplies
(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 nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer.
  • The root of a window is its minimum, and the smaller child is the root of the side holding the second smallest entry (St000724).

Definition

Epsil, as the implementation runs it.

on Permutation, over _x

0 if Length(_x) < 1 else _x[Fold(
                                  Function(a if a[1] >= a[2] else Apply(
                                                                         (smallest: integer) => Apply(
                                                                                                       (low: integer) => Apply(
                                                                                                                                (runnerUp: integer) => [a[1], low - 1] if Max(Sum(Map(Function(j if _x[j] == runnerUp else 0, j), Range(a[1], a[2], 1))), 0) <
                                                                                                                                                                          low else [low + 1, a[2]],
                                                                                                                                Min(Map(
                                                                                                                                         Function(Length(_x) + 1 if _x[j] == smallest else _x[j], j),
                                                                                                                                         Range(a[1], a[2], 1),
                                                                                                                                       )),
                                                                                                                              ),
                                                                                                       Max(Sum(Map(
                                                                                                                    Function(j if _x[j] == smallest else 0, j),
                                                                                                                    Range(a[1], a[2], 1),
                                                                                                                  )), 0),
                                                                                                     ),
                                                                         Min(Map(
                                                                                  Function(_x[j], j),
                                                                                  Range(a[1], a[2], 1),
                                                                                )),
                                                                       ), a, b),
                                  [1, Length(_x)],
                                  Range(1, Length(_x)),
                                )[1]]

Examples

Basic #

the one-line word 312312

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

the one-line word 24132413

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

FindStat's value for [1,2]

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

Known value · FindStat St000724

FindStat's value for [2,1]

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

Known value · FindStat St000724

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

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

Known value · FindStat St000724

About
Examples5
CrosswalkFindStat