On Path diagrams and Stirling permutations
Abstract
Any ordinary permutation of size , written as a word , can be locally classified according to the relative order of to its neighbours. This gives rise to four local order types called peaks (or maxima), valleys (or minima), double rises and double falls. By the correspondence between permutations and binary increasing trees the classification of permutations according to local types corresponds to a classification of binary increasing trees according to nodes types. Moreover, by the bijection between permutations, binary increasing trees and suitably defined path diagrams one can obtain continued fraction representations of the ordinary generating function of local types. The aim of this work is to introduce the notion of local types in Stirling permutations, to relate these local types with nodes types in ary increasing trees and to obtain a bijection with suitably defined path diagrams. Furthermore, we also present a path diagram representation of a related tree family called planeoriented recursive trees, and the discuss the relation with ternary increasing trees.
Keywords: Path diagrams, Stirling permutations, Increasing trees, local types, formal power series
2000 Mathematics Subject Classification 05C05.
1 Introduction
Any ordinary permutation of size can be locally be classified according to four local types called peaks (maxima), valleys (minima), double rises and double falls, depending on the relative order of to its neighbours. Index is called a peak if , a valley if , a double rise if , and a double fall if ; for , with respect to the boundary conditions , see Flajolet [7], or Conrad and Flajolet [5] and the references therein. Moreover, due to the bijection with binary increasing trees [7, 1], there exists a correspondence to certain local node types in binary increasing trees [7, 5]. Flajolet [7], see also Françon and Viennot [9], used a path diagrams representation of permutations or equivalently binary increasing trees to obtain a continued fraction representation of the ordinary generating function of local types in permutations, or equivalently of node types in binary increasing trees.
Stirling permutations were defined by Gessel and Stanley [10]. A Stirling permutation is a permutation of the multiset such that for each , , the elements occurring between the two occurrences of are larger than . The name of these combinatorial objects is due to relations with the Stirling numbers, see [10] for details. Recently, this class of combinatorial objects have generated some interest. Bona [2] studied the distribution of descents in Stirling permutation. Janson [14] showed the connection between Stirling permutations and planeoriented recursive trees and proved a joint normal limit law for the parameters considered by Bona.
A natural generalization of Stirling permutations on the multiset is to consider permutations of a more general multiset , with . We call a permutation of the multiset a Stirling permutation, if for each , , the elements occurring between two occurrences of are at least . Such generalized Stirling permutations have already previously been considered by Brenti [3], [4], and also by Park [19, 20, 21], albeit under the different name multipermutations. For one obtains ordinary permutations. For the class of Stirling permutations coincides with the ordinary Stirling permutations introduced by Gessel and Stanley. Recently, Janson et al. [15] studied several parameters in Stirling permutations, related to the studies [2, 14]: they extended the results of [2, 14] concerning the distribution of descents and related statistics. An important result of [15] is the natural bijection between Stirling permutations and ary increasing trees, for , which was already known to Gessel (see Park [19]). The family of ary increasing trees, with integer , includes the well known family of binary increasing trees , and also the family of ternary increasing trees, .
The aims of this work are threefold. First, we introduce the notion of local types in Stirling permutations and also of local node types in the corresponding ary increasing trees. Second, we give a bijection between Stirling permutations, ary increasing trees and suitably defined path diagrams. Third, we use the relation between path diagrams and formal power series to obtain a continued fraction type expansion of the generating function of local types in Stirling permutations, or equivalently local node types in ary increasing trees. Furthermore, we also discuss a related tree family called planeoriented recursive trees,^{1}^{1}1The family of planeoriented recursive trees also appears in the literature under the names plane recursive trees [14], heapordered trees [22, 23], Scalefree trees, and BarabásiAlbert trees; see [11]. which is in bijection with Stirling permutations [14], and also with ternary increasing trees [15]. We obtain a path diagram representation of planeoriented recursive trees and discuss the implication of the bijection with ternary increasing trees, as given in [15]. Best to the authors knowledge these problems have not been addressed before in the literature. This study is motivated by the work [7], partly also by [5], and by Gessel’s bijection between Stirling permutations and ary increasing trees [15], see also [19].
2 Increasing trees and generalized Stirling permutations
2.1 Generalized Stirling permutations
Let denote the set of Stirling permutations of size and let denote the number of them. The number is given by
(1) 
since the copies of have to form a substring, and this substring can be inserted in positions, anywhere–including first or last position, in any Stirling permutation of size ; see for example [19, 15]. For this number is just . For example, in the case we have one permutation of size given by ; four permutations of size given by , , , ; etc. In order to relate the Stirling permutations to ary increasing trees, and to relate Stirling permutations to planeoriented recursive trees, we will introduce a general family of increasing trees. We use a setting based on earlier considerations of Bergeron et al. [1] and Panholzer and Prodinger [18], which also includes ary increasing trees an planeoriented recursive trees as special instances. Although the tree families and their combinatorial description is quite well known, we collect the most important considerations of [1, 18, 15] for the readers convenience.
2.2 Families of Increasing trees
Increasing trees are labeled trees, where the nodes of a tree of size are labeled by distinct integers of the set in such a way that each sequence of labels along any branch starting at the root is increasing. As the underlying (unlabeled) tree model ones uses the socalled simply generated trees [17] but, additionally, the trees are equipped with increasing labellings. Thus, we are considering simple families of increasing trees, which are introduced in [1].
Formally, a class of a simple family of increasing trees can be defined in the following way. A sequence of nonnegative numbers with called the degreeweight sequence, we further assume that there exists a with , is used to define the weight of any ordered tree by , where ranges over all vertices of and is the outdegree of . Furthermore, denotes the set of different increasing labellings of the tree with distinct integers , where denotes the size of the tree , and its cardinality. Then the family consists of all trees together with their weights and the set of increasing labellings . The simple family of increasing trees associated with a degreeweight generating function , can be described by the formal recursive equation
(2) 
where denotes the node labeled by , the cartesian product, the disjoint union, the partition product for labeled objects, and the substituted structure; see e. g., the books [24, 8]. For a given degreeweight sequence with a degreeweight generating function , we define now the total weights by . It follows then that the exponential generating function satisfies the autonomous first order differential equation
(3) 
By proper choices for the degreeweight sequences we obtain the families of ary increasing trees and planeoriented recursive trees.
Example 1.
The family of ary increasing trees, with integer , is the family of increasing trees where each node has (labeled) positions for children, going from left to right. Thus, only outdegrees are allowed; moreover, for a node with children in given order, there are ways to attach them, see Figure 2. The vacant positions of a node are usually denoted by external nodes, see Figure 1 for an illustration of ternary increasing trees. Hence, the degreeweight generating function of ary increasing trees is given by , i.e. , . Consequently, the degree weight generating function is given by . By solving the corresponding differential equation (3) one obtains the generating function and the numbers ^{2}^{2}2We usually drop the dependence of and on for the sake of simplicity of ary trees of size
Note that , the number of Stirling permutations of size (1). For we obtain the family of binary increasing trees and for the family of ternary increasing trees.
Example 2.
The family of planeoriented recursive trees consists of rooted plane (=ordered) increasing trees such that all node degrees are allowed with all trees having weight 1. Since planeoriented recursive trees are ordered trees a new vertex may be joined to an existing vertex in exactly positions, where denotes the outdegree of node . These positions are sometimes represented by external nodes, see Figure 1. Consequently, the total number of positions available to vertex being attached to a tree of size is given by , independent of the actual shape of the tree of size . There is exactly one tree of size, . More generally, there are different planeoriented recursive trees of size , for . This number may also be obtained via the formal description above. Since all trees have weight one, we have for , and the degreeweight generating function is given by . Consequently, by solving the differential equation 3, we get
Note that , which equals the number of () Stirling permutations of size and the number of ternary trees of size . This is no coincidence since Janson has shown that planeoriented recursive trees of size are in bijection with Stirling permutation of size , see Theorem 2. Moreover, Janson et al. [15] have recently given a bijection between ternary increasing trees () of size , as defined above, and planeoriented recursive trees of size .
Remark 1.
Both, the family of ary increasing trees and the family of planeoriented recursive trees introduced before can be generated according to tree evolution processes; we refer the interested reader to the work of Panholzer and Prodinger [18] for a comprehensive discussion of the processes; see also Figure 1.
2.3 Bijections of Gessel and Janson
Theorem 1 (Gessel [19]; see also [15]).
Let . The family of ary increasing trees of size is in a natural bijection with Stirling permutations, .
As shown in [15], the bijection behind Theorem 1 allows to study parameters in Stirling permutations via the corresponding parameters in ary increasing trees. The bijection is stated explicitly below.
Bijection 1.
The depthfirst walk of a rooted (plane) tree starts at the root, goes first to the leftmost child of the root, explores that branch (recursively, using the same rules), returns to the root, and continues with the next child of the root, until there are no more children left. We think of ary increasing trees, where the empty places are represented by “external nodes”. Hence, at any time, any (interior) node has children, some of which may be external nodes. Between these edges going out from a node labeled , we place integers . (External nodes have no children and no labels.) Now we perform the depthfirst walk and code the ary increasing tree by the sequence of the labels visited as we go around the tree (one may think of actually going around the tree like drawing the contour). In other words, we add label to the code the first times we return to node , but not the first time we arrive there or the last time we return. A ary increasing tree of size 1 is encoded by . A ary increasing tree of size is encoded by a string of integers, where each of the labels appears exactly times. In other words, the code is a permutation of the multiset . Note that for each , , the elements occurring between the two occurrences of are larger than , since we can only visit nodes with higher labels. Hence the code is a Stirling permutation. Moreover, adding a new node at one of the free positions (i.e., the positions occupied by external nodes) corresponds to inserting the tuple in the code at one of gaps; note (e.g., by induction) that there is a bijection between external nodes in the tree and gaps in the code. This shows that the code determines the ary increasing tree uniquely and that the coding is a bijection.
The inverse, starting with a Stirling permutation of size and constructing the corresponding ary increasing tree can be described as follows. We proceed recursively starting at step one by decomposing the permutation as , where (after a proper relabelling) the ’s are again Stirling permutations. Now the smallest label in each is attached to the root node labeled 1. We recursively apply this procedure to each to obtain the tree representation.
A similar bijection of Janson relates Stirling permutation with planeoriented recursive trees.
Theorem 2 (Janson [14]).
The family of planeoriented increasing trees of size is in a natural bijection with Stirling permutations of size .
3 Local types in generalized Stirling permutations
It is well known, see Flajolet [7], or Conrad and Flajolet [5], that any ordinary permutation of size can be classified according to four local order types called peaks (maxima), valleys (minima), double rises and double falls. The classification depends on the relative order of , with , to its neighbours, with respect to the border conditions , ; note that sometimes the border condition is used [5], however the condition is more consistent with respect to the relation to binary increasing trees. Moreover, due to the bijection with binary increasing trees, there exists a correspondence to certain node types. Below we recall the classification of local types in permutations and node types in binary increasing trees [7], specified according to the index , with .
Local type  Peak  Valley  Double rise  Double Fall 

