DistinctSubtrees
BinaryTree: The number of different nonempty subtrees. OrderedTree: The number of different subtrees.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St001554via BinaryTree✓St000521via OrderedTree✓DistinctSubtrees(tree)BinaryTree: The number of different nonempty subtrees. OrderedTree: The number of different subtrees.Typed signatures
| Type | Package | Applies |
|---|---|---|
(binary_tree | ordered_tree) -> number | combinatorics | always |
Details
- Defined over
BinaryTreeas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
BinaryTreeand 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. - 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 BinaryTree, over _x
Length(Unique(Apply(
Function([] if t in Integers else Join(
[t],
self(self, t[1]),
self(self, t[2]),
), self, t),
Function([] if t in Integers else Join(
[t],
self(self, t[1]),
self(self, t[2]),
), self, t),
_x,
)))on OrderedTree, over _x
Length(Unique(Apply(
Function([t] if Length(t) == 0 else Join(
[t],
Fold(
Function(
Join(a, b),
a,
b,
),
[],
Map(Function(
self(self, c),
c,
), t),
),
), self, t),
Function([t] if Length(t) == 0 else Join(
[t],
Fold(
Function(
Join(a, b),
a,
b,
),
[],
Map(Function(
self(self, c),
c,
), t),
),
), self, t),
_x,
)))Examples
Properties #
About
| Examples | 8 |
|---|---|
| Crosswalk | FindStat ×2 |