OneProtectedNodeCount
The number of vertices whose nearest leaf is exactly one edge away.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St000522via OrderedTree✓OneProtectedNodeCount(tree)The number of vertices whose nearest leaf is exactly one edge away.Typed signatures
| Type | Package | Applies |
|---|---|---|
(ordered_tree) -> number | combinatorics | always |
Details
- Defined over
OrderedTreeas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
OrderedTreeand 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.
Definition
Epsil, as the implementation runs it.
on OrderedTree, over _x
Apply(
Function([0, 0] if Length(t) == 0 else Apply(
(r: collection) => [r[1] +
(1 if 1 +
r[2] ==
1 else 0), 1 +
r[2]],
Fold(
Function([
a[1] +
b[1],
Min(
a[2],
b[2],
),
], a, b),
[0, PositiveInfinity],
Map(Function(
self(self, c),
c,
), t),
),
), self, t),
Function([0, 0] if Length(t) == 0 else Apply(
(r: collection) => [r[1] +
(1 if 1 +
r[2] ==
1 else 0), 1 +
r[2]],
Fold(
Function([
a[1] +
b[1],
Min(
a[2],
b[2],
),
], a, b),
[0, PositiveInfinity],
Map(Function(
self(self, c),
c,
), t),
),
), self, t),
_x,
)[1]Examples
Properties #
About
| Examples | 4 |
|---|---|
| Crosswalk | FindStat |