Locally oriented noncrossing trees

We define an orientation on the edges of a noncrossing tree induced by the labels: for a noncrossing tree (i.e., the edges do not cross) with vertices 1, 2, . . . , n arranged on a circle in this order, all edges are oriented towards the vertex whose label is higher. The main purpose of this paper is to study the distribution of noncrossing trees with respect to the indegree and outdegree sequence determined by this orientation. In particular, an explicit formula for the number of noncrossing trees with given indegree and outdegree sequence is proved and several corollaries are deduced from it. Sources (vertices of indegree 0) and sinks (vertices of outdegree 0) play a special role in this context. In particular, it turns out that noncrossing trees with a given number of sources and sinks correspond bijectively to ternary trees with a given number of middleand right-edges, and an explicit bijection is provided for this fact. Finally, the inand outdegree distribution of a single vertex is considered and explicit counting formulas are provided again.


Introduction
A classical refinement of Cayley's formula for the number of labelled trees with n vertices is obtained by taking the vertex degrees into account as well.One version can be described by considering an orientation of the edges: fix a vertex (e.g., vertex 1) as the root, and assume that all edges are oriented to point away from the root.This gives rise to an outdegree sequence 0 e 0 1 e 1 2 e 2 • • • , where e i is the number of vertices of outdegree i (of course, every vertex, with the exception of the root, has indegree 1).The number of rooted labelled trees on n vertices with fixed root label and outdegree sequence λ = 0 e 0 1 e 1 2 e 2 • • • is given by (n − 1)! 2 e 0 !(0!) e 0 e 1 !(1!) e 1 e 2 !(2!) e 2 • • • , see [16,Corollary 5.3.5].Recently, Du and Yin [4] as well as Shin and Zeng [15] by another method proved that this expression also counts the number of labelled trees on n vertices whose outdegree sequence is λ = 0 e 0 1 e 1 2 e 2 • • • with respect to a local orientation of the vertices (as opposed to the global orientation away from the root), where every edge is oriented towards the end vertex whose label is higher.By symmetry, it also counts trees with given indegree sequence with respect to this local orientation.This formula was originally conjectured by Cotterill [2] in the context of algebraic geometry, and an extension to rooted forests was proven in [17].The aim of this paper is to obtain an analogous counting formula for noncrossing trees, which also form a very classical combinatorial class.In fact, we will be able to obtain even more, namely a surprisingly simple formula that gives the number of noncrossing trees where both indegree and outdegree sequence are prescribed at the same time.There does not seem to be a simple counting formula of this kind for ordinary labelled trees, see [10].Recall that a noncrossing tree (see Figure 1 for an example) is a tree that can be drawn in the plane with its vertices on the boundary of a circle (labelled from 1 to n in clockwise direction around the circle) such that the edges are straight line segments that do not cross.The number of noncrossing trees on n labelled vertices is known to be given by see [3,9] for details.In [6], Flajolet and Noy obtained a formula for the number of noncrossing trees on n vertices with a given outdegree sequence with respect to the aforementioned global orientation, where all edges are oriented to point away from the root.They showed that the number of noncrossing trees on n vertices with outdegree sequence 0 e 0 1 e Several other statistics on noncrossing trees have been considered in the literature, such as degree of a fixed vertex [9], number of end-points or boundary edges [3], maximum degree [3], height of vertices [12], edge cuts [13], descents [8] or left and right leaves [11].
Let us now state our main result.We will equip noncrossing trees with the aforementioned local orientation induced by its labels, i.e. edges are always oriented towards the higher label, as in Figure 1.We will use the abbreviation "lnctrees" for locally oriented noncrossing trees throughout the paper.We also remark on this occasion that a valid in-or outdegree sequence 0 e 0 1 e 1 2 e and we will always assume that this condition is satisfied.
Theorem 1.1.The number of lnc-trees of order n with indegree sequence 0 e 0 1 e 1 2 e 2 • • • and outdegree sequence 0 We will prove this theorem by means of generating functions in the following section and obtain a number of corollaries from it in Section 3. One of these corollaries, regarding vertices of in-or outdegree 0 (which we call sources and sinks respectively), yields a formula that also occurs in the enumeration of ternary trees by their edge types, and we will provide a bijection that illustrates this fact.The paper concludes with a discussion of the in-or outdegree of an individual vertex in Section 5.
Remark 1.What makes Theorem 1.1 quite surprising is the fact that in-and outdegree sequence are almost completely separated from each other in formula (1.3).To make this precise, if we consider a random tree of order n with a given number e 0 of sources (vertices of indegree 0) and a given number d 0 of sinks (vertices of outdegree 0), the in-and outdegree sequence are independent random variables.

