Subtrees of a Given size in Schroeder Trees
Anthony Van Duzer

TL;DR
This paper derives a generating function for counting vertices with subtrees of size k in Schroeder trees and applies the method to Motzkin trees to compute related probabilities.
Contribution
It introduces a technique to calculate subtree size probabilities in Schroeder and Motzkin trees using generating functions.
Findings
Derived the generating function for subtree sizes in Schroeder trees
Calculated probabilities of vertices having subtrees of size k
Extended the method to Motzkin trees
Abstract
In this paper we find the generating function for the number of vertices which have elements in their subtree and use this generating function to calculate the probability that a vertex has a size subtree. We also show how this same technique can be applied to calculate the probabilities for other trees and specifically apply it to Motzkin trees.
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.
Taxonomy
TopicsTopological and Geometric Data Analysis · Graph theory and applications · Advanced Combinatorial Mathematics
Subtrees of a Given size in Schroeder Trees.
Anthony Van Duzer
Department of Mathematics, University of Florida, Gainesville, Florida 32601 Department of Mathematics, University of Florida, Gainesville, Florida 32611 [email protected]
Abstract.
In this paper we find the generating function for the number of vertices which have elements in their subtree and use this generating function to calculate the probability that a vertex has a size subtree. We also show how this same technique can be applied to calculate the probabilities for other trees and specifically apply it to Motzkin trees.
Key words and phrases:
Enumerative Combinatorics, Motzkin trees
1. Introduction
1.1. Schroeder Trees
A Schroeder tree is a rooted plane tree on leaves where each non leaf vertex has at least two children.
1.2. Purpose of paper
In this paper we will find a bivariate generating function for the number of trees where the root has a subtree of size and from that we will obtain the generating function for the number of vertices that are protected. Using that, we will calculate the probability a randomly selected vertex has a size subtree. We will also show how this technique can be applied to calculate the probability that a vertex has some other property in a Schroeder tree and how we can also use it to calculate things about other trees.
1.3. Subtree of size k
We say that a vertex has a subtree of size if the subtree consisting of that vertex and all its descendents has elements.
1.4. Number of Schroeder Trees
The first step in doing any of these calculations will involve finding out exactly how many trees we have and once we know that we will also know exactly how many leaves we have.
Theorem 1.1**.**
The generating function, , for the number of all Schroeder trees with n leaves is given by . In this paper all generating functions will be referring to ordinary generating functions.
Proof.
This comes from the relationship which gives us . This relationship is based on the fact the root can be a leaf or the parent of at least two children. If it is a leaf it contributes and if it is the parent of n children each child would be another Schroeder tree, we do not multiply by since we are counting by leaves and the root would not be a leaf. Solving this equation we get the desired generating function. ∎
Corollary 1.1.1**.**
Let be the number of leaves in all Schroeder trees of size n. Then we have .
Proof.
We can extract the coefficent from the generating function and we get that is asymptotically equal to , and there are precisely leaves on each Schroeder tree, so we simply multiply that number by . ∎
2. Number of Vertices
Before we can make any statements about the probability a randomly selected vertex has some interesting property we need to calculate the number of vertices.
Theorem 2.1**.**
The generating function for the number of vertices in all Schroeder trees with n leaves is given by
[TABLE]
Proof.
We set up a bivariate generating function where counts the leaves and counts the vertices. We call this from there, if we differentiate with respect to and then set we get the univariate generating function for the number of all vertices in trees with leaves. We have the relationship which gives us . Solving for we get
[TABLE]
We then differentiate with respect to and substitute in to get the desired generating function. ∎
Corollary 2.1.1**.**
Let be the number of all vertices in all Schroeder trees with leaves. We have .
Proof.
We can extract the coefficent from the previous generating function giving us these asymptotics. ∎
Using this we can calculate the probability that a randomly selected vertex in a randomly selected Schroeder tree is a leaf.
Corollary 2.1.2**.**
The probability that a randomly selected vertex in a random Schroeder tree is a leaf approaches as the number of leaves goes to infinity.
Proof.
We compare the number of leaves which was calculated in Section 1 to the number of vertices that was calculated in the previous theorem. ∎
This is also the probability that a vertex has subtree size 1 since every leaf has a subtree of size one and the only vertices with a size one subtree are those vertices which are leaves.
3. Size -subtrees
Lemma 3.1**.**
The generating function for the number of vertices which have size subtrees is
[TABLE]
where is the generating function for the number of trees with vertices.
Proof.
This follows from the relationship
[TABLE]
The accounts for all cases where the root has a subtree of size . After accounting for that we can cut off the root and that will break down our tree into a forest of some number of trees . We look at a specific subtree in that forest. The number of vertices with a size subtree in that tree is given by We now multiply that by the total number of configurations which is for each of the remaining trees. This means gives the number of vertices that one of the subtrees contributes and then we multiply that by to get the total number of all of the vertices in the forest. Looking at that we get
. Substituting in what we know we get the desired generating function. ∎
As an aside we could have also used this technique to find the generating function for the number of vertices and the number of leaves. In that case for leaves we would have
[TABLE]
since the only way the root can be a leave is if it is the only vertex and that tree has generating function . Similarly the number of vertices is given by
[TABLE]
since the root is always a vertex.
Now all we need to do is find . We can do this using bivariate generating functions.
Lemma 3.2**.**
Let be the bivariate generating function where is indexed by the number of leaves in the tree and is by the number of total vertices in the tree. With that we have
[TABLE]
Proof.
This is the bivariate generating function we got when trying to find the number of vertices and is calculated in exactly the same way. ∎
Now that we have that generating function is simply the coefficent of in this expression which will be a generating function in .
Lemma 3.3**.**
*(Bender’s Lemma) [4]
Take generating functions and with radius of convergence where goes with and goes with . If approaches a limit b as n approaches infinity and then where =A(x)B(x).*
We can use the probabilities we already have, the generating functions, and Bender’s lemma to calculate the probabilities and doing that we get.
[TABLE]
4. Balanced and -protected
This techinque can also be used to find the probability a vertex has one of several other properties. The only thing we need to find is the generating function for the number of trees where the root has that property. As an example consider the probability a vertex is balanced and rank .
4.1. Rank k
A vertex is of rank if the shortest path from that vertex to a leave travelling strictly through descendents is of length .
4.2. Balanced
A vertex is balanced if the shortest and longest path to a leaf is of the exact same length. Putting these two definitions together a vertex is balanced of rank if all paths travelling from the vertex to a leaf through descendents are of length .
The first thing we need to do is find the generating function for the root being balanced and rank .
Theorem 4.1**.**
Let be the generating functions for where the root is balanced and rank . We have .
Proof.
For any vertex, including the root to be balanced and rank all of its children must be balanced of rank . From this we know we need to construct a tree where the root is balanced and rank we need to construct a sequence of at least 2 trees where the root of each of these trees is balanced of rank . We can do this in ways. ∎
Theorem 4.2**.**
Let be the generating function for all vertices who are balanced and rank . We have .
Proof.
This is similar to the situation for size subtree and the generating function is proved in the exact same way. ∎
We can combine the previous theorems, the fact that , and Bender’s lemma to construct the following table of probabilities.
[TABLE]
5. Further Directions
The technique used in this paper to calculate the probability a vertex has a subtree of size very easily generalizes to other types of trees. The only thing we need to find is the generating function for leaves and the generating function for the number of trees where the root has a subtree of size . This makes it particular well suited to problems where rather than counting the tree by the number of leaves we are counting them by the number of vertices since in that case the generating function for the number of trees where the root has a subtree of size is simply where is the number of trees with vertices. As an example we can look at Motzkin trees.
5.1. Motzkin Trees
So for Motzkin Trees we have the generating function for the number of vertices with subtrees of size in trees with vertices is given by . From this, Bender’s lemma, and previously obtained results regarding Motzkin trees we know that the probability a vertex has a subtree of size is simply . If we sum this over all we get 1 which shows us that this is a tight statistic for Motzkin trees.
6. Open questions
We know that for the Motzkin trees size subtrees is a tight statistic. We also know that there exist classes of trees for which the statistic is not tight the most obvious being the class of trees for which each parent is allowed only 1 child. In such a tree the asymptotic probability that an arbitrary vertex has a size subtree is 0 for all as the number of vertices goes to . Two interesting questions we could ask are is this stastic tight for Schroeder trees and in general is there any way to classify trees where this statistic is tight. Also we could ask are there any non degenerate tree families for which this statistic is not tight.
Another interesting question would be about the sequence of probabilities for Schroeder trees themselves. We can see with the initial few numbers that the probabilities are not strictly decreasing. This makes sense because of the restriction of needing every parent to have at least two children. It would be interesting to prove either the sequence is eventually monotonically decreasing or it continues to oscilate forever. It is related to the problem of compositions of numbers without using the number one since we can always see how many vertices the tree has by adding up the number of children each vertice has but we can never have a vertex with only one child.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Gi-Sang Cheon, Louis W. Shapiro Protected points in ordered trees , Applied Mathematics Letters vol. 21 no. 5 pp. 516 - 520
- 2[2] Toufik Mansour, Protected points in k-ary trees , Applied Mathematics Letters vol. 24 number 4 pp.478 - 480
- 3[3] Miklós Bóna, On the number of vertices of each rank in phylogenetic trees and their generalizations , Discrete Mathematics & Theoretical Computer Science, Vol. 18 no. 3, Combinatorics (April 11, 2016) dmtcs:1431
- 4[4] Philippe Flajolet, Robert Sedgewick Analytic Combinatorics , Cambridge University Press, Cambridge (2009)