Condition  
Node type  Leaf  Double node  Rightbranching node  Leftbranching node. 
A natural question is to extend the notion of local order types to Stirling permutations. It turns out that a variation of the previous definition of local order types in permutations naturally extends to the general case of Stirling permutations. We introduce a slighty different notion of local order types in permutations in the following way.
Definition 1.
Given an ordinary permutation and entry , with , let denote the index such that , with . The local order type of entry in , with , is a string of length , with , defined by the relative order of to its neighbours , assuming to the border conditions , in the following way. The local type of entry is given by if is a peak , a if is a valley , if is a double rise , and if is double fall .
Example 3.
The ordinary permutation of size seven has the following local types , , , , , , and .
This new definition readily extends to the general case of Stirling permutation, with .
Definition 2.
Given a Stirling permutation of size , with border conditions , let be the indices such that . The local type of the numbers with is a string of length , with , generated according to relative orders of the , with , to their neighbors by the following rules.
and
Example 4.
The 3Stirling permutation of size six has the following local types , , , , , .
Since there are exactly different possible local types, we obtain the following result.
Proposition 1.
A Stirling permutation of size of the multiset can be classified according to different local types, with respect to the local rules in Definition 2.
Next we want to relate the local types in Stirling permutations to node types in ary increasing trees. By definition of ary increasing trees, every node has exactly (labeled) positions for children. Some of the positions may be occupied by (internal) nodes, some other may be vacant (occupied by external nodes). We propose the following definition.
Definition 3.
The node labeled , with , in a ary increasing trees of size may be specified according to the structure of its children, i.e. a sequence of length , where specifies whether the th position from node , going from left to right, is occupied by a node, , or not, , in the ary increasing tree of size , .
In other words, encodes whether node has an internal children via its th edge, going from left to right, or not.
Example 5.
In the case , binary increasing trees, we have different types of nodes. We already observed that sequence 11 corresponds to a double node, the sequence 10 to a leftbranching node, the sequence 01 to a rightbranching node, and the sequence 00 to a leaf.
Example 6.
In the case , ternary increasing trees, we have different types of nodes. The sequence 111 corresponds to a triple node, 101 to a (left,right)branching node, 110 to a (left,center)branching node, 011 to a (center,right)branching node, 100 to a leftbranching node, 010 to a centerbranching node, 001 to a rightbranching node, and 000 to a leaf, respectively. See Figure 2 for an illustration.
Theorem 3.
By Bijection 1 the local types in a Stirling permutation of size coincide with the node types of the corresponding ary increasing trees of size , , .
Proof.
We use Theorem 1 and the bijection between Stirling permutations and ary increasing trees, which is based on a depthfirst walk as described in Bijection 1. We start the depth first walk at the root of a given ary increasing tree of size with node types , and construct the corresponding Stirling permutation of size by traversing the tree according to Bijection 1. We show that the local order type equals the node type of the node labeled , for all . Assume first that the first of the positions of the node labeled is vacant, the node degree type . By Bijection 1 we observe that implies that and consequently ; here denotes the index of the first occurrence of in the corresponding Stirling permutation , since a smaller number must have been observed earlier according to the depthfirst walk and the property that the tree is increasingly labeled.
Assume now that the converse is true . By the depthfirst walk and the definition of increasing trees we have . More generally let denote the indices of the occurrences of in the corresponding Stirling permutation , for . For we note that implies that the indices and satisfy and consequently and further ; the converse is also true. Finally, if the and consequently . The converse is easily be seen to be true. ∎
3.1 Local types and path diagrams
It is well known by a theorem of Françon and Viennot [9] (see also Flajolet [7]) that the description of ordinary permutations via local types is closely related to path diagrams. In the following we give a bijection between Stirling permutations (ary increasing trees) and path diagrams with different stepvectors. First we recall some definitions of [7] concerning lattice paths. We have step vectors, consisting of different rise vectors , with for , a fall vector , and a level vector . To each word on the alphabet there exists an associated sequence of points , with such that , for all . We only consider paths that are positive and ending at , corresponding to sequences where that all the points have a nonnegative ycoordinate, and .
In a labeled path each step is indexed with the height of the point from which it starts. For a positive path associated to the word with corresponding sequence of points with , the labeling is a word of length over the infinite alphabet ,
by via the following rules
Next we recall the definition of path diagrams (see i.e. [9], [7] and the references therein). A system of path diagrams on a given set of (labeled) paths is defined as follows. A path diagram is a couple , where is a path, and is a sequence of integers such that for all , where is called a possibility function.
Now we are ready to state the connection between path diagrams, Stirling permutations and ary increasing trees.
Theorem 4.
The class of Stirling permutations of size (the family of ary increasing trees of size ) is in bijection with path diagrams of length , with possibility function given by
with respect to the labeled paths induced by the family of step vectors , with rise vectors for , fall vector , and level vector .
Remark 2.
For this reduces to the classical correspondence of Françon and Viennot [9]. Note that one may interpret as a rise vector, corresponding to the case , which would simplify the presentation. However, due to the importance of the case we opted not to do so, in order to be coherent with the presentations of [9], [7].
Proof.
Following [7] we shall set , with , for and ; moreover we also set , with for . We readily observe that the new refined path diagrams are in bijection with the previously defined path diagrams, with possibility function given by
We recursively construct a ary increasing tree, starting from a path diagram , with as follows. At step zero we start with the empty tree and one position to insert a node. At step , , we insert node to one of the vacant positions, where the number of vacant positions at step is given by the height of the path at position plus one. If letter , with and , then node is assumed to have outdegree . The specific outdegree structure of node , the distribution of the children to possible places, is, according to Definition 3, determined by an arbitrary but fixed bijection from the set to the set . If the number in the possibility sequence is , we assign node at the vacant position starting from the left. The construction is terminated by putting node as a leaf in the last vacant position after stage . ∎
Example 7.
Consider the case , corresponding to ternary increasing trees, or equivalently Stirling permutations. Below we illustrate the procedure stated above on the path diagram and , assuming the local outdegree structure correspondence determined by , , , , , .
By using for the bijection between ary increasing trees and Stirling permutations, see [15], we immediately obtain the corresponding Stirling permutation of size seven, . Note that we can also directly construct the Stirling permutation, since the local types of the outdegree of the nodes in the ternary increasing tree correspond to the local types of the numbers in the permutation. One may think of this procedure as some kind of “flattening of the tree to a line”, see below and compare with the sequence of trees in Figure 4.
3.2 A continued fraction type representation of local types
Flajolet [7] used the correspondence between path diagrams and formal power series to obtain continued fraction representations of the generating functions of many parameters in ordinary permutations. More precisely, in the context of permutations and binary increasing trees he derived, amongst many other results, a continued fraction representation of generating function of local types in permutations, or equivalently of node types in binary increasing trees. We will use the methods of [7] and the beforehand proven path diagram representation of Stirling permutations and ary increasing trees to obtain a continued fraction type representation of the generating function of the local types, and consequently also of node types. First we have to recall some more definitions of the work [7] concerning formal power series. Let denote the monoid algebra of formal power series on the set of noncommutative variables (alphabet) with coefficients in the field of complex numbers, with sums and Cauchy products are defined in the usual way
In order to define the convergence of a series, one introduces the valuation of a series , defined by
where denotes the length of the word . A sequence of elements , , converges to a limit if
Multiplicative inverses exist for series having a constant term different from zero; for example , where is known as the quasiinverse of . Note that we will subsequently use the notation . The characteristic series of is defined as
Finally, following [7] we use for subsets of the alternative notations for the union , for the extension to sets of the catenation operation on words, and let , with denoting the empty word. Moreover, we will use a Lemma (Lemma 1 of Flajolet [7]), which allows to translate operations on sets of words into corresponding operations on series, provided certain non ambiguity conditions are satisfied.
Lemma 1.
Let , be subsets of . Then

