Analysis of some parameters for random nodes in priority trees

Priority trees are a certain data structure used for priority queue administration. Under the model that all permutations of the numbers 1 , . . . , n are equally likely to construct a priority tree of size n we study the following parameters in size-n trees: depth of a random node, number of right edges to a random node, and number of descendants of a random node. For all parameters studied we give limiting distribution results.


Introduction
The data structure of priority trees (also called p-trees) is used to implement priority queues.Priority queues are important for many scheduling problems (e.g., for jobs, events, etc.).Typical applications are given in operation systems (scheduling the execution of different jobs, resource management, etc.) and in discrete event simulation models (scheduling events according to their time of occurrence).To each element in a priority queue there is associated a fixed key, whose value determines its priority.We will here assume that low key values correspond to high priority.Two basic operations are fundamental for priority queue administration: inserting an element with arbitrary priority (INSERT), and removing the element with the highest priority (DELETE).
Priority trees can be considered as a special implementation of binary trees that make them suitable for usage as a priority queue.Formally they are defined as follows: a priority tree either is empty or consists of a sequence of nodes with non-increasing keys, the so called left path, such that to each node on the left path except the last one, there is associated a possibly empty priority tree, the so called right subtree.All nodes of the right subtree that are associated with a node z on the left path are ranked between z and the left successor of z.More precisely, if x with key k denotes the left successor of z with key l, then all nodes in the right subtree of z have key values s: k ≤ s < l. k = s can occur as is seen by considering the insertion algorithm defined in the sequel.
Of course it follows from this definition that not every binary tree of size n, where the size of a tree is given as usual by the number of internal nodes, can appear as a priority tree.The number P n of different size-n priority trees is given by the number of size-n Motzkin-trees (also called unary-binary trees).Although this is not mentioned explicitly in [10] it is a direct consequence of the formula for P n presented in that work.Priority trees are generated from the empty tree by successively inserting new elements via the recursive algorithm INSERT.Inserting a new element p into a priority tree T works as follows: • If T is empty or the key associated to the root of T is not larger than p, then let p be the new root and T its left subtree.
• Otherwise follow the left path of T and look for the first node x that has a key not larger than the key of p.
-If no such node exists, then append p to the left path as a new left leaf.
-Otherwise let us denote by z the predecessor of x; thus the key of p is ranked between the keys of x and z.In this case algorithm INSERT will be applied recursively to the right subtree of z to insert node p.
We give in Figure 1 an example of constructing a priority tree with the algorithm INSERT.
ǫ ⇒ 3 ⇒ Fig. 1: Construction of a priority tree of size 6 from the keys 3, 1, 6, 4, 5, 2 starting with the empty tree (denoted by ǫ).The node with key 3 has in the resulting tree exactly 2 ascendants (i.e., there are exactly 2 nodes lying on the path from the root to the node 3; therefore the depth of this node is 2) and 3 descendants (i.e., the size of the subtree with node 3 as root-node is 3).The number of right edges on the path from the root to node 3 is 0.
Priority trees were investigated in the early 1960's as a data structure for maintaining priority queues in the implementation of the programming language SIMULA, which was developed at the Norwegian Computer Center in Oslo by Dahl and Nygaard.A first average-case analysis of the behaviour of priority trees was given by Jonassen and Dahl in [10].They are also mentioned in handbooks of algorithms and data structure, e.g., in [6], where some of the results obtained in [10] are cited.In the average-case analysis it has been used always the so called random permutation model as the underlying probability model.This means that all n! permutations of {1, 2, . . ., n} are assumed to be chosen equally likely as data arrays to construct a priority tree of size n starting with the empty tree using algorithm INSERT repeatedly.As main results in their analysis we cite the expected number of key comparisons I n and the expected recursion depth R n when inserting a random element into a random size-n priority tree, and the expected size of the left path L n in a random size-n priority tree (this gives the depth of the node with the smallest key value, the so called left leaf, and thus the depth of the data with the highest priority, where the depth of a node x in the tree is here always measured by the number of nodes lying on the direct path from the root to x): Here H n := n k=1 1 k and H (2) 1 k 2 denote the first and second order harmonic numbers.Since E(I n ) ∼ 1  3 log 2 n, it follows that the operation INSERT is for priority trees asymptotically more expensive than for other priority queue structures (like heaps or leftist trees, see, e.g., [6]).We further remark that the dynamic behaviour of priority trees was considered in [9].
The average case analysis of this data structure under the random permutation model has been extended in [13], see also [12].The focus has been given there in computing exact formulae for the mean of several tree statistics for nodes in size-n trees with a fixed key j (and not for random nodes).In particular we obtained for size-n priority trees among others exact and asymptotic results for the expected depth of node j (= number of ancestors of j and also called height of j), the expected number of right edges (and left edges) to the node j, the expected number of descendants of node j, and the number of key comparisons when inserting a node with key j + 1 2 .Moreover, we have shown that the length of the left path L n is asymptotically Gaussian distributed with mean E(L n ) ∼ 2 log n and variance V(L n ) ∼ 2 log n.We remark that the latter result can be obtained directly by applying the theory of records (see, e.g., [3]).
In the present work we will reconsider some of these parameters, where we will focus here on establishing limiting distribution results for randomly chosen nodes in size-n priority trees: in particular we will analyse the depth A n of a random node.We remark that we use throughout this paper the convention that a node is considered as its own ancestor (and is thus counted for the depth) and descendant.The results obtained for these tree statistics are given in Section 2.
The motivation of the author for a detailed study of this tree family is three-fold.
• Up to now there exist only few results, which describe the average-case behaviour of the operations in priority trees that are of interest when using them as a data structure for priority queue administration.In particular the behaviour of the algorithm INSERT when inserting a random node into a randomly grown priority tree of size n is little analyzed: everything known was obtained more than 30 years ago in [10] leading to the exact and asymptotic formulae for the expectation of the number of key comparisons I n and the expectation of the recursion depth R n given above.Although we will not carry out the distributional analysis of I n and R n in the present paper state that these parameters are closely related to n studied here: one obtains that, asymptotically, n , or to be more precise, Theorem 1 also holds for I n and Theorem 2 also holds for R n .We state these results as Corollary 4. We remark that Corollary 4 is not a consequence of Theorem 1-2 (e.g., it does not seem that there is a simple relation between n ), but a consequence of the proof of these theorems, which is fully analogous.A very raw sketch of the proof of these results appeared in [11] as an extended abstract of a conference.
• This tree model seems to be also of some purely mathematical interest, since the algorithm INSERT gives a quite simple construction rule, which generates a tree family with an unusual behaviour.
Most random tree models are either a member of the class of log n-trees (a randomly chosen node has expected depth Θ(log n), like, e. g., the data structures binary search trees, digital search trees, and Quad-trees) or of the class of √ n-trees (a randomly chosen node has expected depth Θ( √ n), like, e. g., binary trees or unordered labelled trees, so called Cayley trees).As a consequence of Theorem 1 it is shown in this paper that priority trees are neither log n-trees nor √ n-trees, but the depth of a randomly chosen node has expectation ∼ 1 3 log 2 n and variance ∼ 10 81 log 3 n and is, after normalization, asymptotically standard normally distributed.
• The proof of the asymptotic normality of the centered and scaled version of the parameter A [H] n as stated in Theorem 1 could be of some methodological interest, since it was shown by using the method of moments without shifting by the exact or asymptotic mean.This requires of course a very detailed description of the asymptotic behaviour of the ordinary or factorial moments of A

