[Math] Generating function for the number of unlabeled trees on $n$ vertices

combinatoricsgenerating-functionsgraph theorysequences-and-seriestrees

According to OEIS sequence A000055, if $(T_n)$ denotes the sequence of number of trees with $n$ unlabeled vertices, then it has the generating function $$G(x)=1+A(x)-A^2(x)/2+A(x^2)/2=\sum_{n=0}^{\infty}T_n x^n,$$ where $A(x)=x + x^2 + 2x^3 + 4x^4 + 9x^5 + 20x^6+\cdots$ is the generating function for OEIS sequence A000081.

I tried to derive this generating function by myself, but do not have any clue. Can any body give my a detailed explanation on this formula?
Thank you in advance.

Best Answer

The connection between the generating functions for unlabeled trees and for unlabeled rooted trees is derived in The Number of Trees, Richard Otter, The Annals of Mathematics, $2$nd Ser., Vol. $49$, No. $3$ (Jul., $1948$), pp. $583$-$599$ (in the section titled “Trees” starting on p. $587$).

The proof hinges on the fact that if you form equivalence classes of the vertices and edges of a tree according to whether they are transformed into each other by isomorphisms of the tree, you can choose representatives that form a subtree, with the exception of what Otter calls a “symmetry edge”, an edge which is flipped by an isomorphism of the tree and forms an equivalence class of its own. Since the number of vertices in the subtree is one more than the number of edges, it follows that the number $t_n$ of unlabeled trees is the number $a_n$ of unlabeled rooted trees minus the number $b_n$ of unlabeled “edge-rooted” trees (i.e. unlabeled trees with a distinguished edge, which must not be a symmetry edge). The number of edge-rooted trees can be counted by counting the ways of splitting trees at an edge and rooting the two resulting trees at the vertices of the edge:

$$ b_n=\frac12\left(\sum_{k=0}^na_ka_{n-k}-a_{n/2}\right)\;, $$

where the factor $\frac12$ accounts for double-counting, $a_{n/2}=0$ if $n$ is odd, and the second term subtracts the contribution from symmetry edges. Taking into account the special case $n=0$, where we have the empty tree but no rooted empty tree, we have

$$ t_n=\delta_{n0}+a_n-b_n\;, $$

and translating this to generating functions yields

$$ T(x)=1+A(x)-\frac12\left(A(x)^2-A(x^2)\right)\;. $$