3

I need you help to solve this problem:


Consider a planar tree with $n$ non-root vertices.

  1. Give a generating function for vertices distance $d$ from the root.

  2. Proof that the total number is $$\displaystyle \binom{2n}{n-d}\frac{2d+1}{(n+d+1)}$$

We are supposed to have an exponential generating function then use Lagrange Inversion Theorem...


Daniel88
  • 151

1 Answers1

1

What we want here is ordinary generating functions since we are working with unlabeled trees. Start by computing the generating function $T_n(z)$ for ordered planar trees of at most a given height $n$ classified according to the nodes of a distance $d$ from the root (variable $u_d$) and the total number of nodes (variable $z$), where the singleton node has height zero, to get

$$T_0(z) = u_0 z \quad\text{and}\quad T_n(z) = u_0 z + u_0 z \times \left.\frac{T_{n-1}(z)}{1-T_{n-1}(z)} \right|_{u_0=u_1, u_1=u_2,\ldots}.$$

It then follows that the generating function $G_d(z)$ of the number of nodes of a distance $d$ from the root in all ordered planar graphs on $n$ nodes is given by $$G_d(z) = \left.\frac{\partial}{\partial v} T_d(z)(u_0=1, u_1=1, \ldots u_{d-1}=1, u_d = v\times Q(z)/z) \right|_{v=1}.$$

Here $Q(z)$ generates ordered trees on $n$ nodes and has the functional equation $$Q(z) = z + z\frac{Q(z)}{1 - Q(z)} = z \frac{1}{1-Q(z)}.$$ Re-write this as $$Q(z) = z + Q(z)^2.$$

We use $Q(z)/z$ in the substitution because when we attach a tree at a node of depth $d$ we get two overlapping nodes, one of which we remove. Working with this we discover that it encodes too much information. There is a closed form of $T_n(z)$ but many of its properties can only be conjectured, requiring considerable algebra to prove. We see that we can in fact skip $T_d(z)$ and work directly with a corresponding generating function $F_d(z)$ where only leaves of a distance $d$ are marked and we do not need to shift markers from $u_f$ to $u_{f+1}$ in the recursive step. We thus obtain from first principles the recurrence

$$F_0(z) = vz \quad\text{and}\quad F_d(z) = z + z \frac{F_{d-1}(z)}{1-F_{d-1}(z)} = z \frac{1}{1-F_{d-1}(z)}.$$

We now claim that for $d\ge 2$ we have

$$F_d(z) = z\frac{(-1)^d P_{d-1}(z) + vz P_{d-2}(z)} {P_d(z) - (-1)^d vz P_{d-1}(z)}$$

where (these are closely related to Fibonacci polynomials)

$$P_d(z) = \begin{cases} 1 & \quad\text{if}\quad d=0 \\ -1 & \quad\text{if}\quad d=1 \\ (-1)^d P_{d-1}(z) + z P_{d-2}(z) & \quad\text{if}\quad d\ge 2. \end{cases}$$

The proof is by induction. We have by the combinatorial recurrence $F_1(z) = \frac{z}{1-vz}$ and hence $F_2(z) = z\frac{vz-1}{z-1+vz}.$ The formula in terms of the $P_d(z)$ yields

$$F_2(z) = z \frac{P_1(z)+vzP_0(z)}{P_2(z)-vzP_1(z)} = z \frac{-1+vz}{z-1-vz\times -1}$$

and the base case holds. For the induction step we find