[H]
n to take care of the huge cancellations when considering the centered random variable.The motivation comes from the fact that there are several parameters in the study of discrete structures, where one has a simple description of the random variable of interest by means of generating functions leading to functional equations, differential equations, etc., but when applying the method of moments, after shifting by the asymptotic mean, one often (apart from the instance E(X n ) ∼ cn) cannot directly continue the computations at the level of generating functions, but one is rather forced to go back and do it at the level of coefficients.In general certainly shifting the mean, i.e., to study directly the recurrences for the centered moments, is advantageous; see, e.g., [1] for an impressive example.However, there might be some intrinsic interest in the question what is necessary to know (and how to obtain this knowledge) about the behaviour of the generating functions of the ordinary (or factorial) moments of a random variable X n to show asymptotic normality of the normalized version of X n , in particular for instances, where the so called quasi-power theorem is not applicable.

Results
As already mentioned in the introduction we use as mathematical model for our analysis of priority trees the random permutation model, i.e., all n! permutations of the numbers 1, . . ., n are equally likely for constructing a priority tree of size n.For this model we give here in Theorems 1-3 limiting distribution results for the following three parameters: n is the random variable that counts the depth (= height) of a randomly chosen node in a random priority tree of size n, i.e., the number of nodes (= ancestors) lying on the unique path from the root to a randomly chosen node.
n is the random variable that counts the number of right edges on the path from the root to a randomly chosen node in a random priority tree of size n n is the random variable that counts the number of descendants of a randomly chosen node in a random priority tree of size n.The number of descendants of a node x is here defined as the size of the subtree rooted at node x, i.e., a chosen node is always counted as a descendant of itself.
We formulate now the main results of this paper, where we denote as usual by (d) − − → convergence in distribution and where Φ(x) denotes the distribution function of the standard normal distribution N (0, 1).