Proof of the main theorem
We prove Theorem 1.1 by means of a generating functions approach.In all our generating functions, x i marks vertices whose indegree is i, y j marks vertices whose outdegree is j, and z marks the total number of vertices.We let A be the generating function for lnc-trees rooted at vertex 1 such that the root has degree 1 (we will refer to such trees as "type A" trees), and B the corresponding generating function for lnc-trees rooted at vertex n, which is again assumed to have degree 1 ("type B" trees).In both cases, we do not let the root count towards the total number of vertices (i.e., the exponent of z in the generating functions A and B actually represents the number of non-root vertices), which turns out to be convenient for us.Finally, T will be the generating function for all noncrossing trees.
If we consider vertex 1 as the root, then we have the decomposition of an lnctree shown in Figure 2 into the root and its branches R 1 , R 2 , . . ., R r , which are noncrossing subtrees.Each of the subtrees R j , together with the edge to the root, can be considered as an lnc-tree whose root has label 1 and degree 1, and those trees are counted by the generating function A. Therefore, Similarly, if we consider vertex n as the root, then we obtain Moreover, we have This follows from the decomposition of noncrossing trees of type A shown in Figure 3 (a so-called "butterfly"): such a tree can be decomposed into the root edge from 1 to some vertex v, the branches with labels greater than v, and the branches with labels less than v. Trees of type B can be decomposed analogously.From Equations (2.1), (2.2) and (2.3), we get Thus, Setting T = x 0 y 0 zW in Equation (2.4), we obtain Equations (2.1) and (2.2) yield and Equation (2.6) implies that A = φ(x 0 W), where φ is implicitly given by Likewise, Equation (2.7) implies that B = ψ(y 0 W), where ψ is implicitly given by Thus equation (2.5) becomes and it follows that By the Lagrange Inversion Formula [16, Theorem 5.4.2], one has Applying the Lagrange Inversion Formula again, we obtain Now by the definition of the formal power series φ in (2.8), this equals Similarly, Plugging Equations (2.10) and (2.11) into (2.9),we end up with This completes the proof.

Consequences of the main theorem
A number of corollaries follow immediately from our main result upon specialisation.The first and most obvious specialisation of this kind is to consider only the indegree sequence (or only the outdegree sequence), which is done in the following corollary.
Corollary 3.1.The number of lnc-trees of order n with indegree sequence λ = 0 e 0 1 e 1 2 e 2 • • • (or outdegree sequence λ) is equal to Proof.We first sum over all possibilities for d 1 , d 2 , . ..: since we find that the total number of lnc trees with indegree sequence λ and d 0 sinks is and (3.1) follows by summing over all d 0 from the Vandermonde identity.
Corollary 3.2.The average number of vertices with indegree (outdegree) a in lnc-trees of order n is   Remark 2. Asymptotically, the average number of vertices with indegree (outdegree) a is 4n/3 a+1 for a > 0 (for example, roughly 4/9 of the vertices have indegree 1).
Proof.Starting from the previous corollary, we first sum over all possibilities for e 1 , e 2 , . ..: which leaves us with for the total number of vertices whose indegree is a > 0. The statement follows by dividing by the total number of noncrossing trees of order n.The formula for a = 0 follows either directly in the same way or by subtracting the average number of vertices whose indegree is greater than 0: We see that vertices of indegree or outdegree 0 (i.e., sources and sinks) play a special role.In the following, we present several results on the enumeration of lnc-trees with respect to the number of sources and sinks.
Corollary 3.3.The number of lnc-trees of order n with k sources and sinks is equal to Proof.The result follows by summing (1.3) over all possibilities of e 1 , e 2 , . . .and d 1 , d 2 , . . .as in the proof of Corollary 3.1.A bijective proof of this corollary is given in Section 4.

