Cycle updown permutations
Abstract.
A permutation is defined to be cycleupdown if it is a product of cycles that, when written starting with their smallest element, have an updown pattern. We prove bijectively and analytically that these permutations are enumerated by the Euler numbers, and we study the distribution of some statistics on them, as well as on updown permutations, on all permutations, and on a generalization of cycleupdown permutations. The statistics include the number of cycles of even and odd length, the number of lefttoright minima, and the number of extreme elements.
1. Introduction
Let , and let be the set of permutations of . A permutation of can be written in oneline notation as or as a product of cycles as
We will write commas in the cycle notation but not in the oneline notation, in order to distinguish them. A cycle is said to be in standard form if its smallest element is in first position. Every permutation has a unique expression as a product of cycles in standard form where the first entries of the cycles are in increasing order. For example, . A cyclic permutation is a permutation that consists of only one cycle.
An updown permutation of is a permutation satisfying
Let denote the set of updown permutations of length . It is well known that the size of is the Euler number . The exponential generating function (EGF for short) for the Euler numbers is
and the first values of are . A permutation satisfying is called a downup permutation.
In this paper we are concerned with a variation of the above definition. Instead of requiring the oneline notation to be updown, we will study permutations whose cycles, when written in standard form, have an updown pattern. A precise definition of these permutations, which we call cycleupdown permutations, is given in Section 2. It is also shown, both analytically and bijectively, that they are enumerated by the Euler numbers. In Section 3 we define a less restrictive family of permutations, which we call generalized cycleupdown permutations, and enumerate them as well. In Section 4 we obtain refined generating functions for these families of permutations with respect to several statistics. We also find statistics that are preserved by our bijections between updown and cycleupdown permutations. In Section 5 we study the distribution of some of these permutation statistics on , obtaining some formulas that involve the Stirling numbers of the first kind. Finally, Section 6 gives another interpretation of cycleupdown permutations in terms of perfect matchings.
Let us now introduce some notation and definitions that will be needed later on. Let be a finite subset of the natural numbers, and assume that . Given a permutation of , let be the permutation obtained by replacing each entry of the oneline notation of with . For example, . Following [5], we will call this operation a switch.
We say that is a lefttoright (LR) minimum (resp. maximum) of a permutation if (resp. ) for all . If , we say that is an extreme element if it is either an LR minimum or an LR maximum (see [6, p. 98]). The minmax subsequence of is defined to be the subsequence where is the smallest entry of , is the largest entry to the right of , is the smallest entry to the right of , and so on. Note that we always have . For example, the minmax sequence of is . An excedance (resp. deficiency) of is a value such that (resp. ). We use the term odd cycle (resp. even cycle) to mean a cycle of odd (resp. even) length.
For , we define the following statistics, which will be studied in Sections 4 and 5:

number of cycles of ,

number of odd cycles of ,

number of even cycles of ,

number of fixed points of ,

number of lefttoright minima of ,

length of the minmax sequence of ,

number of extreme elements of ,

