# On *k*-crossings and *k*-nestings of permutations

Sophie Burrill<fnref n="1" /> and Marni Mishna<fnref n="1" /> and Jacob Post<fnref n="2" />

**Abstract.** We introduce *k*-crossings and *k*-nestings of permutations. We show that the crossing number and the nesting number of permutations have a symmetric joint distribution. As a corollary, the number of *k*-noncrossing permutations is equal to the number of *k*-nonnesting permutations. We also provide some enumerative results for *k*-noncrossing permutations for some values of *k*.

**Résumé.** Nous introduisons les *k*-chevauchement d’arcs et les *k*-empilements d’arcs de permutations. Nous montrons que l’index de chevauchement et l’index de empilement ont une distribution conjointe symétrique pour les permutations de taille *n*. Comme corollaire, nous obtenons que le nombre de permutations n’ayant pas un *k*-chevauchement est égal au nombre de permutations n’ayant un *k*-empilement. Nous fournissons également quelques résultats énumératifs.

**Keywords:** crossing, nesting, permutation, enumeration

## 1 Introduction

Nestings and crossings are equidistributed in many combinatorial objects, such as matchings, set partitions, permutations, and large classes of embedded labelled graphs [2, 3, 5]. More surprising is the symmetric joint distribution of the crossing and nesting numbers: A set of *k* arcs forms a *k*-crossing (respectively nesting) if each of the $\binom{k}{2}$ pairs of arcs cross (resp. nest). The *crossing number* of an object is the largest *k* for which there is a *k*-crossing, and the *nesting number* is defined similarly. Chen *et al.* [2] proved the symmetric joint distribution of the nesting and crossing numbers for set partitions and matchings. Although they describe explicit involutions, they do not use simple local operations on the partitions. Recently, de Mier [5] interpreted the work of Krattenthaler [6] to show that *k*-crossings and *k*-nestings satisfy a similar distribution in embedded labelled graphs.

A hole in this family of results is the extension of the notions of *k*-crossings and *k*-nestings to permutations. This note fills this gap. We also give exact enumerative formulas for permutations of size *n* with crossing numbers 1 (non-crossing) and $\lfloor n/2 \rfloor$.

<footnote n="1">¹Department of Mathematics, Simon Fraser University, Burnaby, Canada, V5A 1S6</footnote>

<footnote n="2">²Department of Computer Science, Simon Fraser University, Canada, V5A 1S6</footnote>
<figure><img src="image_1.png" /><figcaption>**Fig. 1:** An arc diagram representation for the permutation $\sigma = [95678321412110]$, and its decomposition into upper and lower arc diagrams $(A_{\sigma}^{+}, A_{\sigma}^{-})$. In this example, $cr(\sigma) = 4$, $ne(\sigma) = 3$, and the degree sequence is given by $D_{\sigma} = (1,0)(1,0)(1,0)(1,0)(1,1)(0,1)(0,1)(0,1)(0,1)(1,0)(1,1)(0,1)$.</figcaption></figure>

# 2 Introducing $k$-crossings and $k$-nestings of permutations

## 2.1 Crossings and nestings

The *arc annotated sequence* associated to the permutation $\sigma \in \mathfrak{S}_n$ is the directed graph on the vertex set $V(\sigma) = \{1, \dots, n\}$ with arc set $A(\sigma) = \{(a, \sigma(a)): 1 \le a \le n\}$, drawn in a particular way. It is also known as the standard representation, or simply, the arc diagram. It is embedded in the plane by drawing an increasing linear sequence of the vertices, with edges $(a, \sigma(a))$ satisfying $a \le \sigma(a)$ drawn above the vertices (the upper arcs), and the remaining lower arcs satisfying $a > \sigma(a)$ drawn below. We refer to this graph as $A_{\sigma}$; the subgraph induced by the upper arcs and $V(\sigma)$ is $A_{\sigma}^{+}$; and the subgraph induced by the lower arcs and $V(\sigma)$ is $A_{\sigma}^{-}$. Additionally, we reverse the orientation of the arcs in $A_{\sigma}^{-}$, and view it as a classic arc diagram above the horizon. Because of these rules, the direction of the arcs is determined, and hence we simplify our drawings by not showing arrows on the arcs.

