and  Keith Copenhaver

# k-protected Vertices In Unlabeled Rooted Plane Trees

and  Keith Copenhaver
###### 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) L(x)=12(1+1√1−4x).

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) Rk(x)=xk−2(nk(x)−√1−4x)2dk(x),

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

 (2.3) dk(x)=k−3∑i=0(i+1)xi+2k−3∑i=k−2(2k+2−i)xi.

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) dk+1(x)=dk(x)−xk−2nk(x)+x2k−1.
###### Proof.

We will proceed by induction on .

For the base case, if , then

 d3(x)=1+3x+2x2+x3=2+x−(1−2x−2x2)+x3=d2(x)−x2−2n2(x)+x2(2)−1.

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

 dk+1(x) =(k+1)−3∑i=0(i+1)xi+2(k+1)−3∑i=k−1(2(k+1)+2−i)xi =k−3∑i=0(i+1)xi+2k−3∑i=k−2(2k+2−i)xi−xk−2(1−2k∑i=1xi)+x2k−1 =dk(x)−xk−2nk(x)+x2k−1.

###### Lemma 2.4.

If , then

 (2.5) n2k(x)−(1−4x)=4x3dk(x).
###### 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

 n2k(x)=1−4x+k∑i=3(i−2)4xi+2k∑i=k+1(2k−1−i)4xi
 =1−4x+4x3(k−3∑i=0(i+1)xi+2k−3∑i=k−2(2k+2−i)xi).

###### 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,

 R2(x)=x⋅R1(x)1−R1(x)=2x(1−2x−2x2−√1−4x)4x(2+x)=x0(n2(x)−√1−4x)2d2(x).

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

 Rk+1(x)=x⋅Rk1−Rk
 =xk−1(2dk(x)nk(x)−xk−2n2k(x)−2dk(x)√1−4x+xn−2(1+4x))4d2k(x)−4xk−2dk(x)nk(x)+x2k−4n2k(x)−x2k−4(1−4x)
 =xk−1(2dk(x)nk(x)−xk−2(4x3dk(x))−2dk(x)√1−4x)4d2k(x)−4xk−2dk(x)nk(x)+x2k−4(4x3dk(x))
 =xk−1(2nk(x)−4xk+1−2√1−4x)4dk(x)−4xk−2nk(x)+4x2k−1=xk−1(nk+1(x)−√1−4x)2dk+1(x).

## 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

 |d3(x)|≥1−|3x|−|2x2|−|x3|≥1−45−32225−1923375=1313375.

Observe that, for , . Now we have that

 |dk(x)−1|<∣∣ ∣∣xk−2+∞∑k=1(k+1)xk∣∣ ∣∣
 ≤(415)k−2+∞∑k=1(k+1)(415)k=(415)k−2+165196.

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

 Tk(x=L(x)⋅Rk(x)=(1+√1−4x2√1−4x)⋅(xk−2(nk(x)−√1−4x)2dk(x))
 =xk−2⋅nk(x)−(1−4x)+(nk(x)−1)√1−4x4dk(x)√1−4x
 =x√1−4x⋅xk−3(nk(x)−1+4x)4dk(x)−xk−2(nk(x)+1)4dk(x)

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) [xn]Tk(x)∼(2n−2n−1)(1/4)k−3(nk(1/4)−1+4(1/4))4dk(1/4).

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

 n2k(1/4)−(1−4(1/4))=4(1/4)3dk(1/4),

so that . Thus

 (1/4)k−3(nk(1/4)−1+4(1/4))4dk(1/4)=14k⋅2+4k3⋅4k=34k+2.

###### 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 ,

 [x50]T3(x)[x50]x√1−4x=889724113048643871468649971959816327613912069440802200≈0.0453986

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

 rk(n)∼941−k+4+4k⋅cn−1

where denotes the st Catalan number.

###### Proof.

We have that

 Rk(x)=xk−2(1−√1−4x)2dk(x)−∑ki=1xi+k−2dk(x).

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

 Rk(x)=xk−2dk(x)⋅T(x)−∑ki=1xi+k−2dk(x).

Thus we have

 (1/4)k−2dk(1/4)⋅cn−1=(1/4)k−216n2k(1/4)⋅cn−1=14k(2+4k3⋅4k)2⋅cn−1
 =94−k(4+4k+1+42k)⋅cn−1=941−k+4+4k⋅cn−1.

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

 3(2n−2n−1)(4k+2)−3(2n−2n−1)(4k+1+2)=3(2n−2n−1)⋅(4k+1+2−4k−242k+1+2(4k)+2(4k+1)+4)
 =3(2n−2n−1)⋅4k(4−1)4k(4k+1+2+2(4)+41−k)=9(2n−2n−1)10+41−k+41+k.

## 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) ER(n)∼∞∑k=1941−k+4+4k≈1.62297.
###### Theorem 4.2.

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

 (4.2) ET(n)∼∞∑k=134k+2≈0.727649.
###### 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

 ER(x)=∞∑k=1Rk(x)=∞∑k=1(xk−2(1−√1−4x)2dk(x)−∑k−2i=1xi+k−2dk(x)).

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

 ∞∑k=1Rk(x)=∞∑k=1(xk−2dk(x)⋅T(x)−∑k−2i=1xi+k−2dk(x))
 =∞∑k=1xk−2dk(x)⋅T(x)−∞∑k=1∑k−2i=1xi+k−2dk(x).

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

 [x50]∑49k=1Rk(x)[x50]T(x)=18740970694309987794709991152833133890536511435766≈1.62564

and

 [x50]∑49k=1Tk(x)[x50]V(x)=46305229307744228120754379036369403064745214225682607150≈0.726995.

## 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.
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters