I've stumbled upon this paper where they write about random sampling of combinatorial objects. For sampling to be proper one has to know some core numbers (probabilities).
However, I'm not interested in sampling one object of some size out of a set of possible ones, I just want to enumerate (create) all of them.
For example, this answer illustrates a nice construction of binary trees.
I've tried playing with trees and thought up of some nice constraints for which new generating functions could be discovered.
Let's say I want to generate all possible arithmetic expressions with $n$ values using a predefined set of operators.
$$((((((((x_1+x_2)+x_3)+x_4)+x_5)-x_6)+x_7)-x_8)\cdot x_9)$$
Above is one of the expressions I want to generate where $n=9$ and $\{+,-,\cdot\}$ the operator set. If I'm wondering how many of these are there, it's obviously (if I generate all possible operator trees) equal to Catalan(n) - multiplied by number of ways to color tree nodes with different operators (leaves of the tree are fixed values).
If I were to use only $+$ as an operator I'd have no need for brackets and the number of possible trees would be $1$ regardless of the chosen $n$.
Let's say I want to remove unnecessary brackets and count the trees with $n$ numbers and operator set $S = \{+,-,\cdot, /, \text{^}\}$ where commutativity, associativity and precedence applies.
I've managed to discover generating functions for all subsets of operator set $S$ (have no clue how to prove the thing but am confident they are correct).
For the given $S$ the generating function is
$$F(x)=1+xF(x)+4xF(x)^2+x^2{F(x)}^3\;.$$
Is there a way where I could, using this generating function, generate all of these constrained (no unnecessary brackets) trees without having to first generate all trees and then remove the unnecessary brackets?