1 Introduction

# Cycle up-down permutations

## Abstract.

A permutation is defined to be cycle-up-down if it is a product of cycles that, when written starting with their smallest element, have an up-down 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 up-down permutations, on all permutations, and on a generalization of cycle-up-down permutations. The statistics include the number of cycles of even and odd length, the number of left-to-right 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 one-line notation as or as a product of cycles as

 π=(a11,a12,…)(a21,a22,…)(a31,a32,…)…

We will write commas in the cycle notation but not in the one-line 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 up-down permutation of is a permutation satisfying

 π1<π2>π3<π4>….

Let denote the set of up-down 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

 E(z)=secz+tanz=∑n≥0Enznn!,

and the first values of are . A permutation satisfying is called a down-up permutation.

In this paper we are concerned with a variation of the above definition. Instead of requiring the one-line notation to be up-down, we will study permutations whose cycles, when written in standard form, have an up-down pattern. A precise definition of these permutations, which we call cycle-up-down 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 cycle-up-down 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 up-down and cycle-up-down 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 cycle-up-down 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 one-line notation of with . For example, . Following [5], we will call this operation a switch.

We say that is a left-to-right (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 min-max 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 min-max 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 left-to-right minima of ,

• length of the min-max sequence of ,

• number of extreme elements of ,

• number of excedances of .

## 2. Cycle-up-down permutations

A cycle is said to be up-down if, when written in standard form, say , one has . We define a permutation to be cycle-up-down (CUD for short) if it is a product of up-down 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. Up-down 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 up-down permutation of . Thus, the corresponding EGF is

 (1) ∑n≥1En−1znn!=∫z0E(u)du.

Since any CUD permutation is an unordered product of up-down cycles, the EGF for CUD permutations is

 exp(∫z0E(u)du),

via the set construction (see [4]). Thus, using that , the statement of the proposition, in terms of generating functions, is equivalent to

 exp(∫z0E(u)du)=E′(z).

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

 ∑m≥1E2m−1z2m(2m)!=∫z0tanudu.

Thus, the statement of the proposition is equivalent to

 exp(∫z0tanudu)=secz,

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

 exp(z+∫z0tanudu)=ezsecz,

which appears in [7, A003701].

###### Analytic proof of Lemma 2.3.

The EGF for CUD cyclic permutations of odd length is

 ∑m≥0E2mz2m+1(2m+1)!=∫z0secudu.

Thus, the statement of the proposition is equivalent to

 exp(∫z0secudu)=E(z),

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) g(π)=(πi1,…,πi2−1)(πi2,…,πi3−1)…(πik,…,π2m)

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 one-line notation of an up-down 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 up-down permutations of and CUD permutations of with only odd cycles. Given an up-down permutation , let be such that . Define recursively

 f(π)=(πk,πk−1,…,π1)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯πk+1πk+2…πn),

where is the switch operation defined in Section 1.

For example, if , then

 f(471938562)=(1,7,4)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯938562)=(1,7,4)f(283659)=(1,7,4)(2)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯83659)=(1,7,4)(2)f(59683)=(1,7,4)(2)(3,8,6,9,5),

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

 σ=(1,8,5,7,2)f(463)=(1,8,5,7,2)f(¯¯¯¯¯¯¯¯436)=f(27581436).

The bijection is similar to Chebikin’s decomposition of up-down permutations into a set of up-down 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 up-down 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

 g(π′1…π′k−1)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯π′k+1…π′n+1).

For example, if , then

 ϕ(π)=g(5827411)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯911036).

Now, noticing that the left-to-right minima of are and , we have

 ϕ(π)=(5,8)(2,7,4,11)f(310196)=(5,8)(2,7,4,11)(1,10,3)(6)(9).

An alternative bijective proof of Proposition 2.1 can be obtained by modifying a bijection of Johnson [5] involving the so-called 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 one-line 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 up-down or down-up. Replace with . Consider again the largest alternating prefix of and switch it. Repeat until is alternating. If it is up-down, then ; if it is down-up, 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 down-up, we recover .

## 3. Generalized cycle-up-down permutations

We say that a cycle is generalized up-down if it admits a representation satisfying (we call this an up-down representation of the cycle). Note that up-down cycles are always generalized up-down cycles, but the converse is not true. For example, is a generalized up-down cycle, but not an up-down cycle. Define a permutation to be generalized-cycle-up-down (GCUD for short) if it is a product of generalized up-down 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 up-down cycles of odd length admit a unique up-down 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 up-down permutation with , let be the index such that (note that must be odd). Then the permutation is an up-down permutation beginning with . Conversely, for any up-down permutation with , its cyclic rotations

 σ2i−1σ2i…σ2kσ1σ2…σ2i−2

for are up-down permutations whose last entry is larger than the first. Since the number of up-down 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 up-down representation of . If , then this is the only possible up-down 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 up-down 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:

 ∑k≥1(E2k−(k−1)E2k−1)z2k(2k)!=∑k≥1E2kz2k(2k)!−∑k≥112E2k−1z2k(2k−1)!+∑k≥1E2k−1z2k(2k)!=secz−1−z2tanz+∫z0tanudu=secz−1−z2tanz−ln(cosz).

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

 sec(z)exp(secz−1−z2tanz),

and the first few terms are . The term corresponds to , , , , , .

Finally, the EGF for all GCUD permutations is

 sec(z)exp(secz−1+(1−z2)tanz).

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 up-down, 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

 ∑n≥0∑π∈Δnxfp(π)tc(π)znn!=exp[t((x−1)z+∫z0E(u)du)]=e(x−1)tzE′(z)t=e(x−1)tz(1−sinz)t.

In particular, the EGF for CUD derangements is

 e−z1−sinz,