These two subgraphs are arc diagrams in their own right: for example $A_{\sigma}^{-}$ represents a set partition, and $A_{\sigma}^{+}$ is a set partition with some additional loops.

Crossings and nestings are defined for permutations by considering the upper and lower arcs separately. A crossing is a pair of arcs $\{(a, \sigma(a)), (b, \sigma(b))\}$ satisfying either $a < b \le \sigma(a) < \sigma(b)$ (an upper crossing) or $\sigma(a) < \sigma(b) < a < b$ (a lower crossing). A nesting is a pair of arcs $(a, \sigma(a)) (b, \sigma(b))$ satisfying $a < b \le \sigma(b) < \sigma(a)$ (an upper nesting) or $\sigma(a) < \sigma(b) < b < a$ (a lower nesting).

There is a slight asymmetry to the treatment of upper and lower arcs in this definition which we shall see is inconsequential. However, the reader should recall that what is considered a crossing (resp. nesting) in the upper diagram is elsewhere called an *enhanced crossing* (resp. *enhanced nesting*).

Crossings and nestings were defined in this way by Corteel [3] because they represent better known permutation statistics. Corteel's Theorem 1 states that the number of top arcs in this representation of a permutation is equal to the number of weak excedances, the number of arcs on the bottom is the number of descents, each crossing is equivalent to an occurrence of the pattern $2-31$, and each nesting is an occurrence of the pattern $31-2$. Corteel's Proposition 4 states nestings and crossings occur in equal number across all permutations of length $n$.
## 2.2 k-nestings and k-crossings

To generalize Corteel's work we define k-crossings and k-nestings in the same spirit as set partitions and matchings. A k-crossing in a permutation and diagram $A_\sigma$ is a set of k arcs $\{(a_i, \sigma(a_i)) : 1 \le i \le k\}$ that satisfy either the relation $a_1 < a_2 < \dots < a_k \le \sigma(a_1) < \sigma(a_2) < \dots < \sigma(a_k)$ (upper k-crossing) or $\sigma(a_1) < \sigma(a_2) < \dots < \sigma(a_k) < a_1 < a_2 < \dots < a_k$ (lower k-crossing). Similarly, a k-nesting is a set of k arcs $\{(a_i, \sigma(a_i)) : 1 \le i \le n\}$ that satisfy either the relation $a_1 < a_2 < \dots < a_k \le \sigma(a_k) < \dots < \sigma(a_2) < \sigma(a_k)$ (upper k-nesting) or $\sigma(a_1) < \sigma(a_2) < \dots < \sigma(a_k) < a_k < \dots < a_2 < a_1$ (lower k-nesting).

The crossing number of a permutation $\sigma$, denoted by $cr(\sigma)$, is the size of the largest k such that $A_\sigma$ contains a k-crossing. In this case we also say $\sigma$ is $k+1$-noncrossing. Likewise, the nesting number of a permutation $ne(\sigma)$ is the size of the largest nesting in $A_\sigma$, and define $k+1$-noncrossing similarly. Occasionally we consider the top and lower diagrams in their own right as *graphs*, and then we use the definition of deMier [5], and hence distinguish separately the enhanced crossing number of the graph $A_\sigma^+$ denoted $cr^*(A_\sigma^+)$ from the permutation crossing number, and likewise for the enhanced nesting number $ne^*$. The number of permutations of $\mathfrak{S}_n$ with crossing number equal to $k$ is $C_n(k)$, and we likewise define $N_n(k)$ for nestings.