Theorem 1 The depth A [H]
n of a random node in a random size-n priority tree is asymptotically Gaussian distributed: The expectation E(A n of right edges on the path from the root to a random node in a random sizen priority tree is asymptotically Gaussian distributed, where the convergence rate is of order O 1 √ log n : The expectation .

Theorem 3 The number A [D]
n of descendants of a random node in a random size-n priority tree converges in distribution to a discrete random variable A [D] (with non-existing r-th moments E A [D] r , for − − → A [D] , which has the distribution

The r-th moments of A [D]
n are given asymptotically by We further present here limiting distribution results for the following two parameters, which describe the insertion costs when inserting a random element into randomly grown priority trees.
• I n : the number of key comparisons that are made when inserting a random element into a random priority tree of size n with the algorithm INSERT.For the model of randomness we assume further that all values of the set { 1 2 , 3 2 , . . ., n + 1 2 } can occur with equal probability 1 n+1 as the key of the inserted element.
• R n : the recursion depth, i. e., the number of calls of the algorithm INSERT, when inserting a random element into a random priority tree of size n.
By applying the methods used for the proof of Theorem 1-2 we obtained the following results (see [11]).

Corollary 4
The number of key comparisons I n when inserting a random element into a random size-n priority tree with the algorithm INSERT is asymptotically Gaussian distributed: The expectation E(I n ) and the variance V(I n ) satisfy The recursion depth R n when inserting a random element into a random size-n priority tree with the algorithm INSERT is asymptotically Gaussian distributed, where the convergence rate is of order O 1 √ log n : The expectation E(R n ) and the variance V(R n ) satisfy

Mathematical preliminaries and outline of the proofs
In our analysis we use the approach introduced in [13]: we work with three families of combinatorial objects denoted by A, B and C. The family A contains ordinary priority trees generated from random permutations (applying algorithm INSERT repeatedly) starting with the empty tree, the auxiliary family B contains priority trees generated from random permutations starting with the additional element "+∞", the auxiliary family C contains priority trees generated from random permutations starting with the additional element "−∞".We always assume that these additional elements are not counted for the size of an object, which means that the size of an object is given by the number of nodes without elements −∞ and +∞.
The analysis of the tree statistics introduced above relies heavily on the decomposition of the families A, B and C according to the first element k of a random permutation of the numbers 1, 2, . . ., n.These fundamental combinatorial decompositions are given in Figure 2.
They will lead to systems of recurrences for the probabilities P{A n = m}, P{B n = m} and P{C n = m} of the random variables A n , B n and C n , where A n is either A random variables A n,j , B n,j and C n,j , which count the corresponding tree parameters in objects of size n in the families A, B and C for a fixed node j (instead of a random node).Of course we have then where J n,j is the indicator variable of the event U n = j, where U n is uniformly (and independently of the A n,j ) distributed on {1, 2, . . ., n}.Corresponding equations hold for the B n and C n , too.It holds then that This approach was used in [13] and one can translate the decompositions of Figure 2 easily into systems of recurrences for the probabilities P{A n,j = m}, etc.By introducing trivariate generating functions we obtain then systems of linear differential equations for A(z, u, v), B(z, u, v) and C(z, u, v), which lead after specializing u = 1 to systems of linear differential equations for and the corresponding functions B(z, v) and C(z, v).All systems of differential equations can be transformed into single higher order linear differential equations for A(z, v).
Before we outline how to proceed from these differential equations we introduce some notation used throughout this paper.We denote by ) the falling factorials and by ⌊x⌋ the floor function (see, e.g., [7]).In order to avoid clumsy notations we use the abbreviation Pol x (d) for any polynomial in x of degree at most d, which can vary in every occurrence of Pol which gives 1 if Statement is true and 0 otherwise.

In the instance of A
[H] n we will use the method of moments to show the stated central limit theorem.First we can reduce the order of the third order differential equation for A(z, v) to a second order linear differential equation for a function H(z, v).The functions H r (z) := ∂ r ∂v r H(z, v) v=1 satisfy for all integers r ≥ 0 second order Cauchy-Euler differential equations and one can easily pump out the structure of the solutions for H r (z) as linear combinations of functions 1  ( This is shown in Lemma 5.This structure will follow also directly from the general study of Cauchy-Euler differential equations given in [2].But it is essential in our analysis to obtain a full recursive description for the coefficients α (m) r of the functions 1  (1−z) 2 L(z) m in these linear combinations, which is also established in Lemma 5.
Next, these recurrences for the coefficients α (m) r are studied for fixed m as a function of r.In Lemma 6 we show the representation α ⌋), which holds for fixed m and r ≥ 0.Moreover, the leading coefficients η (m) in the polynomials are given.
Lemma 8 translates these results to the generating functions A r (z) of the r-th factorial moments of In particular we obtain the asymptotic where the coefficients a (m) r are for fixed m and r ≥ 0 again given by a is now used together with a description of the appearing sums via higher order differences to treat the massive cancellations and to determine the leading terms of the r-th It follows that after normalization these centered moments converge to the moments of the standard normal distribution N (0, 1).This is established in Lemma 9.
In the instance of n the second order differential equation for A(z, v) is of Cauchy-Euler type, which has an explicit solution.Extracting coefficients [z n ]A(z, v) uniformly in a neighbourhood of v = 1 only requires singularity analysis of generating functions [5].Theorem 2 follows from this expansion immediately by an application of the quasi-power theorem due to Hwang [8].

In the instance of A [D]
n the second order differential equation for A(z, v) is again of Cauchy-Euler type.Although the solution is not given in closed form, it is here not hard to extract coefficients [z n v m ]A(z, v) and thus to give explicit results for the probabilities P{A

Singularity analysis leads then to asymptotic results for
The complete proofs of Theorems 1-3 are given in Sections 3-5.
3 Depth of a random node

A system of recurrences
Using the combinatorial decomposition given in Figure 2, i.e., the decomposition with respect to the first element k of a random permutation of {1, . . ., n}, we obtain the following system of recurrences for the probabilities P{A n,j = m}, which give the probabilities that node j has depth m in a random generated object of size n of the families A, B and C for 1 ≤ j ≤ n (see [13]).We recall the convention used in this paper that the depth of a node x is always measured by the number of nodes lying on the direct path from the root to x.
The appearing functions p n,m give the probabilities that the size of the left path, i.e., the number of nodes from the root to the left leaf, in a random object of size n of the family C is m.We will here make the convention to count the element +∞ but not the element −∞ for the depth of a node and the size of the left path.It has been shown already in [13] that these probabilities and their generating function p(z, v) := n≥0 m≥0 p n,m z n v m are given by: where n m denote the signless Stirling numbers of first kind.This can be seen easily by the observation that when starting with the element −∞ and inserting n distinct elements, an element x will be inserted into the left path if and only if x is larger than all elements already inserted.Thus p n,m is nothing else than the probability that the number of left-to-right maxima of a random permutation of {1, . . ., n} is exactly m, and it is well-known that these probabilities are given by the formula stated above.

The generating functions approach
Introducing the generating function A(z, u, v) := n,j = m}z n u j v m , and the corresponding functions B(z, u, v) and C(z, u, v), this system of recurrences (1) gives the following system of linear differential equations: , and the corresponding auxiliary functions B(z, v) and C(z, v), are thus satisfying the following system of differential equations with initial conditions Using the substitutions C(z, v) := (1 − z)C(z, v) and B(z, v) := (1 − z) v B(z, v) we can simplify system (2) and get Now one can successively eliminate B(z, v) and C(z, v) from (3a) by comparing with (3b) and (3c) and get eventually the following homogeneous third order linear differential equation for A(z, v): Since one solution of ( 4) is given by 1 1−z , which is checked easily, we can reduce the order of this differential equation when substituting This leads to the following homogeneous second order linear differential equation, which is the starting point of our studies (i) : with initial values H(0, v) = v and ∂ ∂z H(z, v) z=0 = 2v 2 .In order to apply the method of moments we define for integers r ≥ 0 the functions H r (z) via Differentiating equation ( 6) r times with respect to v and evaluating at v = 1 leads then to the following differential equations for H r (z) of Cauchy-Euler type: where the inhomogeneous parts are given by S 0 (z) = 0 and for r ≥ 1: The corresponding homogeneous differential equation has the general solution (with arbitrary constants C 1 , C 2 ): The variation of parameters method (see, e.g., [14]) gives then immediately the general solution of the required H r (z): (9) where the constants C r,1 and C r,2 are specified by the initial conditions: adapting to the initial values leads to the linear system of equations i) It should be remarked that the general solution of this differential equation can be expressed via hypergeometric functions or alternatively via Bessel functions.Maple is capable of finding a required solution basis.However it seems quite involved to show the given central limit theorem directly from the solution obtained after adapting to the initial values.
and thus to the solutions We get immediately that H 0 (z) = 1 (1−z) 2 , which, of course, follows also from the definition.

