Protection Number in Plane Trees
Clemens Heuberger, Helmut Prodinger

TL;DR
This paper investigates the protection number in plane trees, analyzing its distribution for random trees and nodes using generating functions and singularity analysis, providing new insights into their probabilistic properties.
Contribution
It introduces a detailed analysis of the protection number in random plane trees and nodes, applying singularity analysis to derive new probabilistic results.
Findings
Distribution of protection number in random trees
Protection number of a random node in a random tree
Asymptotic behavior of protection numbers
Abstract
The protection number of a plane tree is the minimal distance of the root to a leaf; this definition carries over to an arbitrary node in a plane tree by considering the maximal subtree having this node as a root. We study the the protection number of a uniformly chosen random tree of size and also the protection number of a uniformly chosen node in a uniformly chosen random tree of size . The method is to apply singularity analysis to appropriate generating functions. Additional results are provided as well.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Protection Number in Plane Trees
Clemens Heuberger
Institut für Mathematik, Alpen-Adria-Universität Klagenfurt, Universitätsstraße 65–67, 9020 Klagenfurt, Austria
and
Helmut Prodinger
Department of Mathematical Sciences, Stellenbosch University, 7602 Stellenbosch, South Africa
Abstract.
The protection number of a plane tree is the minimal distance of the root to a leaf; this definition carries over to an arbitrary node in a plane tree by considering the maximal subtree having this node as a root. We study the the protection number of a uniformly chosen random tree of size and also the protection number of a uniformly chosen node in a uniformly chosen random tree of size . The method is to apply singularity analysis to appropriate generating functions. Additional results are provided as well.
Key words and phrases:
Protected node, protection number, singularity analysis, plane tree
1991 Mathematics Subject Classification:
05C05; 05A15, 05A16
C. Heuberger is supported by the Austrian Science Fund (FWF): P 24644-N26. This paper has been written while he was a visitor at Stellenbosch University.
H. Prodinger is supported by an incentive grant of the National Research Foundation of South Africa.
1. Introduction
Cheon and Shapiro [2] started the study of 2-protected nodes in trees. A node enjoys this property if its distance to any leaf is at least 2. After this pioneering paper, a large number of papers has been published [13, 6, 1, 10, 5, 12].
In this paper we study the protection number of the root of a (rooted, plane) tree (in the older literature often called ordered tree): It is the minimal distance of the root to any leaf. Further, the protection number of any node is defined by taking the (maximal) subtree that has this node as the root.
Preliminary results on the subject have appeared in the recent paper [3], but we show that, thanks to a rigorous use of methods outlined in the book Analytic Combinatorics [9], we can go much further. We are able to solve a basic recurrence explicitly, which allows us to use singularity analysis of generating functions and getting, at least in principle, as many terms as one wants in the asymptotic expansions of interest. Further, one can derive explicit expressions for the probabilities in question.
Some curious observations related to the constants that appear are also made; they are linked to identities due to Dedekind, Ramanujan and others and are part of the toolkit of the modern analysis of algorithms.
2. Results
In a rooted plane tree , a vertex is said to be -protected if its minimum distance from a leaf is at least . The tree is said to be -protected if its root is -protected.
We denote the maximal such that a vertex is -protected by and call it the protection number of . The protection number of the root is called the protection number of the tree, . This means that a tree is -protected if and only if .
If a vertex is a leaf, then by definition. Otherwise, if it has children , …, , then
[TABLE]
We are interested in the random variables
- •
, the protection number of a uniformly chosen random tree with vertices,
- •
, the protection number of a uniformly chosen vertex in a uniformly chosen random tree with vertices.
We will prove the following results.
Theorem 1**.**
For , the protection number of a tree with vertices tends to a discrete limit distribution:
[TABLE]
Setting
[TABLE]
its expectation and variance can be written as
[TABLE]
Theorem 2**.**
For , the protection number of a random vertex of a random tree with vertices tends to a discrete limit distribution:
[TABLE]
Setting
[TABLE]
its expectation and variance can be written as
[TABLE]
3. Number of -Protected Trees
In this section, we investigate the auxiliary quantity , the number of -protected trees with vertices.
Let denote the set of all rooted plane trees with protection number . Its generating function is denoted by where labels the number of vertices of a tree, i.e.,
[TABLE]
Lemma 3.1**.**
We have
[TABLE]
and
[TABLE]
for .
Proof.
It is clear that is the generating function of all rooted plane trees which is well-known to be given by (1), cf. for instance [9, § I.5.1].
For , the root of a tree is -protected if and only if all of its children are -protected. Thus a tree is -protected if and only if it consists of a root and a non-empty sequence of branches whose roots are -protected. This translates into the symbolic equation shown in Figure 1 and thus into the equation
[TABLE]
for .
It would now be easy to prove (2) by induction; however, we intend to derive (2).
We rewrite the recurrence (3) in the form
[TABLE]
such that occurs only once.
Using the abbreviation this leads to
[TABLE]
This is reminiscent of continued fractions. We use the Ansatz resulting in the equation
[TABLE]
It is sufficient to require
[TABLE]
for .
This is a linear recurrence whose characteristic equation has roots and , so its solution has the form . As common factors between and do not matter, we may choose which leads to .
Thus
[TABLE]
which results in (2). ∎
Proposition 3.2**.**
The probability that a tree is protected is
[TABLE]
Proof.
We intend to use singularity analysis ([8], [9, Chapter VI]). Let be in some -domain at (see [9, Definition VI.1]) with . We have
[TABLE]
Inserting this into (2), we get
[TABLE]
By singularity analysis, we obtain
[TABLE]
Singularity analysis and division by the number (the st Catalan-number) of rooted plane trees (this corresponds to setting above) yields (4).
∎
Proof of Theorem 1.
We use and Proposition 3.2 to prove the limit theorem.
The expectation follows from the well-known formula
[TABLE]
which is valid for all random variables with non-negative integer values.
Similarly, the variance follows from and
[TABLE]
∎
4. Protection Numbers of all Vertices
We now turn to the protection numbers of arbitrary vertices. We fix some and consider the number of -protected vertices summed over all trees of size . The corresponding generating function is denoted by
[TABLE]
where again labels the number of vertices.
Lemma 4.1**.**
We have
[TABLE]
Proof.
In the language of the symbolic method, the generating function corresponds to the class where denotes pointing to a -protected vertex, cf. [9, Definition I.14].
A tree and a -protected vertex in this tree bijectively correspond to a -protected tree whose root is merged with a leaf of another tree , cf. Figure 2.
Thus corresponds bijectively to where denotes pointing at a leaf and the factor on the left hand side denotes one single vertex which compensates the fact that merging the root of one tree with a leaf of the other tree reduces the number of vertices by .
Thus where denotes the generating function of with respect to the number of vertices. Note that the pointing is with respect to leaves, but is a generating function with respect to all vertices.
Let
[TABLE]
denote the generating function of where marks the number of vertices and marks the number of leaves. Here, denotes the Narayana number counting the number of trees with vertices and leaves.
It is a well-known consequence of the symbolic method that
[TABLE]
cf. [9, Example III.13]. This yields the explicit expression
[TABLE]
Pointing corresponds to applying , cf. [9, Theorem I.4]. Setting then leads to
[TABLE]
This yields (6). ∎
Proposition 4.2**.**
The probability that a random vertex of a random tree with vertices has protection number at least is
[TABLE]
Proof.
[TABLE]
By singularity analysis, we get
[TABLE]
Dividing by the number of all trees and by the number of vertices yields (4.2). ∎
Proof of Theorem 2.
Theorem 2 follows from Proposition 4.2 in the same way as Theorem 1 follows from Proposition 3.2. ∎
5. Explicit formula for the number of -protected trees
Our goal is to read off the coefficient of in formula (2) in explicit form.
Proposition 5.1**.**
The number of -protected trees with vertices is
[TABLE]
Proof.
We use the substitution , which was introduced in [4] and rewrite (2) as
[TABLE]
Extracting coefficients is now done with the Cauchy integral formula:
[TABLE]
Using the binomial theorem yields the assertion. ∎
6. Functional equations for the constants
Two of the constants satisfy attractive and non-trivial functional equations. This phenomenon is not uncommon in the analysis of algorithms; we point out the paper [11] where it was first observed and the survey [14] which contains many references to earlier papers.
The first example is the constant
[TABLE]
with
[TABLE]
Proposition 6.1**.**
We have the functional equation
[TABLE]
Since \frac{\pi^{2}}{\log^{2}2}F\bigl{(}\frac{\pi^{2}}{\log 2}\bigr{)}=0.0000134525077\dots, we have the near-identity .
Proof.
We compute the Mellin transform of it [7], which exists (at least) in the fundamental strip :
[TABLE]
The inversion formula for the Mellin transform gives the original function back (integration is along vertical lines). We shift the line of integration to the left and collect residues:
[TABLE]
for
[TABLE]
In the remainder of this proof, the relation
[TABLE]
will be the only property of that we will use.
We now use the duplication formula for the Gamma function and the functional equation for the Riemann zeta function, a substitution and then again a shift of the line of integration.
[TABLE]
∎
Our second example relates to a sum that appears within the constant :
[TABLE]
with
[TABLE]
Proposition 6.2**.**
We have the functional equation
[TABLE]
Since \frac{\pi^{2}}{\log^{2}2}G\bigl{(}\frac{\pi^{2}}{\log 2}\bigr{)}=0.0000134525165276\dots, we have the near-identity .
Proof.
The Mellin transform of is
[TABLE]
The proof of Proposition 6.1 applies with replaced by which again has the property (7). ∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Miklós Bóna, k 𝑘 k -protected vertices in binary search trees , Adv. in Appl. Math. 53 (2014), 1–11. · doi ↗
- 2[2] Gi-Sang Cheon and Louis W. Shapiro, Protected points in ordered trees , Appl. Math. Lett. 21 (2008), no. 5, 516–520. · doi ↗
- 3[3] Keith Copenhaver, k 𝑘 k -protected vertices in unlabeled rooted plane trees , Graphs Combin. (2017), to appear. · doi ↗
- 4[4] Nicolaas G. de Bruijn, Donald E. Knuth, and Stephen O. Rice, The average height of planted plane trees , Graph theory and computing, Academic Press, New York, 1972, pp. 15–22.
- 5[5] Luc Devroye and Svante Janson, Protected nodes and fringe subtrees in some random trees , Electron. Commun. Probab. 19 (2014), no. 6, 10. · doi ↗
- 6[6] Rosena R. X. Du and Helmut Prodinger, Notes on protected nodes in digital search trees , Appl. Math. Lett. 25 (2012), no. 6, 1025–1028. · doi ↗
- 7[7] Philippe Flajolet, Xavier Gourdon, and Philippe Dumas, Mellin transforms and asymptotics: Harmonic sums , Theoret. Comput. Sci. 144 (1995), 3–58. · doi ↗
- 8[8] Philippe Flajolet and Andrew Odlyzko, Singularity analysis of generating functions , SIAM J. Discrete Math. 3 (1990), 216–240. · doi ↗