$$z \frac{1}{1-F_{d}(z)} = z \frac{1}{1-z\frac{(-1)^d P_{d-1}(z) + vz P_{d-2}(z)} {P_d(z) - (-1)^d vz P_{d-1}(z)}} \\ = z \frac{P_d(z) - (-1)^d vz P_{d-1}(z)} {P_d(z) - (-1)^d vz P_{d-1}(z)-z(-1)^d P_{d-1}(z) - vz^2 P_{d-2}(z)} \\ = z \frac{P_d(z) - (-1)^d vz P_{d-1}(z)} {P_d(z) - vzP_d(z) -z(-1)^d P_{d-1}(z)} \\ = z \frac{(-1)^{d+1} P_d(z) + vz P_{d-1}(z)} {(-1)^{d+1} P_d(z) - (-1)^{d+1} vzP_d(z) + z P_{d-1}(z)} \\ = z \frac{(-1)^{d+1} P_d(z) + vz P_{d-1}(z)} {P_{d+1}(z) - (-1)^{d+1} vzP_d(z)}.$$

This is the formula for $F_{d+1}(z)$ and the induction is complete. We attach $Q(z)/z$ at $v$ as explained earlier to obtain

$$z\frac{(-1)^d P_{d-1}(z) + v Q(z) P_{d-2}(z)} {P_d(z) - (-1)^d v Q(z) P_{d-1}(z)}.$$

Differentiating with respect to $v$ we get for the denominator

$$(P_d(z) - (-1)^d v Q(z) P_{d-1}(z))^2$$

and for the numerator (scalar $z$ will be restored at end)

$$Q(z) P_{d-2}(z) (P_d(z) - (-1)^d v Q(z) P_{d-1}(z)) \\ - ((-1)^d P_{d-1}(z) + v Q(z) P_{d-2}(z)) (-1)^{d+1} Q(z) P_{d-1}(z) \\ = Q(z) P_d(z) P_{d-2}(z) + Q(z) P_{d-1}(z)^2.$$

We claim that

$$P_d(z) P_{d-2}(z) + P_{d-1}(z)^2 = z^{d-1}.$$

For an induction proof we get with $d=2$

$$(z-1) \times 1 + (-1)^2 = z$$

and the base case goes through. For the induction step we start with

$$P_d(z) (P_d(z)/z - (-1)^d P_{d-1}(z)/z) + P_{d-1}(z)^2 = z^{d-1}$$

or

$$P_d(z)^2 - (-1)^d P_{d-1}(z) P_d(z) + z P_{d-1}(z)^2 = z^d$$

which is

$$P_d(z)^2 + P_{d-1}(z) ((-1)^{d+1} P_d(z) + z P_{d-1}(z)) = P_d(z)^2 + P_{d-1}(z) P_{d+1}(z)$$

and the induction goes through. We have shown that

$$G_d(z) = \frac{z^{d} Q(z)}{(P_d(z) - (-1)^d Q(z) P_{d-1}(z))^2}.$$

We prepare for Lagrange Inversion to conclude this computation. We have with $w=Q(z)$ that $z=w(1-w)$ and we now claim that

$$(P_d(w(1-w)) - (-1)^d w P_{d-1}(w(1-w)))^2 = (1-w)^{2d}.$$

Proof is by induction one more time. We have with $d=1$ that

$$(-1 - (-1) \times w \times 1)^2 = (-1+w)^2$$

and the base case holds. For the induction step re-write the second inner term on the LHS as

$$(-1)^{d+1} \frac{1}{1-w} (P_{d+1}(w(1-w)) -(-1)^{d+1} P_{d}(w(1-w)))$$

Add the first inner term to get

$$(-1)^{d+1} \frac{1}{1-w} (P_{d+1}(w(1-w)) -(-1)^{d+1} P_{d}(w(1-w)) \\ + (-1)^{d+1} P_d(w(1-w)) (1-w)) \\ = (-1)^{d+1} \frac{1}{1-w} (P_{d+1}(w(1-w)) + (-1)^{d+1} P_d(w(1-w)) (-w)).$$

Square to get

$$\frac{1}{(1-w)^2} (P_{d+1}(w(1-w)) - (-1)^{d+1} w P_d(w(1-w)))^2.$$

This concludes the induction. For Lagrange Inversion integral we thus obtain

$$[z^m] G_d(z) = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{1}{z^{m+1}} G_d(z) \; dz.$$

We have $dz = (1-2w) \; dw$ and moreover $Q(z) = z + \cdots$ hence we are justified in writing