The exact solution of H r (z)
We will give now the exact solutions of the functions H r (z) satisfying ( 9), where we make throughout this paper the convention that We also recall the abbreviation L(z) := log 1 1−z .Lemma 5 The solution H r (z) of the differential equation ( 9) is given by with certain constants α that are defined recursively via (ii) ii) It must be noticed that in the further proof only the recurrences for α will not be used in the sequel, but they are stated here to keep the paper self-contained.
The constants C r,1 and C r,2 are given by (10).Furthermore we make the convention that α where we show in parallel the following formulae for the inhomogeneous parts S r (z) of ( 7): where the γ r and δ r are for r ≥ 0 given recursively by For r = 0 we obtain from the recurrences α = 0 and δ (0) 0 = 0, which corresponds with S 0 (z) = 0 and H 0 (z) = 1  (1−z) 2 ; thus formulae (11) and (13), and also the recurrences ( 12) and ( 14), hold for r = 0. Now we assume that formulae (11) and ( 13) together with the recurrences of the appearing coefficients are proven for all 0 ≤ k < r with a given r ≥ 1.To show them also for r we use at first the recursive definition of S r (z) via ( 8) and compute by using the induction hypothesis: Plugging in equation ( 8) these representations we get after collecting terms: Extracting in equation ( 15) the coefficients from the powers of L(z) shows then the validity of the given formulae (14) for γ (l) r and δ (l) r also for r ≥ 1.
To compute H r (z) using ( 9) we require the following antiderivative formulas (for integers m ≥ 0), which are obtained easily via integration by parts: Plugging in the representation (15) of S r (z) into the solution (9) for H r (z) gives then after a few manipulations and collecting terms: Extracting in equation ( 16) the coefficients from the powers of L(z) gives then the relations: , for r ≥ 2, Plugging in the already proved equations ( 14) for γ n involving higher order harmonic numbers (see [15]).The expectation E(A

This immediately gives E(A [H]
n ) ∼ 1 3 log2 n as asymptotic equivalent of the expectation.A (somewhat lengthy) exact formula for the variance V(A [12, p. 47], which gives the asymptotic equivalent V(A 81 log 3 n.

Description of the coefficients α (m) r
Of great importance in our proof of Theorem 1 is a quite detailed description of the structure of the coefficients α Remark: Equation (17a) is obviously equivalent to the formulation that for every m there exist constants c m,i , 0 ≤ i ≤ 2m − ⌊ m+1 2 ⌋, such that for all r ≥ 0: Thus, for all i ≥ 0, one can define functions c i (m), with m ∈ N, via: and obtains the following lemma equivalent to Lemma 6.
Lemma 7 There exist functions c 0 (m), c 1 (m), c 2 (m), . . ., such that for all m ≥ 0, r ≥ 0 the coefficients α (m) r are given as follows: is given by The formulation used in Lemma 7 has the advantage that we have indeed a description of the coefficients α (m) r valid for all m ≥ 0, r ≥ 0. However, the formulation used in Lemma 6 is the direct outcome of the proof by induction carried out in the following.
Proof: We use induction on m.
Step 0: The initial step.For m = 0 we have due to (12a) the recurrence Step 2: Simplifying the recurrence.In the following we will examine every term of the inhomogeneous part of this first order linear recurrence for α (m) r using the induction hypothesis, where we consider m as fixed as mentioned before.We start with where we combined in the last equation the cases m even and m odd.
Next we consider

Thus we get
For computing the leading coefficient η (m) it is necessary to determine the leading coefficient of the appearing polynomial.It is seen easily that only the case k = 1 gives a contribution and we obtain: 1) .
Combining these computations we get One shows similarly that and thus Next we consider for 0 ≤ l ≤ m − 1: and thus We distinguish the cases l even and l odd.Fist we consider the case l even, where we use 2 ⌋ (for arbitrary integers m): Next we consider the case l odd, where we use Here we are also interested in the leading coefficient of the polynomial, where it is seen easily that only the summand with k = 0 and l = m − 1 gives a contribution.We compute and get thus the more detailed description The last term in ( 19) can be treated analogous to the previous cases and we get for 0 ≤ l ≤ m − 1: and further Now we collect all terms using (20)-( 26) and obtain then from (19) the recurrence: With the substitution α(m) we obtain after multiplying by 3 r the following recurrence which holds for 1 ≤ m ≤ 2r − 1: We will now study this recurrence, where we have to distinguish the cases m even and m odd.
Since the polynomial in r of degree 3q − 1 is zero at r = q we can write and further From the validity of the recurrence we get that this formula is valid for r > q.But when plugging in r = q, the second and third term of (30) vanish and only α(2q) q remains, thus the formula is also valid for r = q.Moreover, when plugging in values 0 ≤ r < q, the formula gives α(2q) r = 0 or equivalently α (2q) r = 0, which matches with the definition of the α (2q) r . Thus the formula is actually true for all r ≥ 0, if m = 2q.After back substitution we can write (30) for even m > 0 as and get in this case the following recurrence for the leading coefficients η (m) : Step 4: Solving the recurrence for m odd.The case m odd in recurrence (28) is studied next.We assume that m = 2q + 1, then we have for r > q: Multiplying (32) by the factor (r−q− 1 2 ) r−q r r−q gives for r > q the recurrence We write the polynomial of degree 3q as 3q l=0 c l r l with certain constants c l and obtain after solving this recurrence by summation the following formula which holds for r > q: = 0 per definition, we obtain for r > q the formula α(2q+1) where we use here and in the following computations the identity x m+n = x m (x − m) n repeatedly.After shifting k by −q − 1 and making a base change to the falling factorials we get the following expression with certain constants d l : To evaluate the sums in (33) we use the identity (for s a non-negative integer, where D z denotes the differential operator with respect to z): We get then from equation (33): , and due to obvious simplifications the following result, which holds for r > q: But this formula (34) gives α(2q+1) r = 0 or equivalently α = 0 for all r ≤ q, and this matches with the definition of α (2q+1) r .Thus (34) holds for all r ≥ 0. Back substitution leads thus for odd m to and we get in this case the following recurrence for the leading coefficient η (m) : Step 5: The leading coefficients.Therefore the only thing remaining in the proof of Lemma 6 is to show formula (17b) for η (m) , but due to formulae (31b) and (35b) together with the initial value η (0) = 1 we obtain finally The coefficients a Remark: Again one could also use the following description of the coefficients a r , which is equivalent to the formulation given above: there exist functions c0 (m), c1 (m), c2 (m), . . ., such that for all m ≥ 0, r ≥ 0 the coefficients a (m) r are given as follows:  appearing there we obtain further the following local expansion in a complex neighbourhood of z = 1: Since integration by parts gives we get from (38) after easy manipulations This leads to the stated asymptotic expansion of A r (z) in Lemma 8 with coefficients Using the representation α ⌋) obtained in Lemma 6 one gets after distinguishing the cases k even and k odd for 0 ≤ k ≤ m: and equation (39) leads to It remains to examine the leading coefficient, where it turns out that only the summand k = m gives a contribution, and by using equation (17b) we get This completes the proof of Lemma 8. ✷

The r-th centered moments of A [H] n
The last step is to compute the asymptotic growth of the r-th centered moments E A Lemma 9 The r-th centered and normalized moments of A [H] n satisfy, for r fixed: Proof: The basic thing to compute these moments is of course extracting coefficients from the generating functions A r (z) asymptotically via singularity analysis, which leads to asymptotic expansions for the factorial moments: We will require here the full expansion given in [5, p. 227] as Theorem 3A to get (ǫ denotes an arbitrarily small constant > 0): where the constants κ k are given as follows (it is here important that they are not depending on m): In particular it holds that κ 0 = 1.This expansion is necessary since every term of A k (z), 0 ≤ k ≤ r, in the asymptotic expansion in Lemma 8 gives a contribution to the r-th centered moment E A The ordinary moments of A

[H]
n are of course related to the corresponding factorial moments via where n m denote the Stirling numbers of second kind.
Using (43) gives then the following expansion of the centered moments: The crucial step now is to control the massive cancellations appearing in (44).This is managed with the detailed description of the a (m) r given in Lemma 8. First we obtain after routine manipulations Now we have a closer look at the sum S m (k) in (45) for fixed m as a function of k.First we obtain for m, l, j fixed, with 0 ≤ j ≤ m − 2l, after distinguishing the cases j even and j odd and using Lemma 8: ⌋), and thus for m, l fixed: Next we require the following property of the Stirling numbers of second kind k k−l for fixed l as a function of k: these functions are for every integer l ≥ 0 a polynomial in k of degree 2l with zeros 0, 1, . . ., l − 1 (see [7, p. 271]), thus Combining equations ( 46) and ( 47) gives for all m, l fixed, with 0 and further that, for m fixed, S m (k) is a polynomial in k of degree (at most) 2m with the following factorization: Of course there is again the equivalent formulation that there exist functions f 0 (m), f 1 (m), f 2 (m), . . ., such that we have for all m ≥ 0, k ≥ 0 the representation Later on we will require also the leading coefficient [k 2m ]S m (k) of S m (k), i.e., the function f 0 (m).It is seen easily from the computations above that the only summand that gives a contribution to the main term of order k 2m is obtained for the values l = 0 and j = m in the sum defining S m (k).We get thus for all m ≥ 0: Now we evaluate the following sum F (r, m) in equation ( 45) for arbitrary pairs (r, m) with r ≥ 0, m ≥ 0: First we use that S m (k) has the factor k ⌊ m+1 2 ⌋ and it holds thus S m (k) = 0 for 0 ≤ k < ⌊ m+1 2 ⌋, which means that we can sum over the whole range (iii) from 0 to r: Next we use the calculus of higher order differences (see, e.g., [7]); that means we can interpret this sum as where ∆ denotes the forward difference operator (∆f (iii) Now it becomes apparent, why we had to give attention to the factor r But due to equation (48), for arbitrary m ≥ 0, S m (x) is a polynomial in x of degree 2m, which implies that the r-th power of the difference operator annihilates S m (x) for all pairs (r, m), which satisfy r > 2m, i.e., n − 1 3 log 2 n r as given in (45) can occur for m = ⌊ r+1 2 ⌋, which gives after distinguishing the cases r even and r odd: , for r odd.
To obtain the leading coefficient in this expansion for r even we use again formula (51) together with (49) and get for r = 2m: Expansion (45) gives then: Therefore normalization with the main term 10 81 log 3 n of the variance of A

Number of right edges to a random node
Due to the decomposition of the families A, B and C we obtain the following system of recurrences for the probabilities P{A n,j = m}, which give the probabilities that the number of right edges on the path from the root to node j in a random generated object of size n are m (for 1 ≤ j ≤ n): = m}z n v m , etc. with initial conditions A(0, v) = B(0, v) = C(0, v) = 0: where R(z, v) is given as With the substitutions C(z, v) = (1 − z)C(z, v) and B(z, v) = (1 − z)B(z, v) we obtain after adding equations (59b) and (59c): and a simple elimination leads to the following second order linear differential equation of Cauchy-Euler type for A(z, v): The general solution of the corresponding homogeneous differential equation is given by with arbitrary functions C 1 (v) and C 2 (v).Variation of the parameters method gives then after adapting to the initial conditions the solution of differential equation (60):