The degree sequence $D_g$ of a graph $g$ is the sequence of indegree and outdegrees of the vertices, when considered as a directed graph:

$$D_g = (D_g(i))_i = (\text{indegree}_g(i), \text{outdegree}_g(i))_{i=1}^n.$$

Some sources call these left-right degree sequences since in other arc diagrams the incoming arcs always come in on the left, and the outgoing arcs go out to the right. As a graph, the degree sequence of a permutation is trivial: $(1, 1)^n$, since a permutation is a map in which every point has a unique image, and a unique pre-image. To define a more useful entity, we define the degree sequence of a permutation to be the degree sequence of only the upper arc diagram: $D_\sigma \equiv D_{A_\sigma^+}$. The degree sequence defined by the lower arc diagram can be computed coordinate-wise directly from the upper by simple transformations given in Table 2.2, and we denote this sequence $\overline{D_\sigma}$. (The sums of the vertex degrees is not $(1,1)$ because the lower arcs have their orientation reversed, and hence the indegree, and the outdegree have switched) An example is in Figure 1. The vertices with degree $(0, 1)$ are called “openers” and those with degree $(1, 0)$ are “closers”.

The main theorem can now be stated.

**Theorem 1** Let $NC_n(i, j, D)$ be the number of permutations of $n$ with crossing number $i$, nesting number $j$, and left-right degree sequence specified by $D$. Then

$$NC_n(i, j, D) = NC_n(j, i, D). \qquad (1)$$

There is an explicit involution behind this enumerative result, and the proof is in Section 4.

## 2.3 Preliminary enumerative results

The number of permutations of $\mathfrak{S}_n$ with crossing number equal to $k$ is directly computable for small values of $n$ and $k$.

We immediately notice the first column of Table 2, the non-crossing permutations, are counted by Catalan numbers: $C_n(1) = \frac{1}{n+1} \binom{2n}{n}$. This has a simple explanation: non-crossing *partitions* have long
<table><caption>**Tab. 1:** The five vertex types that appear in permutations, and their associated upper degree value, and lower degree value.</caption><thead><tr><th>Type</th><th>vertex i</th><th>D<sub>σ</sub>(i)</th><th>D&#773;<sub>σ</sub>(i)</th></tr></thead><tbody><tr><td>opener</td><td>●</td><td>(1,0)</td><td>(1,0)</td></tr><tr><td>closer</td><td>●</td><td>(0,1)</td><td>(0,1)</td></tr><tr><td>loop</td><td>○</td><td>(1,1)</td><td>(0,0)</td></tr><tr><td>upper transient</td><td>●</td><td>(1,1)</td><td>(0,0)</td></tr><tr><td>lower transient</td><td>●</td><td>(0,0)</td><td>(1,1)</td></tr></tbody></table>

<table><caption>**Tab. 2:** $C_n(k)$: The number of permutations of $S_n$ with crossing number k. A crossing number of 1 is equivalent to non-crossing.</caption><thead><tr><th>n\k</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr></thead><tbody><tr><td>1</td><td>1</td><td></td><td></td><td></td><td></td></tr><tr><td>2</td><td>2</td><td></td><td></td><td></td><td></td></tr><tr><td>3</td><td>5</td><td>1</td><td></td><td></td><td></td></tr><tr><td>4</td><td>14</td><td>10</td><td></td><td></td><td></td></tr><tr><td>5</td><td>42</td><td>76</td><td>2</td><td></td><td></td></tr><tr><td>6</td><td>132</td><td>543</td><td>45</td><td></td><td></td></tr><tr><td>7</td><td>429</td><td>3904</td><td>701</td><td>6</td><td></td></tr><tr><td>8</td><td>1430</td><td>29034</td><td>9623</td><td>233</td><td></td></tr><tr><td>9</td><td>4862</td><td>225753</td><td>126327</td><td>5914</td><td>24</td></tr></tbody></table>

