Skip to content

NonRootInternalNodes ​

The number of vertices that are neither the root nor a leaf.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000168via OrderedTree✓
NonRootInternalNodes(tree)The number of vertices that are neither the root nor a leaf.
Typed signatures
TypePackageApplies
(ordered_tree) -> numbercombinatoricsalways

Domain: Tree statistics

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

Sum(Map(Function(Apply(
                        Function(0 if Length(s) == 0 else 1 +
                                                          Sum(Map(Function(
                                                                            self(self, c),
                                                                            c,
                                                                          ), s)), self, s),
                        Function(0 if Length(s) == 0 else 1 +
                                                          Sum(Map(Function(
                                                                            self(self, c),
                                                                            c,
                                                                          ), s)), self, s),
                        c,
                      ), c), _x))

Examples

Basic #

the ordered tree [[],[[]],[]][[],[[]],[]]

live ↗
InNonRootInternalNodes(OrderedTree⁡([[],[[]],[]]))\mathrm{NonRootInternalNodes}({\operatorname{OrderedTree}}(\bigl\lbrack\bigl\lbrack\bigr\rbrack, \bigl\lbrack\bigl\lbrack\bigr\rbrack\bigr\rbrack, \bigl\lbrack\bigr\rbrack\bigr\rbrack))Out11
Properties #

FindStat's value for [[]]

live ↗
InCombinatorialStat(OrderedTree⁡([[]]),NonRootInternalNodes)\mathrm{CombinatorialStat}({\operatorname{OrderedTree}}(\bigl\lbrack\bigl\lbrack\bigr\rbrack\bigr\rbrack), \text{NonRootInternalNodes})Out00

Known value · FindStat St000168

FindStat's value for [[[]]]

live ↗
InCombinatorialStat(OrderedTree⁡([[[]]]),NonRootInternalNodes)\mathrm{CombinatorialStat}({\operatorname{OrderedTree}}(\bigl\lbrack\bigl\lbrack\bigl\lbrack\bigr\rbrack\bigr\rbrack\bigr\rbrack), \text{NonRootInternalNodes})Out11

Known value · FindStat St000168

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

live ↗
InCombinatorialStat(OrderedTree⁡([[],[]]),NonRootInternalNodes)\mathrm{CombinatorialStat}({\operatorname{OrderedTree}}(\bigl\lbrack\bigl\lbrack\bigr\rbrack, \bigl\lbrack\bigr\rbrack\bigr\rbrack), \text{NonRootInternalNodes})Out00

Known value · FindStat St000168

About
Examples4
CrosswalkFindStat