Corollary 3.4.
There are Proof.This formula follows immediately by summing over all in Equation (3.2).
Corollary 3.5.The number of lnc-trees of order n with a total of r sources and sinks is given by Proof.We set = r − k in Equation (3.2) and sum over all k.
Remark 3. Trees with the property that every vertex is either a source or a sink (equivalently, every vertex is either only adjacent to vertices whose label is higher or only to vertices whose label is lower) are called alternating trees.The special case r = n in the previous corollary shows that the number of noncrossing alternating trees of order n is the Catalan number 1 n−1 ( 2n−2 n−2 ); this was first proven by Gelfand, Graev and Postnikov in [7], where those trees are called standard trees.
From the explicit formula (3.2), we also obtain further information on the distribution of the number of sources and sinks in random lnc-trees.Specifically, we have the following theorem: Theorem 3.6.The mean and variance of the number of sources and the number of sinks are equal to (n + 1)/3 and (4n 2 − 10n + 4)/(27n − 36) respectively.The covariance of the two is equal to (−2n 2 + 5n − 2)/(27n − 36).
Asymptotically, the two numbers follow a two-dimensional Gaussian distribution.
Proof.We know from Theorem 3.3 that the probability for an lnc-tree to have exactly k sources and sinks is The explicit formula for the mean (which has already been derived in Corollary 3.2 as well) follows by multiplying by k and then summing over all k and ; the other moments are obtained in the same way.
For the asymptotic distribution, set k = n/3 + x √ n and = n/3 + y √ n and apply Stirling's formula to obtain e −9(x 2 +xy+y 2 )/2 , which shows that the limiting distribution is a two-dimensional normal distribution.
Finally, if we multiply (3.3) by and sum over all possible , we obtain the total and thus also the average number of sinks in trees with k sources.The variance can be obtained in the same way, and we end up with the following corollary: Corollary 3.7.The mean number of sinks in lnc-trees on n labelled vertices with k sources is (n − k + 1)/2, and the variance is given by (n 2 − k 2 − 2n + 1)/(8n − 12).Remark 4. The statement of this corollary remains true if we prescribe the entire indegree sequence in addition to the number of sources.

A bijection with ternary trees
The total number of n-vertex noncrossing trees given in (1.1) is also the number of ternary trees with n − 1 vertices, and bijections between the two were established by different authors.The aim of this section is to present a refinement of this correspondence.Let T be a ternary tree which consists of a root e and 3 disjoint ternary subtrees, T 3 , T 2 , T 1 in this order.See Figure 4. We shall call the edges from the root to T 1 , T 2 and T 3 right-edge, middle-edge and left-edge respectively.Cigler [1, Theorem 1] showed that the number of ternary trees on n − 1 vertices having precisely ( − 1), (k − 1), and (n − k − ) rightedges, middle-edges and left-edges respectively is given by which also counts noncrossing trees with n vertices, k sources and sinks by Corollary 3.3.In the following, we construct an explicit bijection between the two that is a modification of the bijection between ternary trees and noncrossing trees obtained independently by Simion and Postnikov as mentioned by Stanley in [16,Solution 5.46].Other bijective proofs can be found in the literature, see for example papers of Dulucq and Penaud [5], and Panholzer and Prodinger [14].

Theorem 4.1.
There is a bijection between the set of ternary trees on n − 1 vertices such that there are k − 1 and − 1 middle-edges and right-edges respectively, and the set of lnc-trees on n vertices with k sources and sinks.
Proof.Given an lnc-tree T on n vertices having k sources and sinks, we obtain the corresponding ternary tree β(T) on n − 1 vertices (the n − 1 edges of T become the vertices of β(T)) with k − 1 left-edges and − 1 right-edges by the following steps: I. Let s be the vertex with the smallest label in T (1 initially), and let j be the vertex with the greatest label adjacent to s.We denote the edge sj by e.Three subtrees of T are defined as follows: II. T 1 is the connected component containing s in the graph T − e obtained by removing the edge e; III. T 2 is the connected component containing vertex j in the graph obtained from T by removing the edge e and vertices with labels greater than j; IV. T 3 is the tree induced by the vertices with labels greater or equal to j.
V. Take e as the root of β(T) and recursively define β(T 1 ), β(T 2 ) and β(T 3 ) (from right to left) to be the three branches, with the respective roots connected to e. Label left-edges, middle-edges and right-edges as l, m and r respectively in the ternary tree rooted at e.

