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)FindStat
St000724via 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
| Type | Package | Applies |
|---|---|---|
(permutation) -> number | combinatorics | always |
Details
- Defined over
Permutationas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
Permutationand 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
Properties #
About
| Examples | 5 |
|---|---|
| Crosswalk | FindStat |