3
$\begingroup$

By planar, I mean embedded in the plane (I think sometimes the terms, ordered and plane, are used interchangeably with planar). Assume the vertices are labeled 1,2,...,n. By decreasing, I mean the labels on the vertices along a path from the root to any other vertex will decrease. Note that this implies the root is labeled with the integer n.

The journal article I am reading states that there are (2n - 3)*(2n - 1)***(3)*(1) such trees. But the article does not give a derivation.

Can someone explain how to count these trees?

2 Answers 2

2

Let's call these ordered decreasing trees as the term planar is also used for the cyclic group acting at the root. Now we have the following recursive combinatorial construction. To assemble one of these we need a root node, which receives the label $n$ and an ordered sequence of subtrees, each of some size ranging from one to $n-1$ with a total of $n-1$ nodes (composition into one to $n-1$ parts). We then partition the remaining $n-1$ labels into an ordered sequence of sets, one for each subtree, having the matching number of labels. The key observation here is that these subtrees say of some size $q$ correspond bijectively to ordered decreasing trees on $q$ nodes where the elements of the set of labels for these subtrees are placed according to the ordering induced by the source tree, which is ordered and decreasing and has labels from $1$ to $q.$ E.g. if we select the labels $4,7,11$ for one of the subtrees then $4$ will replace $1$, $7$ will replace $2$ and $11$ will replace $3$ in the source tree that is being attached recursively. At this point we win because this is the canonical construction that supports all cartesian products of exponential generating functions.

This yields for $n\ge 2$ (we have $T_1=1$) the recursive relation

$$T_n = \sum_{k=1}^{n-1} \sum_{q_1+q_2+\cdots+q_k = n-1} {n-1\choose q_1, q_2, \ldots, q_k} \prod_{p=1}^k T_{q_p}.$$

These are standard compositions with no zero elements. We introduce the EGF as promised and obtain for

$$T(z) = \sum_{q\ge 1} T_q \frac{z^q}{q!}$$

with $n\ge 2$ the relation

$$n! [z^n] T(z) = (n-1)! [z^{n-1}] \frac{T(z)}{1-T(z)} \quad\text{or}\quad n [z^n] T(z) = [z^{n-1}] \frac{T(z)}{1-T(z)}$$

which yields

$$[z^{n-1}] T'(z) = [z^{n-1}] \frac{T(z)}{1-T(z)}.$$

Multiply by $z^{n-1}$ and sum over $n\ge 2$ to get

$$\sum_{n\ge 2} z^{n-1} [z^{n-1}] T'(z) = \sum_{n\ge 2} z^{n-1} [z^{n-1}] \frac{T(z)}{1-T(z)}.$$

Now $T'(z)$ has a constant coefficient which we miss on the left while $T(z)/(1-T(z))$ does not and we find

$$T'(z) - 1 = \frac{T(z)}{1-T(z)}$$

so that

$$\bbox[5px,border:2px solid #00A000]{ T'(z) = \frac{1}{1-T(z)}.}$$

Solving this by separation of variables we get

$$-\frac{1}{2} (1 - T(z))^2 = z + C_1 \quad\text{or}\quad T(z) = 1 - \sqrt{C_2-2z}.$$

Since $T(z)$ has no constant coefficient we obtain

$$\bbox[5px,border:2px solid #00A000]{ T(z) = 1 - \sqrt{1-2z}.}$$

Extracting coefficients from this we conclude with (again for $n\ge 2$)

$$n! [z^n] T(z) = - n! {1/2\choose n} (-1)^n 2^n = - (1/2)^{\underline n} (-1)^n 2^n \\ = (-1)^{n+1} 2^n \prod_{p=0}^{n-1} (1/2-p) = (-1)^{n+1} \prod_{p=0}^{n-1} (1-2p) = (-1)^{n-1} \prod_{p=1}^{n-1} (1-2p) \\ = \prod_{p=1}^{n-1} (2p-1)$$

which is

$$\bbox[5px,border:2px solid #00A000]{ 1\times 3\times\cdots\times (2n-3)}$$

and we have the claim.

Readings. This set of notes by M. Drmota has the elementary combinatorial argument for this as well as some additional generating functions. We also find OEIS A001147 which offers a considerable number of references. There is additional material on page 531 of Flajolet / Sedgewick (page number refers to PDF).

Here is how I approached these concepts.

with(combinat);

T :=
proc(n)
    option remember;
    local k, comp, res;

    if n=1 then return 1 fi;

    res := 0;
    for k to n-1 do
        for comp in composition(n-1, k) do
            res := res +
            (n-1)!*mul(T(q)/q!, q in comp);
        od;
    od;

    res;
end;
  • 0
    Great answer! Nice ref. (+1)2017-02-24
  • 0
    This is indeed a great answer. It is very well written. I learned a lot. It took me a while to get the recurrence but once I saw the equation T'(z) = 1/(1-T(z)), I instantly realized that these trees are just sequences of such trees attached to a root node. I wrote a Mathematica code that gives the triangular array of such trees with exactly k subtrees. A102625. What I am ultimately trying to understand is A079268.2017-02-25
  • 0
    Thank you. Be careful to get this right -- the equation you quote permits an empty sequence of subtrees and additionally has a derivative on the left. What you want is $T(z)/(1-T(z))$ which is indeed an ordered sequence of trees.2017-02-25
0

T[n_] := T[n] = Total[Map[Apply[Multinomial, #] Product[T[p], {p, #}] &, Level[Map[Permutations[#] &, Partitions[n - 1]], {2}]]]; Table[ T[n], {n, 1, 20}]

1, 1, 3, 15, 105, 945, 10395, 135135, 2027025, 34459425, 654729075, \ 13749310575, 316234143225,...

nn = 6; A[z_] := Sum[T[n] z^n/n!, {n, 1, nn}]; Range[0, nn]! CoefficientList[ Series[1/(1 - u A[z]), {z, 0, nn}], {z, u}] // Grid

{"1", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0"}, {"0", "1", "2", "0", "0", "0", "0"}, {"0", "3", "6", "6", "0", "0", "0"}, {"0", "15", "30", "36", "24", "0", "0"}, {"0", "105", "210", "270", "240", "120", "0"}, {"0", "945", "1890", "2520", "2520", "1800", "720"}