The limiting distribution
To characterize the limiting distribution of A [D] n we will first compute an explicit formula for the probabilities P{A n = m}.To do this we will extract coefficients from (61), where we require the following formulae, which are obtained by routine (but somehow lengthy) computations.It holds then for m ≥ 2: , , Using these equations we obtain from (61) the following explicit formula for the probabilities P{A , for m ≥ 1.
With the asymptotic expansion H n = log n + γ + O 1 n of the harmonic numbers we get from (62) the discrete limiting distribution of A [D] n given in Theorem 3.

The r-th moments
To compute the r-th moments of A Thus we want to extract the coefficients [z n w r ]A(z, v) asymptotically for fixed r and n → ∞.To do this we use the following formulae: for r ≥ 3,

n
of a random node, the number of right edges A [R] n to a random node and the number of descendants A [D]

n 1 DecompositionFig. 2 :
Fig. 2: Decomposition of the families A, B and C according to the first element.
⌋), with the same leading coefficients η (m) of the polynomials occurring in a

n
= m}.From this explicit formula we obtain immediately the first part of Theorem 3. To obtain the asymptotic formulae for the r-th moments of A [D] n as given in the second part of Theorem 3 we expand the solution of A(z, v) in terms of w := v − 1 and determine for fixed r the asymptotic expansion of [w r ]A(z, v) around the dominant singularity z = 1.

