Skip to content

ExternalPathLength ​

The sum of the lengths of the paths from the root to the empty subtrees.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000399via BinaryTree✓
ExternalPathLength(tree)The sum of the lengths of the paths from the root to the empty subtrees.
Typed signatures
TypePackageApplies
(binary_tree) -> numbercombinatoricsalways

Domain: Tree statistics

Details
  • Defined over BinaryTree as an expression in _x, evaluated by compute-engine — the definition IS the implementation.
  • Takes a BinaryTree 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.

Definition

Epsil, as the implementation runs it.

on BinaryTree, over _x

Apply(
       Function(0 if t in Integers else level + self(self, t[1], level + 1) +
                                        self(self, t[2], level + 1), self, t, level),
       Function(0 if t in Integers else level + self(self, t[1], level + 1) +
                                        self(self, t[2], level + 1), self, t, level),
       _x,
       0,
     ) + 2 * (Length(Flatten([_x])) - 1)

Examples

Basic #

the binary tree [[.,.],[[.,.],.]][[.,.],[[.,.],.]]

live ↗
InExternalPathLength(BinaryTree⁡([[0,0],[[0,0],0]]))\mathrm{ExternalPathLength}({\operatorname{BinaryTree}}(\bigl\lbrack\bigl\lbrack0, 0\bigr\rbrack, \bigl\lbrack\bigl\lbrack0, 0\bigr\rbrack, 0\bigr\rbrack\bigr\rbrack))Out1212
Properties #

FindStat's value for [.,.]

live ↗
InCombinatorialStat(BinaryTree⁡([0,0]),ExternalPathLength)\mathrm{CombinatorialStat}({\operatorname{BinaryTree}}(\bigl\lbrack0, 0\bigr\rbrack), \text{ExternalPathLength})Out22

Known value · FindStat St000399

FindStat's value for [.,[.,.]]

live ↗
InCombinatorialStat(BinaryTree⁡([0,[0,0]]),ExternalPathLength)\mathrm{CombinatorialStat}({\operatorname{BinaryTree}}(\bigl\lbrack0, \bigl\lbrack0, 0\bigr\rbrack\bigr\rbrack), \text{ExternalPathLength})Out55

Known value · FindStat St000399

FindStat's value for [[.,.],.]

live ↗
InCombinatorialStat(BinaryTree⁡([[0,0],0]),ExternalPathLength)\mathrm{CombinatorialStat}({\operatorname{BinaryTree}}(\bigl\lbrack\bigl\lbrack0, 0\bigr\rbrack, 0\bigr\rbrack), \text{ExternalPathLength})Out55

Known value · FindStat St000399

About
Examples4
CrosswalkFindStat