number of excedances of .
2. Cycleupdown permutations
A cycle is said to be updown if, when written in standard form, say , one has . We define a permutation to be cycleupdown (CUD for short) if it is a product of updown cycles. For example, is CUD, but is not. Let be the set of CUD permutations of . The main result of this section is the enumeration of CUD permutations.
Proposition 2.1.
The number of CUD permutations of is .
In subsection 2.2 we give a bijective proof of this fact. In order to construct a bijection, it will be convenient to separate odd cycles from even cycles. Updown even cycles can alternatively be described as fully alternating cycles, meaning that in any representation of the cycle, the entries alternate going up and down. Then, CUD permutations having only cycles of even length are precisely those permutations with no fixed points where the image of each excedance is a deficiency, and viceversa. The following lemma enumerates these permutations.
Lemma 2.2.
The number of CUD permutations of all of whose cycles are even is .
If we only allow odd cycles, we obtain a similar result.
Lemma 2.3.
The number of CUD permutations of all of whose cycles are odd is .
2.1. Proofs via generating functions
Let us first give relatively straightforward proofs of the above results using generating functions.
Analytic proof of Proposition 2.1.
The number of CUD cyclic permutations of length is , because each such permutation can be written as , with being an updown permutation of . Thus, the corresponding EGF is
(1) 
Since any CUD permutation is an unordered product of updown cycles, the EGF for CUD permutations is
via the set construction (see [4]). Thus, using that , the statement of the proposition, in terms of generating functions, is equivalent to
Taking logarithms and differentiating, this equation is equivalent to , which can be proved by simple calculus, since and . ∎
Analytic proof of Lemma 2.2.
The EGF for CUD cyclic permutations of even length is
Thus, the statement of the proposition is equivalent to
which can be easily checked. ∎
Remark. It is now clear that if we want to count permutations where the image of excedances are deficiencies and viceversa, we only need to modify the proof of Lemma 2.2 by allowing fixed points. The EGF for these permutations is then
which appears in [7, A003701].
Analytic proof of Lemma 2.3.
The EGF for CUD cyclic permutations of odd length is
Thus, the statement of the proposition is equivalent to
which can be easily checked. ∎
2.2. Bijective proofs
Here we prove the three above results bijectively.
Bijective proof of Lemma 2.2.
Given , let be its left to right minima. Note that all the must be odd. Then
(2) 
is a CUD permutation with only even cycles, and is a bijection.
To find the preimage of a CUD permutation with only even cycles, write it as a product of cycles in standard form ordered by decreasing first entry. Removing the parentheses gives the oneline notation of an updown permutation which is its preimage by .
For example, if , we have . ∎
Bijective proof of Lemma 2.3.
It will be convenient to consider permutations of a finite set of natural numbers with . We describe a bijection between updown permutations of and CUD permutations of with only odd cycles. Given an updown permutation , let be such that . Define recursively
where is the switch operation defined in Section 1.
For example, if , then
which is a CUD permutation. Conversely, given a CUD permutation of with odd cycles, write it as a product of cycles in standard form ordered by increasing first entry, and reverse the previous steps. For example, if , then
∎
The bijection is similar to Chebikin’s decomposition of updown permutations into a set of updown permutations of odd length [1, p. 26].
Bijective proof of Proposition 2.1.
We can combine the bijections in the above two proofs to give a bijection . In the above proof of Lemma 2.2 we described a bijection from updown permutations of even length to CUD permutations with only even cycles. Consider the straightforward generalization of this bijection to permutations of a finite set of natural numbers.
Given , let be such that , and for , let . Define to be the CUD permutation which has cycle decomposition given by
For example, if , then
Now, noticing that the lefttoright minima of are and , we have
∎
An alternative bijective proof of Proposition 2.1 can be obtained by modifying a bijection of Johnson [5] involving the socalled zigzig sequences. We next describe the resulting map . Given , let be its rightmost extreme element. If it is an LR minimum (i.e. in this case), let ; if it is an LR maximum (i.e. in this case), let . We define to be the first cycle of , and we delete the entries from . Now we look at the rightmost extreme element of what remains of . Again, if it is an LR maximum, we switch to make an LR minimum. The second cycle of is , we delete the entries and repeat this process until has only one entry, which at this point is necessarily .
For example, if , then its rightmost extreme element is , so we take , add the cycle to , and remove and from . Now the rightmost extreme element is , so , we add the cycle to , and delete from . The rightmost extreme element of is , so , and the cycle gets added to . The rightmost extreme element of is , so , the cycle gets added to , and we end here, obtaining .
The inverse map can be described as follows. Given , write its cycles in standard form ordered by decreasing first element. Removing the parenthesis (this correspondence is due to Foata) gives the oneline notation of a permutation. Let be the permutation obtained by adding in front of it. Let be the largest index such that is alternating, that is, either updown or downup. Replace with . Consider again the largest alternating prefix of and switch it. Repeat until is alternating. If it is updown, then ; if it is downup, then .
Going back to the above example for , after applying Foata’s correspondence and inserting at the beginning we get . It is alternating up to , so we let . Now it is alternating up to , so we let . This is already an alternating permutation. Since it is downup, we recover .
3. Generalized cycleupdown permutations
We say that a cycle is generalized updown if it admits a representation satisfying (we call this an updown representation of the cycle). Note that updown cycles are always generalized updown cycles, but the converse is not true. For example, is a generalized updown cycle, but not an updown cycle. Define a permutation to be generalizedcycleupdown (GCUD for short) if it is a product of generalized updown cycles. Let be the set of GCUD permutations of . In this section we enumerate GCUD permutations.
We start by enumerating GCUD cyclic permutations. First observe that generalized updown cycles of odd length admit a unique updown representation. Indeed, given a cycle with , there is no other representation of the cycle because either or (unless ). Thus, the number of GCUD cyclic permutations of odd length is , with EGF . The EGF for GCUD permutations having only odd cycles is [7, A006229].
To count GCUD cyclic permutations of even length we use the following result, which appears in [2, Lemma 4]. The sequence is [7, A024255].
Lemma 3.1.
The number of permutations with is .
Proof.
Given an updown permutation with , let be the index such that (note that must be odd). Then the permutation is an updown permutation beginning with . Conversely, for any updown permutation with , its cyclic rotations
for are updown permutations whose last entry is larger than the first. Since the number of updown permutations in beginning with is , the result follows. ∎
An immediate consequence of Lemma 3.1 is that the number of permutations with is .
Lemma 3.2.
The number of GCUD cyclic permutations of is .
Proof.
Let be a GCUD cyclic permutation, and fix an updown representation of . If , then this is the only possible updown representation of , since any other representation would have the consecutive entries (note that it cannot start with because then the first and second entries would be ). By the above argument, there are GCUD cyclic permutations of this kind.
If , then has updown representations. Picking the representation that starts with a , there are choices for the other entries. In fact, these GCUD cyclic permutations are precisely the CUD cyclic permutations. Altogether, the number of GCUD cyclic permutations of both kinds is . ∎
From Lemma 3.2 it is easy to compute the EGF for GCUD cyclic permutations of even length:
The beginning of the sequence, starting with the coefficient of , is . The term , for example, corresponds to , , . The EGF for GCUD permutations having only even cycles is
and the first few terms are . The term corresponds to , , , , , .
Finally, the EGF for all GCUD permutations is
The first few terms are . The term 21 corresponds to all permutations of except , , . None of the above three sequences appears currently in [7].
4. Statistics on updown, CUD, and GCUD permutations
4.1. Refined generating functions
It is possible to refine the above enumerations of CUD and GCUD permutations by adding a variable that marks the number of cycles and a variable that marks the number of fixed points.
For CUD permutations we get the multivariate generating function
In particular, the EGF for CUD derangements is
and the first few terms are . The EGF for CUD permutations with respect to the number of cycles is
(3) 
The coefficients of in the expansion of (3) are the polynomials in [5, Eq. (7.1)].
It is also easy to keep track of odd and even cycles separately:
(4) 
The number of odd cycles and the number of excedances in a permutation are related by
since in each cycle of length and each cycle of length , of the entries are excedances. Consequently, the bivariate generating function for CUD permutations with respect to the number of excedances is
Finally, for GCUD permutations, the multivariate generating function keeping track of fixed points and cycles is
4.2. Statistics preserved by the bijections
In the following statements, , , and are the bijections defined in Section 2.2.
Lemma 4.1.
Let and let be the corresponding CUD permutation with only odd cycles. Then
Proof.
We proceed by induction on . The result is obviously true for . Recall the recursive definition of : if and , then
Thus, we have that
where the second equality holds by induction, and the last equality follows from the definition of the statistic . ∎
As a consequence of this lemma we obtain the EGF for updown permutations with respect to the statistic :
(5) 
where the second step follows from the analytic proof of Lemma 2.3. The coefficients of in the expansion of (5) are the polynomials in [5, Eq. (2.1)].
Lemma 4.2.
Let and let be the corresponding CUD permutation with only even cycles. Then
Proof.
It follows immediately from the definition of , since the opening parentheses for the cycles of are inserted at each lefttoright minimum of . ∎
Proposition 4.3.
Let and let . Then
Proof.
Recall the definition of : if and , then
where for all .
Since the range of (resp. ) are CUD permutations with only odd (resp. even) cycles, we have that
and
The third equation is obtained by adding the other two. ∎
We know from equation (4) that the bivariate EGF for CUD permutations where marks the number of even cycles is
It follows from the first part of Proposition 4.3 that the generating function for updown permutations with respect to the number of LR minima is
The coefficients of in the expansion of the last expression are the polynomials in [5, Eq. (5.1)].
Under the bijection described at the end of Section 2.2 and adapted from [5], the number of cycles corresponds to a different statistic:
Proposition 4.4.
Let and let . Then
Proof.
The positions of the extreme elements of are not affected by the switches that take place in the construction of . Since a new cycle of is created for each extreme element of , the result follows. ∎
5. Statistics on all permutations
Some of the above statistics have an interesting distribution not only in but also in . Let denote the signless Stirling numbers of the first kind. It is well known that
Lemma 5.1.
For ,
Proof.
We define a bijection that transforms the minmax sequence of a permutation into the sequence of lefttoright minima of . Given , let be the minmax sequence of . Starting with , for switch the entries of . Finally, if is the resulting permutation, let .
For example, if (the minmax sequence is in boldface), we first switch the entries , getting , then switch the entries , getting . The switch of the at the end does not change the permutation, so we obtain , where now the elements in boldface are the LR minima. ∎
In fact, the following generalization of Lemma 5.1 holds as well. For any infinite sequence , where each , define the statistic on permutations as the length of the subsequence where , , and in general for each until for some . For example, if , then , and if , then . Then, for any sequence as above, we have
The bijection from Lemma 5.1 can be easily generalized to prove this fact if we start with or depending on whether equals or , respectively, and then for each we switch the entries only if .
Proposition 5.2.
For with ,
Proof.
We give a bijection between the sets
and
Given a pair in the first set, the digit being or will indicate whether the th LR minimum of will become an LR minimum or an LR maximum of , respectively. Let be the LR minima of . Define for convenience. Let . For , switch the prefix of if . Let be the permutation obtained at the end. It is clear from the construction that the positions of the extreme elements of are the same as the LR minima of .
For example, if (the LR minima of are in boldface), we start with . Since , we first switch the prefix , getting . Now , so no switches are done for . Since , we now switch the prefix , getting . The last switch happens for because , ending with .
The inverse map has a similar description. Given with extreme elements, we have where, for , is or depending on whether the th extreme element of is an LR minimum or an LR maximum, respectively. To obtain , let be the extreme elements of from left to right. For , switch the first entries of if , where again we define for convenience. Finally, we recover by deleting the first entry, which is necessarily . ∎
Let us now study the distribution of two more statistics on permutations. For , let be the number of updown cycles in , and let be the number of cycles of that are not updown. Using equation (1) and the fact that the EGF for all cycles is
we can derive the EGF for all permutations with respect to the number of updown and nonupdown cycles:
(6) 
It is now straightforward to obtain an expression for the expected number of updown cycles in a random permutation. Plugging into (6) we get
the EGF for permutations where marks the number of updown cycles. Its derivative with respect to , evaluated at , is
(7) 
The expected number of updown cycles in a random permutation of is now the coefficient of in (7), which equals
(8) 
This formula can also be obtained directly using the wellknown fact that the expected number of cycles of length in a random permutation of is , for all . For each one of these cycles, the probability that it is updown is , since there are updown cycles of length . Thus, the expected number of updown cycles of length in a random permutation of is . Adding up for we obtain (8). For large , this number approaches
Another consequence of equation (6) is a formula for the number of permutations of having no updown cycles. The EGF for these permutations, obtained by setting and in (6), is
It follows that
The limiting value of this expression, which is the probability that a random permutation of length approaching infinity has no updown cycles, is .
6. Another interpretation of CUD permutations
A permutation of can be represented as a directed graph on vertices labeled , with an edge from to if and only if . Consider the following way of drawing the graph. Put the vertices on a horizontal line, ordered from left to right by increasing label. If (resp. ), then draw a red (resp. blue) arc between to above (resp. below) the horizontal line. Note that the orientation of the arcs is implicit, so we can draw undirected arcs (see Figure 1).
Using this drawing, CUD permutations having only even cycles correspond precisely to those graphs with the property that each vertex is of one of two types: it is incident to a red and a blue edge that connect it to vertices to its left, or it is incident to a red and a blue edge that connect it to vertices to its right. Equivalently, the edges of each color form a perfect matching of the vertices, and the two matchings agree on what vertices are opening vertices (matched with a vertex to their right) or closing vertices (matched with a vertex to their left).
Since the number of CUD permutations of