been known to be counted by Catalan numbers and there is a simple bijection between non-crossing permutations and non-crossing partitions. Essentially, to go from a non-crossing permutation to a non-crossing partition, flip the arc diagram upside down, convert the loops to fixed points, and then remove the lower arcs. This defines a unique set partition, and is easy to reverse. This bijection is easy to formalize, but it is not the main topic of this note.
## 3 Enumeration of maximum nestings and crossings

To get a sense of how Theorem 1 is proved, and to obtain some new enumerative results, we consider the set of maximum nestings and crossings. A maximum nesting is the largest possible: a ⌈n/2⌋-nesting is maximum in a permutation on n elements. We can compute $N_n(\lceil n/2 \rceil)$ explicitly.

**Theorem 2** The number of permutations with a maximum nesting satisfies the following formula:

$$N_n(\lceil n/2 \rceil) = \begin{cases} m! & n = 2m + 1 \\ 2(m+1)! - (m-1)! - 1 & n = 2m \end{cases}. \qquad (2)$$

**Proof:** We divide the result into a few cases, but each one is resolved the same way: For each permutation $\sigma \in \mathfrak{S}_n$ with a maximum nesting, the ⌈n/2⌋-nesting comes from either $A_\sigma^+$ or $A_\sigma^-$, and in most cases defines that subgraph. Once one side is fixed, and there is a given degree sequence, it is straightforward to compute the number of ways to place the remaining arcs. Some cases are over counted, and tallying these gives the final result.

**Odd n:** $n = 2m + 1$ To achieve an $m + 1$-nesting, it must be an enhanced nesting in the upper arc diagram, and it uses all vertices, including a loop: $\sigma(i) = n - i + 1 : 1 \le i \le m$. It remains to define $\sigma(i)$ for $m < i \le n$. The lower degree sequence is fixed, and so $1 \le \sigma(i) < m$ for each $i$, but other than that there is no restriction. Thus, there are $m!$ possibilities.

**Even n:** $n = 2m$ The even case is slightly more complicated, owing to the fact that three different ways to achieve an $m$-nesting:

1. **An $m$-nesting in $A_\sigma^+$** These permutations satisfy $\sigma(i) = n - i, 1 \le i \le m$. As before, there are $m!$ ways to define $\sigma(i)$, $m < i \le n$.

2. **An $m$-nesting in $A_\sigma^-$** These permutations satisfy $\sigma(n - i) = i, 1 \le i \le m$. Again, there are $m!$ possibilities to define $\sigma(i)$, $1 < i \le m$. Only the involution $[nn - 1 \dots 21]$ is in the intersection of these sets.

3. **An enhanced $m$-nesting in $A_\sigma^+$** If the $m$-nesting uses only $2m - 1$ vertices, there is one left over. It must either be a lower transient vertex, or a loop since there is nothing left to connect to it. We count these by considering the different ways to construct it from a smaller permutation diagram. Suppose we have a permutation with an $m$-nesting on $2m - 1$ vertices. By the first part, we know there are $(m - 1)!$ of these. We place it on $2m$ points, by first selecting our special vertex $i$, and placing the permutation on the rest. There are $2m$ ways to pick this special vertex. Finally, we create the new permutation $\sigma$ by connecting the new vertex to the rest of the structure. We choose a point $j$ to be the value $\sigma(i)$. We can choose $i$ and thus $i$ is a loop. Otherwise, $j$ must be before the loop in $\sigma'$. We then set $\sigma^{-1}(i)$ to be $\sigma'^{-1}(j)$. There are $m$ choices for $\sigma(i)$.

**Over counting** we have counted twice the family of diagrams with two loops in the center. There are $(m - 1)!$ of these.

Putting all of the pieces together, and simplifying the expression we get the formula:

$$N_{2m}(m) = 2(m + 1)! - (m - 1)! - 1.$$
<figure><img src="image_2.png" /></figure>