,
for 0 ≤ m ≤ 2r − 1, are required.Thus in particular the recurrences for β (m) r m < 0 or r < 0 or m > 2r, and that β (m) r = 0 if m < 0 or r ≤ 0 or m > 2r − 2. Remark: Due to the convention b k=a f (k) = 0 if b < a used throughout this paper Lemma 5 gives in particular the values α (0) 0 = C 0,1 = 1 and β (0) 0 = 0. Proof: To show this result we use induction on r,

r
also for r ≥ 1. ✷ Lemma 5 (together with equation (5)) allows now to compute at least in principle closed formulae for the moments of A[H]

Lemma 6
m fixed as a function of r.This is done in the following lemma, where we recall the abbreviation Pol x (d) for a certain polynomial in x of degree at most d, which can vary in every occurrence of Pol x (d).If d < 0 then we use the convention that Pol x (d) = 0.The coefficients α (m) r are for m fixed and r ≥ 0 given by α leading coefficients η (m) := [r 2m ]3 r α

0 = 1 , 3 r 1 :
for r ≥ 0. Thus the given representation (17) is true for m = 0.Step The recurrence.Now we assume that for 0 ≤ k < m and given m ≥ 1 the representation (17) holds.We will now study the coefficients α (m) r for m fixed as a function of r.First we write recurrence (12b), which holds for m ≤ 2r − 1, as

