Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
List all possible binary compositions for a set of chosen symbols
ResourceFunction["BinaryCompositions"][leafn,sym] returns all possible binary compositions of symbols listed in sym whose proper leaf count (terminal nodes only) equals leafn. |
Axiom-level binary compositions for cases n=1,…,4:
In[1]:= |
Out[1]= |
Double level composition acts like Tuples:
In[2]:= |
Out[2]= |
Binary compositions are composable:
In[3]:= |
Out[3]= |
The recursive count of compositions relates to OEIS A025225, i.e. to the generators of 2-colored planar binary trees:
In[4]:= |
Out[4]= |
The terminal node leaf count is two more than the composition depth:
In[5]:= |
Out[5]= |
This work is licensed under a Creative Commons Attribution 4.0 International License