This proof suggests a direct involution on the permutation which switches a maximum nesting for a maximum crossing, since the degree sequence of a nesting and a crossing have the same shape. Thus the formula for maximum crossings is the same. However, in certain diagrams, this involution sends a $k$-crossing to a $k + 1$-nesting, and so it can not be used to prove equidistribution for general $k$.

## 3.1 Other enumerative questions

From the formula, we see that a very small proportion of permutations have maximum crossings, ($\le 2\frac{n+1}{2}/n!$) or are non-crossing $\approx 4^n n^{-3/2}/n!$. What can be said of the nature of the distribution, or the even simply the average crossing number? What is the nature of the generating function $P(z; u)$ where $u$ marks the crossing number, or even simply the generating function for $k$-noncrossing permutations? Bousquet-Mélou and Xin [1] consider this question for partitions: 2-noncrossing partitions are counted by Catalan numbers, (as we mentioned before), and thus the generating function is algebraic; the counting sequence for 3-noncrossing partitions is P-recursive, and so the generating function is D-finite, and they conjecture that the generating function for $k$-noncrossing partitions, $k > 3$ are likely not D-finite. How can these results be adapted to permutations, given the similar structure?

# 4 Proof of Theorem 1

We restate and prove our main theorem. The proof first decomposes a permutation into its upper and lower arc diagrams and then applies the results for graphs separately to each part.

**Theorem 1** Let $NC_n(i, j, D)$ be the number of permutations of $n$ with crossing number $i$, nesting number $j$, and left-right degree sequence specified by $D$. Then

$$NC_n(i, j, D) = NC_n(j, i, D).$$

**Proof:** We consider the top and the bottom in turn, and to each apply the consequence of Chen et al., that the pair $(cr(g), ne(g))$) is symmetrically distributed across all arc diagrams $g$ on $n$ vertices with degree sequence a fixed element of $\{(0, 0), (0, 1), (1, 0), (1, 1)\}^n$, which is the case for our graphs here. Furthermore, we apply their degree preserving involution $\Psi: \mathfrak{S}_n \to \mathfrak{S}_n$ which swaps nesting and crossing number. That is, $D_\sigma = D_{\Psi(\sigma)}$, and $ne(\sigma) = cr(\Psi(\sigma))$, $cr(\sigma) = ne(\Psi(\sigma))$.

This consequence can also be seen as an example of de Miers' Theorem 3.3 [5]. Vertices with maximum left or right degree at most one avoid multiple edges, as is the case with our graphs, and hence the result applies. Furthermore, her interpretation of graphs as fillings of growth diagrams apply.

In order to apply the above results, the first step is to re-write $A_\sigma^+$ so that we only consider proper crossings and nestings instead of enhanced crossing and nestings. This is a common trick, known as inflation. Essentially, we create the graph $g$ from $A_\sigma^+$ by adding some supplementary vertices to eliminate loops and transitory vertices:
<figure><img src="image_3.png" /></figure>

Now each nesting and crossing is proper, and by [5, Lemma 3.4] $ne^*(A_\sigma^+) = ne(g)$ and $cr^*(A_\sigma^+) = cr(g)$.

Let $\Psi$ be the map on embedded labelled graphs described implicitly in de Mier's proof. Because $\Psi$ is a left-right degree preserving map, we can identify the supplementary vertices in $\Psi(q)$ to get a graph with the correct kind of vertices. Call this new graph $g'$. We now extend the definition of $\Psi$ to $A_\sigma^+$ by $\Psi(A_\sigma^+) = g'$.

Consider the pair of graphs $(\Psi(A_\sigma^+), \Psi(A_\sigma^-))$.

Proving our main theorem now reduces to showing that there is a unique $\tau \in \mathfrak{S}_n$ such that $A_\tau = (\Psi(A_\tau^+), \Psi(A_\tau^-))$, which we do next. For every vertex in $A_\tau$ the indegree and outdegree are equal to one. This is because the left-right degree sequence of both the top and the bottom are preserved in the map, and hence the vector sum of their degree sequence is unchanged, i.e. $(1, 1)^n$, and has all the correct partial sum properties. The map is a bijection and so $\tau$ is unique.