$$\frac{1}{2\pi i} \int_{|w|=\gamma} \frac{1}{w^{m+1} (1-w)^{m+1}} \frac{w^d (1-w)^d \times w}{(1-w)^{2d}} (1-2w) \; dw \\ = \frac{1}{2\pi i} \int_{|w|=\gamma} \frac{1}{w^{m-d} (1-w)^{m+1+d}} (1-2w) \; dw.$$

This evaluates by inspection to

$${m-d-1+m+d\choose m+d} - 2 {m-d-2+m+d\choose m+d} \\ = {2m-1\choose m+d} - 2 {2m-2\choose m+d}.$$

OP asks for non-root vertices and thus $n=m-1$ and we find

$${2n+1\choose n+1+d} - 2 {2n\choose n+1+d} \\ = \left(\frac{2n+1}{n+1+d} - 2 \frac{n-d}{n+1+d} \right) {2n\choose n+d}.$$

This is indeed

$$\bbox[5px,border:2px solid #00A000]{ \frac{2d+1}{n+1+d} {2n\choose n-d}}$$

as claimed.

The relation to Fibonacci polynomials is readily apparent through the fact that

$$P_d(z) = (-1)^{\lfloor (d+3)/2 \rfloor} \sum_{k=0}^{\lfloor d/2 \rfloor} {d-k\choose k} (-1)^{k+1} z^k$$

The proof is again by induction. We immediately get $P_0(z) = -1 \times - 1 = 1$ and $P_1(z) = 1 \times -1 = -1$ for the base case, which is correct. The induction step is split into a case-by-case analysis modulo four, of which we do one example, namely $d=4q+3.$ We find

$$P_{4q+3}(z) = - P_{4q+2}(z) + z P_{4q+1}(z).$$

This becomes

$$- \sum_{k=0}^{2q+1} {4q+3-k\choose k} (-1)^{k+1} z^k = - \sum_{k=0}^{2q+1} {4q+2-k\choose k} (-1)^{k+1} z^k \\ + z \sum_{k=0}^{2q} {4q+1-k\choose k} (-1)^{k+1} z^k$$

or

$$- \sum_{k=0}^{2q+1} {4q+3-k\choose k} (-1)^{k+1} z^k = - \sum_{k=0}^{2q+1} {4q+2-k\choose k} (-1)^{k+1} z^k \\ + \sum_{k=1}^{2q+1} {4q+2-k\choose k-1} (-1)^{k} z^k.$$

This goes through as claimed since the constant coefficient on $z$ is minus one on both sides and for the coefficients on $[z^k]$ with $1\le k\le 2q+1$ we get (attention to $(-1)^k$)

$$ - {4q+2-k\choose k} - {4q+2-k\choose k-1} = {4q+3-k\choose k} \left( - \frac{4q+3-2k}{4q+3-k} - \frac{k}{4q+3-k} \right) \\ = - {4q+3-k\choose k}.$$

To be rigorous in the induction we have to process $4q+2, 4q+3, 4q$ and $4q+1$ in this order.

Another interesting fact that relates $P_d(z)$ to Fibonacci numbers is that

$$P_d(-1) = (-1)^{\lfloor (d+1)/2 \rfloor} F_{d+1}.$$

Proof is a again by induction with the base case holding by inspection. We then get from the recurrence on the RHS

$$(-1)^d (-1)^{\lfloor d/2 \rfloor} F_{d} - (-1)^{\lfloor (d-1)/2 \rfloor} F_{d-1}.$$

With $d=2f$ the coefficients on the two terms are $(-1)^f = (-1) \times (-1)^{f-1} = (-1)^{\lfloor (2f+1)/2\rfloor}$ and when $d=2f+1$ they are $(-1)\times (-1)^f = (-1) \times (-1)^f = (-1)^{\lfloor (2f+2)/2\rfloor}$ and the claim is proven.

Marko Riedel
  • 61,317