# -protected Vertices In Unlabeled Rooted Plane Trees

###### Abstract.

We find a simple, closed formula for the proportion of vertices which are k-protected in all unlabeled rooted plane trees on vertices. We also find that, as goes to infinity, the average rank of a random vertex in a tree of size approaches 0.727649, and the average rank of the root of a tree of size approaches 1.62297.

Mathematics Subject Classification 05A15 05A16 05C05

###### Key words and phrases:

tree, enumeration, asymptotics###### 2010 Mathematics Subject Classification:

Primary: 05A15, 05C05; Secondary: 05A16## 1. Introduction

Unlabeled rooted plane trees are one of the simplest tree structures. They are used to model any network with a point of origin. We will ask the question, if you start at a leaf and take only upward steps, how far might we expect to go to reach a vertex?

The modern world is full of different kinds of networks. In every network it could be advantageous or disadvantageous to have highly protected vertices. For example, in many online communities, people must be invited in order to participate. If we were to create a tree of users where each person is connected to the person who invited them, then each time a user adds a member they once again become 1-protected. Thus a high level of protection most likely indicates that someone is not regularly bringing in new members.

In a network that must remain secure, it is desirable to make it difficult to reach the root, so we would like for the root to be highly protected (another question we will address directly), but we also would like nodes in general to have a high level of protection. For example, in a computer network with different levels of access, even if the network is very tall (in other words, the lowest entry point is many steps from the root), if it has a leaf at a high level, the root will still be far more accessible than the height of the network would imply.

We will call a vertex k-protected if we must take at least downward steps to reach any leaf. In Figure 1, each vertex is labeled by the highest for which it is -protected (any vertex that is 4-protected is also 3-protected), this is also known as the rank. The number of -protected vertices was explored for this class of tree with by Cheon and Shapiro [4]. The topic of protected vertices has been examined for random recursive trees by Mahmoud and Ward [7], -ary trees by Mansour [8], binary search trees by Bóna [2], random phylogenetic trees by Bóna and Flajolet [3], several types of random trees by Devroye and Janson [5], and digital search trees by Du and Prodinger [6].

Throughout this paper any reference to a tree will specifically mean an unlabeled rooted plane tree.

We will also freely use a few facts. The number of such trees on vertices, is the st Catalan number, and the ordinary generating function of the number of such trees on vertices is . The number of all vertices of trees of size , , is the st central binomial coefficient, and they have the ordinary generating function .

## 2. Grafting

Grafting is a process in horticulture where a branch from one tree is removed and a branch from a different tree is inserted in its place. We will do something very similar with the following lemma.

###### Lemma 2.1.

Let be the ordinary generating function for , the number of rooted plane trees on vertices whose root is -protected. Let be the ordinary generating function for , the number of leaves in all rooted plane trees of size (or, equivalently, all rooted plane trees with edges). Let be the ordinary generating function for , the number of -protected vertices in all trees of size . Then .

###### Proof.

Let We can count the number of -protected vertices on a tree with vertices by choosing a tree on vertices, removing a specific leaf, then replacing that leaf with a tree whose root is -protected. We can choose that leaf in one of ways and the tree in ways, so the result follows by the product formula. ∎

To apply this, of course, we need . Let where is the number of trees on vertices with leaves. We have that satisfies the functional equation , and solving for , we have . The function we want, , will be equal to . Thus

(2.1) |

To find expressions for , we first observe that since a tree with a 1-protected root is simply a non-empty sequence of trees, we have where giving Further, this can be iterated since a root is -protected if and only if it is a non-empty sequence of trees whose roots are -protected. Thus we have the recursion .

###### Theorem 2.2.

For all ,

(2.2) |

where and are polynomials defined as follows: for all , , and for all

(2.3) |

For some numerical justification, this gives the series expansions and , each of which are accurate up to trees of size 6 by examination. To prove this theorem we will need some purely computational lemmas.

###### Lemma 2.3.

For all ,

(2.4) |

###### Proof.

We will proceed by induction on .

For the base case, if , then

For the induction step, we assume that the statement holds for , so from (2.2),

∎

###### Lemma 2.4.

If , then

(2.5) |

###### Proof.

The expansion of splits nicely into 3 parts as follows:

The first two terms will be for all .

For all we will have a two copies of and copies of giving a net total of . This means there will be no term.

For all we will have no negative terms, and for each term we will have copies of giving us

∎

###### of Theorem 1.

We once again proceed by induction on .

For the base case, if , then, after clearing denominators and multiplying by the conjugate of the denominator,

Now, assuming that the statement holds for , and after clearing denominators and multiplying by the conjugate of the denominator,