This map swaps the upper nesting and the upper crossing number, and also the lower nesting and the lower crossing number. Thus $cr(\tau) = \max\{cr^*(A_\tau^+), cr(A_\tau^-)\} = \max\{ne^*(A_\sigma^+), ne(A_\sigma^-)\} = ne(\sigma)$. Thus, the crossing and the nesting number are switched under the map $\Psi$. $\square$

Figure 2 illustrates our involution on an example. Remark that the degree sequence is fixed.

<figure><img src="image_4.png" /><figcaption>Fig. 2: The permutation $\sigma$ and its image in the involution $\Psi(\sigma)$. Note that $ne(\Psi(\sigma)) = 4$, $cr(\Psi(\sigma)) = 3$.</figcaption></figure>

## 4.1 Equidistribution in permutation subclasses

Involutions are in bijection with partial matchings, and have thus been previously considered. What of other subclasses of permutations? The map presented here does not fix involutions, because loops are mapped to upper transient vertices, but it does fix any class that is closed under degree sequence, for example, permutations with no lower transitory vertices, or permutations with no upper transitory vertices nor loops. These conditions have interpretations in terms of other permutation statistics, if we consider the initial motivations of Corteel.
# 5 Conclusions and open questions

The main open question, aside from the enumerative, and probabilistic questions we have already raised, is to find a direct permutation description of our involution, i.e. a description avoiding the passage through tableaux or fillings of Ferrers diagrams. Is this involution already part of the vast canon of permutation automorphisms? de Mier's original involution for graphs [4] applies in our situation, and is apparently a different map. How does it compare?

Which subclasses of permutations preserve the symmetric distribution? From our example, we remark that cycle type is not neccesarily conserved (since loops are always mapped to upper transitory vertices), but non-intersecting intervals are preserved. Involution permutations are in bijection with partial matchings, and so this subclass has this property.

Is there an interpretation of crossing and nesting numbers in terms of other permutations statistics? Which other statistics does this involution preserve?

Ultimately we have considered a type of graph with two edge colours and strict degree restrictions. Can this be generalized to a larger class of graphs with fewer degree restrictions? What of a generalization of graphs with multiple edge colours?

# Acknowledgements

The authors thank Cedric Chauve, Lily Yen, Sylvie Corteel, Anna de Mier and Eric Fusy for useful discussions. SB and MM are both funded by NSERC (Canada), and MM did part of this work as part of a CNRS Poste Rouge (France).

# References

[1] M. Bousquet-Mélou and G. Xin. On partitions avoiding 3-crossings. *Sém. Lothar. Combin.*, 54:Art. B54e, 21 pp. (electronic), 2005/07.

[2] William Y. C. Chen, Eva Y. P. Deng, Rosena R. X. Du, Richard P. Stanley, and Catherine H. Yan. Crossings and nestings of matchings and partitions. *Trans. Amer. Math. Soc.*, 359(4):1555–1575 (electronic), 2007.

[3] Sylvie Corteel. Crossings and alignments of permutations. *Adv. in Appl. Math.*, 38(2):149–163, 2007.

[4] Anna de Mier. On the symmetry of the distribution of *k*-crossings and *k*-nestings in graphs. *Electron. J. Combin.*, 13(1):Note 21, 6 pp. (electronic), 2006.

[5] Anna de Mier. *k*-noncrossing and *k*-nonnesting graphs and fillings of Ferrers diagrams. *Combinator-ica*, 27(6):699–720, 2007.

[6] C. Krattenthaler. Growth diagrams, and increasing and decreasing chains in fillings of Ferrers shapes. *Adv. in Appl. Math.*, 37(3):404–431, 2006.