In-and outdegree of a single vertex
Let us finally consider the distribution of the in-and outdegree of a fixed vertex i.By symmetry, it is sufficient to consider one of the two, so we define the number N(n, i, d) to be the number of lnc-trees on n vertices for which vertex i has outdegree d.In [9, Theorem 2.3], Noy showed that the number of noncrossing trees of order n such that a given vertex has degree d is given by Theorem 5.1.The number N(n, i, d) of lnc-trees of order n for which vertex i has outdegree d ≥ 1 is where U(n, d) is given by (5.1).
Proof.To prove the theorem it suffices to show that for i ≥ 2, N(n, i, d) satisfies the recurrence and that N(n, 1, d) is indeed given by Equation (5.1), i.e.N(n, 1, d) = U(n, d).
The latter is clear since the outdegree of vertex 1 is also always its degree, and we prove recurrence (5.3) by means of a bijective argument.Consider an lnc-tree T in which vertex i − 1 has outdegree d.We relabel the vertices such that vertex n is given label 1, and for j < n, vertex j is given label j + 1 (this amounts to a rotation of labels).In the resulting tree T , the outdegree of vertex i is d again, except in the case where there is an edge from i − 1 to n in T; this edge becomes an edge from i to 1 in T , with the direction reversed, so that the outdegree of i is d − 1.In this case, we perform one more step.Let j be the smallest label greater than i such that there is an edge between 1 and j in T .We remove this edge and replace it by an edge between i and j, thereby effectively moving a branch from 1 to i and increasing the outdegree of i to d.The resulting tree is called T .The map that sends T to T in the first case and to T in the second case thus maps lnc-trees for which the outdegree of vertex i − 1 is d to lnc-trees for which the outdegree of vertex i is d.It can easily be reversed: given a tree in which vertex i has degree d, move the branch with i's highest-label neighbour from i to 1 if there an edge between 1 and i (otherwise, do not move anything) and rotate the labels.In the resulting lnc-tree, vertex i − 1 has outdegree d.This is almost a bijection, but there is one exceptional case that is not covered, namely the situation that there is an edge between i − 1 and n in T (thus an edge between i and 1 in T ), and vertex 1 does not have any neighbours in T whose label is greater than i.To complete the proof, it remains to show that there are exactly U(n − i + 1, d − 1)U(i, 1) trees of this kind.Consider an exceptional lnc-tree, as illustrated in Figure 6.It can be decomposed into two parts: one part is the lnc-tree induced by the vertices i, i + 1, . . ., n, which can be any lnc-tree on those n − i + 1 vertices such that vertex i has degree d − 1.There are thus U(n − i + 1, d − 1) possibilities.
The rest is an arbitrary lnc-tree with i vertices such that vertices 1 and i are connected by an edge.The number of such trees is equal to the number of trees for which vertex 1 has degree 1, since in either case we have a unique decomposition into two rooted subtrees: the subtrees obtained when the edge between 1 and i is removed in the first case, and the subtrees on either side of the edge going out from 1 in the other case.See also [9,Corollary 2.4].
Thus the total number of exceptional trees is indeed given by U(n − i + 1, d − 1)U(i, 1), which completes the proof.

Figure 1 :
Figure 1: An example of a noncrossing tree with the orientation induced by its labels.

Figure 5 :
Figure 5: Diagram showing the bijection in the proof of Theorem 4.1.

4 i 2 1Figure 6 :
Figure 6: Exceptional lnc-trees. 2 2 • • • of a tree of order n always has to satisfy the coherence condition