∎

## 3. Asymptotics

We will say that if .

###### Theorem 3.1 (Bender’s Lemma [1]).

Suppose that and are power series with radii of convergence , respectively. Suppose approaches a limit as approaches infinity. If , then , where .

###### Lemma 3.2.

For all , is never zero on the closed disk of radius .

###### Proof.

Let . Then , , and

Observe that, for , . Now we have that

If , then , so that . Hence for all ∎

###### Theorem 3.3.

Let be the number of vertices which are -protected in all rooted plane trees of size of . Then .

###### Proof.

Note that is the generating function for the number of all vertices of all trees of size . We have that

Since is non-zero on the closed disk of radius 4/15, it follows that the term on the right is asymptotically irrelevant and that has a radius of convergence larger than 1/4 for all . Thus we can apply Bender’s Lemma to the term on the left for any , giving

(3.1) |

Since we have the recurrence and , we have . Applying Lemma 3 we have

so that . Thus

∎

###### Corollary 3.4.

Let be the probability that a random vertex in a random rooted plane tree of size is -protected. Then .

###### Proof.

To find the average, we divide by . ∎

This gives the sequence of values 1, 1/2, 1/6, 1/22, 1/86,…, and also shows that as we progress to a higher level of protection, we lose about 1/4 of the vertices each time. The result for agrees with the result by Cheon and Shapiro [4].

For numerical justification, we have, if ,

and .

There are some other interesting questions which can be answered using . The height of a tree is defined as the longest path from the root to a leaf. The function enumerates instead by the shortest path from the root to a leaf.

###### Theorem 3.5.

Let be the number of trees on vertices whose root is -protected. Then

where denotes the st Catalan number.

###### Proof.

We have that

The term on the right is once again asymptotically irrelevant, so we have

Thus we have

∎

This gives the sequenced of values 1, 1, 4/9, 16/121, 64/1849, …, and once again shows that we lose about 1/4 of the trees each time we progress to a higher level of protection.

Recall that the rank of a vertex is the distance of the shortest downward path from a vertex to a leaf.

###### Corollary 3.6.

The number of vertices of rank in trees of size approaches the value .

###### Proof.

It follows immediately from the definition that a vertex has rank if and only if it is -protected but not -protected, so by Theorem 3, the number of vertices of rank approaches

∎

## 4. Expectations

###### Theorem 4.1.

Let denote the expected value of the rank of the root of a tree of size n. Then

(4.1) |

###### Theorem 4.2.

Let denote the expected value of the rank of a random vertex in a tree of size n. Then

(4.2) |

###### Proof of Theorems 5.

Let where is the sum of the ranks of the roots of all trees of size . Clearly , since the trees with roots of rank one is counted once by , the trees with roots of rank two are counted once by and once by , and similarly the trees with roots of rank are counted once by each for . Since has no terms of degree lower than , their sum converges as a formal power series. It follows that

The sums and both converge absolutely on the closed disk of radius 1/4, so we can split the sum as follows:

Since the coefficient of and the double sum on the right both converge absolutely to bounded, analytic functions on the closed disk of radius 5/14, it follows that the term on the right remains asymptotically irrelevant, and that we may apply Bender’s Lemma to the term on the left, and the result follows.

∎

###### Proof of Theorem 6.

The proof is similar to that of Theorem 5 with the role of replaced by . ∎

For numerical justification, we may compute the th coefficient using only the st partial sum, since there are no vertices or roots which are -protected in a tree of size . We have that

and

## References

- [1] Edward Bender, Asymptotic methods in enumeration, SIAM Rev 16 (1974), 485 – 515.
- [2] Miklós Bóna, k-protected vertices in binary search trees, Adv Appl Math 53 (2014), 1–11.
- [3] Miklós Bóna and Philippe Flajolet, Isomorphism and symmetries in random phylogenetic trees, J Appl Probab 46 (2009), 1005–1019.
- [4] Gi-Sang Cheon and Louis W. Shapiro, Protected points in ordered trees, Appl Math Lett.
- [5] Luc Devroye and Svante Janson, Protected nodes and fringe subtrees in some random trees, Electron Commun Prob 19 (2014), 1–10.
- [6] Rosena R.X. Du and Helmut Prodinger, On protected nodes in digital search trees, Appl Math Lett 25 (2012), 1025–1028.
- [7] Hosam M. Mahmoud and Mark D. Ward, Asymptotic properties of protected nodes in random recursive trees, J Appl Probab 52 (2015), 290–297.
- [8] Toufik Mansour, Protected points in k-ary trees, Appl Math Lett 24 (2011), 478–480.