Skip to content

MaximalLeftBranches ​

The number of maximal paths of left edges.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000919via BinaryTree✓
MaximalLeftBranches(tree)The number of maximal paths of left edges.
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.
  • A branch starts at a node with a left child that is not itself a left child.

Definition

Epsil, as the implementation runs it.

on BinaryTree, over _x

Apply(
       Function(0 if t in Integers else (0 if t[1] in Integers else 1 if fromLeft ==
                                                                         0 else 0) +
                                        self(self, t[1], 1) + self(
                                                                    self,
                                                                    t[2],
                                                                    0,
                                                                  ), self, t, fromLeft),
       Function(0 if t in Integers else (0 if t[1] in Integers else 1 if fromLeft ==
                                                                         0 else 0) +
                                        self(self, t[1], 1) + self(
                                                                    self,
                                                                    t[2],
                                                                    0,
                                                                  ), self, t, fromLeft),
       _x,
       0,
     )

Examples

Basic #

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

live ↗
InMaximalLeftBranches(BinaryTree⁡([[0,0],[[0,0],0]]))\mathrm{MaximalLeftBranches}({\operatorname{BinaryTree}}(\bigl\lbrack\bigl\lbrack0, 0\bigr\rbrack, \bigl\lbrack\bigl\lbrack0, 0\bigr\rbrack, 0\bigr\rbrack\bigr\rbrack))Out22
Properties #

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

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

Known value · FindStat St000919

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

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

Known value · FindStat St000919

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

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

Known value · FindStat St000919

About
Examples4
CrosswalkFindStat