✷ 3 . 5 Lemma 8
Asymptotic expansion of A r (z) Lemma 6 leads easily to a description of the generating functions of the factorial moments of A The generating functions A r (z) := ∂ r ∂v r A(z, v) v=1 = n≥1 n E A [H] n r z n have the following local expansion around the dominant singularity z = 1:

9 m
for m fixed and r ≥ 0 given by the following formula, where the same leading coefficients η (m) = 5 m! as in (17b) appear:

1 3
log 2 n r , and only a very detailed knowledge about the structure of the coefficients of A k (z) can explain the huge cancellations.Using equation (41), Lemma 8 leads to

8 . 3 r
It is considerably less effort in Lemma 6 and Lemma 8 to show only the representation a (m) r = 1 Pol r (2m) for m ≤ 2r − 1, but this is not sufficient for the proof.
r−k S m (k) = 0, (52) whenever r > 2m or equivalently m ≤ ⌊ r−1 2 ⌋.Thus the first non-vanishing term in the expansion of E A [H]

n 1 3 log 2 n √ 10 81 log 3 n
proves this lemma.✷ Thus we have shown in Lemma 9 that the r-th moments of A[H]  n − converge to the r-th moments of a standard normally distributed random variable X withE X r = (2m)!2 m m! , for r = 2m even, 0 for r odd.Together with the Theorem of Fréchet and Shohat this shows the limiting distribution result for A[H] n stated as Theorem 1.

n
we define w := v − 1 and use[z n w r ]A(z, v)