provided ,

provided that has the unique factorization property, implies and ,

provided the following two condition hold: with , each has the unique factorization property.
With the help of Lemma 1 one can translate operations on sets of words into corresponding operations on series provided certain nonambiguity conditions are satisfied.
Let be defined as the characteristic series of all labeled paths with step vectors given by starting and ending at the level , with , never going below level and above level , with . We assume that formal convention if . Moreover, let . We introduce the notation , , and in general for integer let be defined by
Proposition 2.
The characteristic series of all labeled paths with step vectors given by starting and ending at the level , with , never going below level and above level , with , satisfies
The double sequence converges for . Its limit given as follows.
In particular, equals the characteristic sequence of all labeled paths , starting and ending at the axis, never going below the axis, with step vectors given by .
Remark 3.
The case , treated by Flajolet [7], corresponds to binary increasing trees and ordinary permutation.
Proof.
For the sake of simplicity we only present the proof of the special case , corresponding to Stirling permutations and ternary increasing trees. We prove that
equals the characteristic series of the set of all labeled paths with step vectors , starting and ending at level zero with height bounded by . More generally, for
equals the characteristic series of all labeled paths starting and ending at level with height bounded by . Note that by our previous notation and regarding quasiinverse series, we have for instance
For the first few values of we obtain
In order to simplify the recursive description of we introduce the refined sets consisting of the paths starting and ending at level with height bounded by , where