I am trying to evaluate(Mathematical expression) the number of strict binary trees that can be made with n leaf nodes.
I already know that a strict binary tree with n leaf nodes would have exactly 2*n-1 nodes, so I thought, maybe there is a way to determine the total number of strict binary trees possible with the same number of leaves.
If you already know that the Catalan number $C_n$ is the number of valid parenthesis strings with $n$ pairs of parentheses, you can prove that the number of strict binary trees with $n$ internal nodes is $C_n$ by demonstrating that there is a bijection between the two sets. There is a bijection that is fairly easy to describe, and I’ll sketch the argument for it.
Given a strict binary tree with $n$ leaves, think of each internal node as a pair of parentheses surrounding a product operator; the operands associated with that product operator are the two children of the node, and they go inside the parentheses. The leaves are simply labelled with variable names, e.g., $x_1,x_2$, etc. This procedure associates to each strict binary tree with $n$ internal nodes a fully parenthesized product with $n+1$ factors. I’ve illustrated this below for two strict binary trees with $3$ internal nodes, using the names $a,b,c$, and $d$ for the leaves.
Now remove everything except the parentheses from the associated strings; in this case you get
((()))and(()()). It shouldn’t be too hard to convince yourself of the following observations.Those two observations taken together amount to saying that this construction yields a bijection from the set of strict binary trees with $n$ internal nodes to the set of valid parenthesis strings with $n$ pairs of parentheses.
Alternatively, if you know that the Catalan numbers satisfy the recurrence
$$C_{n+1}=\sum_{k=0}^nC_kC_{n-k}\;,$$
with $C_0=1$, you can prove the result as follows. Let $a_n$ be the number of strict binary trees with $n$ internal nodes. Clearly $a_0=1$. To build a strict binary tree with $n+1$ internal nodes, we can start with the root and its two children. Each of these children must be the root of a strict binary tree. The internal nodes of our tree will be the internal nodes of these subtrees together with the root, so if the left subtree has $k$ internal nodes, then the right subtree must have $n-k$ internal nodes. Thus, there are $a_k$ possible choices for the left subtree and $a_{n-k}$ possible choices for the right subtree. Each choice on the left can be combined with any choice on the right, so there are $a_ka_{n-k}$ strict binary trees with $n+1$ internal nodes, exactly $k$ of which are in the left subtree. Now sum over $k$: $k$ can be anything from $0$ through $n$, so
$$a_{n+1}=\sum_{k=0}^na_ka_{n-k}\;.$$
Thus, the sequence $\langle a_n:n\in\Bbb N\rangle$ satisfies the same recurrence and initial condition as the sequence of Catalan numbers and therefore must be the sequence of Catalan numbers: $a_n=C_n$ for each $n\ge 0$.