and the first few terms are . The EGF for CUD permutations with respect to the number of cycles is

 (3) (1−sinz)−t.

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) ∑n≥0∑π∈Δntce(π)etco(π)oznn!=exp(∫z0(tosecu+tetanu)du)=(secz+tanz)to(secz)te.

The number of odd cycles and the number of excedances in a permutation are related by

 co(π)+2exc(π)=n,

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

 ∑n≥0∑π∈Δntexc(π)znn!=[sec(z√t)+tan(z√t)]1/√tcos(z√t).

Finally, for GCUD permutations, the multivariate generating function keeping track of fixed points and cycles is

 ∑n≥0∑π∈Θnxfp(π)tc(π)znn!=sect(z)exp[t((x−1)z+secz−1+(1−z2)tanz)].

### 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

 c(f(π))=mm(π).
###### Proof.

We proceed by induction on . The result is obviously true for . Recall the recursive definition of : if and , then

 f(π)=(πk,πk−1,…,π1)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯πk+1πk+2…πn).

Thus, we have that

 c(f(π))=1+c(f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯πk+1πk+2…πn))=1+mm(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯πk+1πk+2…πn)=mm(π),

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 up-down permutations with respect to the statistic :

 (5) ∑n≥0∑π∈Λntmm(π)znn!=∑n≥0∑σ∈Δntc(σ)znn!=exp(t∫z0secudu)=(secz+tanz)t,

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

 c(g(π))=lrm(π).
###### Proof.

It follows immediately from the definition of , since the opening parentheses for the cycles of are inserted at each left-to-right minimum of . ∎

###### Proposition 4.3.

Let and let . Then

 ce(σ)=lrm(π)−1, co(σ)=mm(π)−1, c(σ)=lrm(π)+mm(π)−2.
###### Proof.

Recall the definition of : if and , then

 σ=ϕ(π)=g(π′1…π′k−1)f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯π′k+1…π′n+1),

where for all .

Since the range of (resp. ) are CUD permutations with only odd (resp. even) cycles, we have that

 ce(σ)=c(g(π′1…π′k−1))=lrm(π′1…π′k−1)=lrm(π1…πk−11)−1=lrm(π)−1

and

 co(σ)=c(f(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯π′k+1…π′n+1))=mm(¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯π′k+1…π′n+1)=mm(1πk+1…πn+1)−1=mm(π)−1.

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

 G(t,z)=(secz+tanz)(secz)t.

It follows from the first part of Proposition 4.3 that the generating function for up-down permutations with respect to the number of LR minima is

 ∑n≥1∑π∈Λntlrm(π)znn!=t∫z0G(t,u)du=t∫z0(secu+tanu)(secu)tdu=t∫z0(secu)t+1du+(secz)t−1.

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

 c(φ(π))=extr(π).
###### 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. ∎

From the above proposition and equation (3), it follows that the EGF for up-down permutations with respect to the number of extreme elements is

 ∑n≥1∑π∈Λntextr(π)znn!=∫z0(1−sinu)−tdu.

It also follows from Propositions 4.3 and 4.4 that the statistics and are equidistributed on up-down permutations.

## 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

 |{π∈Sn:lrm(π)=k}|=|{π∈Sn:c(π)=k}|=c(n,k).
###### Lemma 5.1.

For ,

 |{π∈Sn:mm(π)=k}|=c(n,k).
###### Proof.

We define a bijection that transforms the min-max sequence of a permutation into the sequence of left-to-right minima of . Given , let be the min-max sequence of . Starting with , for switch the entries of . Finally, if is the resulting permutation, let .

For example, if (the min-max 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

 |{π∈Sn:ms(π)=k}|=c(n,k).

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 ,

 |{π∈Sn:extr(π)=k}|=2kc(n−1,k).
###### Proof.

We give a bijection between the sets

 {(π,s):π∈Sn−1,lrm(π)=k,s∈{0,1}k}

and

 {σ∈Sn:extr(σ)=k}.

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 up-down cycles in , and let be the number of cycles of that are not up-down. Using equation (1) and the fact that the EGF for all cycles is

 ∑n≥1(n−1)!znn!=−ln(1−z),

we can derive the EGF for all permutations with respect to the number of up-down and non-up-down cycles:

 (6) ∑n≥0∑π∈Snvud(π)wnud(π)znn!=exp(−wln(1−z)+(v−w)∫z0E(u)du)=E′(z)v−w(1−z)w=1(1−z)w(1−sinz)v−w.

It is now straightforward to obtain an expression for the expected number of up-down cycles in a random permutation. Plugging into (6) we get

 (1−sinz)1−v1−z,

the EGF for permutations where marks the number of up-down cycles. Its derivative with respect to , evaluated at , is

 (7) −ln(1−sinz)1−z=(∑i≥1Ei−1zii!)(∑j≥0zj).

The expected number of up-down cycles in a random permutation of is now the coefficient of in (7), which equals

 (8) E01!+E12!+⋯+En−1n!.

This formula can also be obtained directly using the well-known 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 up-down is , since there are up-down cycles of length . Thus, the expected number of up-down cycles of length in a random permutation of is . Adding up for we obtain (8). For large , this number approaches

 −ln(1−sin1)=1.841817641….

Another consequence of equation (6) is a formula for the number of permutations of having no up-down cycles. The EGF for these permutations, obtained by setting and in (6), is

 1−sinz1−z=(1+∑i≥1(−1)iz2i−1(2i−1)!)(∑j≥0zj).

It follows that

 r2m−1(2m−1)!=r2m(2m)!=13!−15!+17!−⋯+(−1)m(2m−1)!.

The limiting value of this expression, which is the probability that a random permutation of length approaching infinity has no up-down 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