In this thesis, we apply the stack sorting operator to $r$-permutations and construct the functional equation for the generating function of two-stack-sortable $k$-tuple $r$-permutations counted by descents by using a factorization similar to Zeilberger's. We solve the functional equation and give explicit formulas for the number of two-stack-sortable $r$-permutations.
We characterise and enumerate permutations that are sortable by n-4 passes through a stack. We conjecture the number of permutations sortable by n-5 passes, and also the form of a formula for the general case n-k, which involves a polynomial expression.
We use stack words to find a new, simple proof for the best known upper bound for the number of 3-stack sortable permutations of a given length. This is the first time that stack words are used to obtain such a result.
Using earlier results we prove a formula for the number $W_{(n,k)}$ of 2-stack sortable permutations of length $n$ with $k$ runs, or in other words, $k-1$ descents. This formula will yield the suprising fact that there are as many 2-stack sortable permutations with $k-1$ descents as with $k-1$ ascents. We also prove that $W_{(n,k)}$ is unimodal in $k$, for any fixed $n$.
We describe a new method for finding patterns in permutations that produce a given pattern after the permutation has been passed once through a stack. We use this method to describe West-3-stack-sortable permutations, that is, permutations that are sorted by three passes through a stack. We also show how the method can be applied to the bubble-sort operator. The method requires the use of mesh patterns introduced by Brändén and Claesson (2011), as well as a new type of generalized pattern we call a decorated pattern.
In 2017, Duchi, Guerrini, Rinaldi and Schaeffer proposed a new family of combinatorial objects called "fighting fish", which are counted by the same formula as more classical objects, such as two-stack sortable permutations and non-separable planar maps. In this article, we explore the bijective aspect of fighting fish by establishing a bijection to two-stack sortable permutations, using a new recursive decomposition of these permutations. With our bijection, we give combinatorial explanations of several results on fighting fish proved previously with generating functions. Using the decomposit…
A permutation is so-called two stack sortable if it (i) avoids the (scattered) pattern 2-3-4-1, and (ii) contains a 3-2-4-1 pattern only as part of a 3-5-2-4-1 pattern. Here we show that the permutations on [n] satisfying condition (ii) alone are equinumerous with the permutations on [n] that avoid the mixed scattered/consecutive pattern 31-4-2. The proof uses a known bijection from 3-2-1-avoiding to 3-1-2-avoiding permutations.
Bóna conjectured that the descent polynomials on $(n-2)$-stack sortable permutations have only real zeros. Brändén proved this conjecture by establishing a more general result. In this paper, we give another proof of Brändén's result by using the theory of $s$-Eulerian polynomials recently developed by Savage and Visontai.
In 1990 West conjectured that there are $2(3n)!/((n+1)!(2n+1)!)$ two-stack sortable permutations on $n$ letters. This conjecture was proved analytically by Zeilberger in 1992. Later, Dulucq, Gire, and Guibert gave a combinatorial proof of this conjecture. In the present paper we study generating functions for the number of two-stack sortable permutations on $n$ letters avoiding (or containing exactly once) 132 and avoiding (or containing exactly once) an arbitrary permutation $τ$ on $k$ letters. In several interesting cases this generating function can be expressed in terms of the generating f…
We consider permutations sortable by $k$ passes through a deterministic pop stack. We show that for any $k\in\mathbb N$ the set is characterised by finitely many patterns, answering a question of Claesson and Guðmundsson. Our characterisation demands a more precise definition than in previous literature of what it means for a permutation to avoid a set of barred and unbarred patterns. We propose a new notion called \emph{$2$-avoidance}.
Motivated by the work of Chung, Claesson, Dukes, and Graham, we define a natural type B analog of the classic bubble sort, and use it to define a type B analog of the maximum drop statistic. We enumerate (by explicit, recursive, and generating function formulas) signed permutations with r type B descents and type B maximum drop at most k. We also find a connection between these signed permutations and certain 2-colored juggling sequences.
Recently Albert and Bousquet-Mélou obtained the solution to the long-standing problem of the enumeration of permutations sortable by two stacks in parallel (2sip). Their solution was expressed in terms of functional equations. E.P. and Guttmann then showed that the equally long-standing problem of the number of permutations sortable by a double ended queue (deque) can be simply related to the solution of the same functional equations. They then conjectured that the radius of convergence of both generating functions is the same, and reduced this conjecture to a series of conjectures of Albert a…
We consider the number of passes a permutation needs to take through a stack if we only pop the appropriate output values and start over with the remaining entries in their original order. We define a permutation $π$ to be $k$-pass sortable if $π$ is sortable using $k$ passes through the stack. Permutations that are $1$-pass sortable are simply the stack sortable permutations as defined by Knuth. We define the permutation class of $2$-pass sortable permutations in terms of their basis. We also show all $k$-pass sortable classes have finite bases by giving bounds on the length of a basis elemen…
In this paper we examine the sorting operator $T(LnR)=T(R)T(L)n$. Applying this operator to a permutation is equivalent to passing the permutation reversed through a stack. We prove theorems that characterise $t$-revstack sortability in terms of patterns in a permutation that we call $zigzag$ patterns. Using these theorems we characterise those permutations of length $n$ which are sorted by $t$ applications of $T$ for $t=0,1,2,n-3,n-2,n-1$. We derive expressions for the descent polynomials of these six classes of permutations and use this information to prove Steingrímsson's sorting conjecture…
In an exercise in the first volume of his famous series of books, Knuth considered sorting permutations by passing them through a stack. Many variations of this exercise have since been considered, including allowing multiple passes through the stack and using different data structures. We are concerned with a variation using pop-stacks that was introduced by Avis and Newborn in 1981. Let $P_k(x)$ be the generating function for the permutations sortable by $k$ passes through a pop-stack. The generating function $P_2(x)$ was recently given by Pudwell and Smith (the case $k=1$ being trivial). We…
The problem of determining which permutations can be sorted using certain switchyard networks dates back to Knuth in 1968. In this work, we are interested in permutations which are sortable on a double-ended queue (called a deque), or on two parallel stacks. In 1982, Rosenstiehl and Tarjan presented an O(n) algorithm for testing whether a given permutation was sortable on parallel stacks. In the same paper, they also presented a modification giving O(n) test for sortability on a deque. We demonstrate a slight error in the version of their algorithm for testing deque sortability, and present a …
We prove a "decomposition lemma" that allows us to count preimages of certain sets of permutations under West's stack-sorting map $s$. As a first application, we give a new proof of Zeilberger's formula for the number of 2-stack-sortable permutations in $S_n$. Our proof generalizes, allowing us to find an algebraic equation satisfied by the generating function that counts 2-stack-sortable permutations according to length, number of descents, and number of peaks. The same method yields a recurrence relation for $W_3(n)$, the number of 3-stack-sortable permutations in $S_n$. We compute $W_3(n)$ …
Recently Albert and Bousquet-Mélou \cite{AB15} obtained the solution to the long-standing problem of the number of permutations sortable by two stacks in parallel (tsip). Their solution was expressed in terms of functional equations. We show that the equally long-standing problem of the number of permutations sortable by a double-ended queue (deque) can be simply related to the solution of the same functional equations. Subject to plausible, but unproved, conditions, the radius of convergence of both generating functions is the same. Numerical work confirms this conjecture to 10 significant di…
We derive a simple functional equation with two catalytic variables characterising the generating function of 3-stack-sortable permutations. Using this functional equation, we extend the 174-term series to 1000 terms. From this series, we conjecture that the generating function behaves as $$W(t) \sim C_0(1-μ_3 t)^α\cdot \log^β(1-μ_3 t), $$ so that $$[t^n]W(t)=w_n \sim \frac{c_0μ_3^n}{ n^{(α+1)}\cdot \log^λ{n}} ,$$ where $μ_3 = 9.69963634535(30),$ $α= 2.0 \pm 0.25.$ If $α= 2$ exactly, then $λ= -β+1$, and we estimate $β\approx -3.$ If $α$ is not an integer, then $λ=-β$, but we cannot give a usef…
We address the problem of the number of permutations that can be sorted by two stacks in series. We do this by first counting all such permutations of length less than 20 exactly, then using a numerical technique to obtain nineteen further coefficients approximately. Analysing these coefficients by a variety of methods we conclude that the OGF behaves as $$S(z) \sim A (1 - μ\cdot z)^γ,$$ where $μ=12.45 \pm 0.15,$ $γ= 1.5 \pm 0.3,$ and $A \approx 0.02$.
Pattern avoiding machines were introduced recently by Claesson, Cerbai and Ferrari as a particular case of the two-stacks in series sorting device. They consist of two restricted stacks in series, ruled by a right-greedy procedure and the stacks avoid some specified patterns. Some of the obtained results have been further generalized to Cayley permutations by Cerbai, specialized to particular patterns by Defant and Zheng, or considered in the context of functions over the symmetric group by Berlow. In this work we study pattern avoiding machines where the first stack avoids a pair of patterns …
Pattern avoiding machines were recently introduced by Claesson, Ferrari and the current author to gain a better understanding of the classical $2$-stacksort problem. In this paper we generalize these devices by allowing permutations with repeated elements, also known as Cayley permutations. The main result is a description of those patterns such that the corresponding set of sortable permutations is a class. We also show a new involution on the set of Cayley permutations, obtained by regarding a pattern-avoiding stack as an operator. Finally, we analyze two generalizations of pop-stack sorting…
Prior studies of the efficiency of the block interchange (swap) and the reversal sorting operations on (signed) permutations identified specialized versions of the these operations. These specialized operations are here called context directed reversal, abbreviated cdr, and context directed swap, abbreviated cds. Prior works have also characterized which (signed) permutations are sortable by cdr or by cds. It is now known that when a permutation is cds sortable in n steps, then any application of n consecutive applicable cds operations will sort it. Examples show that this is not the case for …
We use a method for determining the number of preimages of any permutation under the stack-sorting map in order to obtain recursive upper bounds for the numbers $W_t(n)$ and $W_t(n,k)$ of $t$-stack sortable permutations of length $n$ and $t$-stack sortable permutations of length $n$ with exactly $k$ descents. From these bounds, we are able to significantly improve the best known upper bounds for $\displaystyle{\lim_{n\to\infty}\sqrt[n]{W_t(n)}}$ when $t=3$ and $t=4$.
Pancake flipping, a famous open problem in computer science, can be formalised as the problem of sorting a permutation of positive integers using as few prefix reversals as possible. In that context, a prefix reversal of length k reverses the order of the first k elements of the permutation. The burnt variant of pancake flipping involves permutations of signed integers, and reversals in that case not only reverse the order of elements but also invert their signs. Although three decades have now passed since the first works on these problems, neither their computational complexity nor the maxim…
We consider a stack sorting algorithm where only the appropriate output values are popped from the stack and then any remaining entries in the stack are run through the stack in reverse order. We identify the basis for the $2$-reverse pass sortable permutations and give computational results for some classes with larger maximal rev-tier. We also show all classes of $(t+1)$-reverse pass sortable permutations are finitely based. Additionally, a new Entringer family consisting of maximal rev-tier permutations of length $n$ was discovered along with a bijection between this family and the collecti…
In this article, we give a polynomial algorithm to decide whether a given permutation $σ$ is sortable with two stacks in series. This is indeed a longstanding open problem which was first introduced by Knuth. He introduced the stack sorting problem as well as permutation patterns which arises naturally when characterizing permutations that can be sorted with one stack. When several stacks in series are considered, few results are known. There are two main different problems. The first one is the complexity of deciding if a permutation is sortable or not, the second one being the characterizati…
We introduce an algorithm to determine when a sorting operation, such as stack-sort or bubble-sort, outputs a given pattern. The algorithm provides a new proof of the description of West-2-stack-sortable permutations, that is permutations that are completely sorted when passed twice through a stack, in terms of patterns. We also solve the long-standing problem of describing West-3-stack-sortable permutations. This requires a new type of generalized permutation pattern we call a decorated pattern.
We study a sorting machine consisting of two stacks in series where the first stack has the added restriction such that entries in the stack must be in decreasing order from top to bottom. We give the basis of the class of permutations that are sortable by this machine which shows that it is enumerated by the Schröder numbers.
There exists a bijection between one stack sortable permutations --permutations which avoid the pattern 231-- and planar trees. We define an edit distance between permutations which is coherent with the standard edit distance between trees. This one-to-one correspondence yields a polynomial algorithm for the subpermutation problem for $(231)$ avoiding permutations. Moreover, we obtain the generating function of the edit distance between ordered trees and some special ones. For the general case we show that the mean edit distance between a planar tree and all other planar trees is at least $n/l…
We consider the set of permutations that are sorted after two passes through a pop stack. We characterize these permutations in terms of forbidden patterns (classical and barred) and enumerate them according to the ascent statistic. Then we show these permutations to be in bijection with a special family of polyominoes. As a consequence, the permutations sortable by this machine are shown to have the same enumeration as three classical permutation classes.
Motivated by the pop-stack-sorting map on the symmetric groups, Defant defined an operator $\mathsf{Pop}_M : M \to M$ for each complete meet-semilattice $M$ by $$\mathsf{Pop}_M(x)=\bigwedge(\{y\in M: y\lessdot x\}\cup \{x\}).$$ This paper concerns the dynamics of $\mathsf{Pop}_{\mathrm{Tam}_n}$, where $\mathrm{Tam}_n$ is the $n$-th Tamari lattice. We say an element $x\in \mathrm{Tam}_n$ is $t$-$\mathsf{Pop}$-sortable if $\mathsf{Pop}_M^t (x)$ is the minimal element and we let $h_t(n)$ denote the number of $t$-$\mathsf{Pop}$-sortable elements in $\mathrm{Tam}_n$. We find an explicit formula for…
We present an algorithm, called BiSC, that describes the patterns avoided by a given set of permutations. It automatically conjectures the statements of known theorems such as the descriptions of stack-sortable (Knuth 1975) and West-2-stack-sortable permutations (West 1990), smooth (Lakshmibai and Sandhya 1990) and forest-like permutations (Bousquet-Melou and Butler 2007), and simsun permutations (Branden and Claesson 2011). The algorithm has also been used to discover new theorems and conjectures related to Young tableaux, Wilf-equivalences and sorting devices. We further give algorithms to p…
We show that the left-greedy algorithm is a better algorithm than the right-greedy algorithm for sorting permutations using t stacks in series when t>1. We also supply a method for constructing some permutations that can be sorted by t stacks in series and from this get a lower bound on the number of permutations of length n that are sortable by t stacks in series. Finally we show that the left-greedy algorithm is neither optimal nor defines a closed class of permutations for t>2.
The (classical) problem of characterizing and enumerating permutations that can be sorted using two stacks connected in series is still largely open. In the present paper we address a related problem, in which we impose restrictions both on the procedure and on the stacks. More precisely, we consider a greedy algorithm where we perform the rightmost legal operation (here "rightmost" refers to the usual representation of stack sorting problems). Moreover, the first stack is required to be $σ$-avoiding, for some permutation $σ$, meaning that, at each step, the elements maintained in the stack av…
We prove that the set of permutations generated by a stack of depth two and an infinite stack in series has a basis (defining set of forbidden patterns) consisting of 20 permutations of length 5, 6, 7 and 8. We prove this via a ``canonical'' generating algorithm.
Pop-stacks are variants of stacks that were introduced by Avis and Newborn in 1981. Coincidentally, a 1982 result of Unger implies that every permutation of length n can be sorted by n-1 passes through a deterministic pop-stack. We give a new proof of this result inspired by Knuth's zero-one principle.
We prove that the set of permutations sorted by a stack of depth $t \geq 3$ and an infinite stack in series has infinite basis, by constructing an infinite antichain. This answers an open question on identifying the point at which, in a sorting process with two stacks in series, the basis changes from finite to infinite.
The subject of pattern avoiding permutations has its roots in computer science, namely in the problem of sorting a permutation through a stack. A formula for the number of permutations of length n that can be sorted by passing it twice through a stack (where the letters on the stack have to be in increasing order) was conjectured by West, and later proved by Zeilberger. Goulden and West found a bijection from such permutations to nonseparable planar maps, and later, Jacquard and Schaeffer presented a bijection from these planar maps to certain labeled plane trees, called beta(1,0)-trees. Using…
We prove that the class of permutations generated by passing an ordered sequence $12\dots n$ through a stack of depth 2 and an infinite stack in series is in bijection with an unambiguous context-free language, where a permutation of length $n$ is encoded by a string of length $3n$. It follows that the sequence counting the number of permutations of each length has an algebraic generating function. We use the explicit context-free language to compute the generating function: \begin{align*} \sum_{n\geq 0} c_n t^n &= \frac{(1+q)\left(1+5q-q^2-q^3-(1-q)\sqrt{(1-q^2)(1-4q-q^2)}\right)}{8q} \end{al…
We extend and generalize many of the enumerative results concerning West's stack-sorting map $s$. First, we prove a useful theorem that allows one to efficiently compute $|s^{-1}(π)|$ for any permutation $π$, answering a question of Bousquet-Mélou. We then enumerate permutations in various sets of the form $s^{-1}(\text{Av}(τ^{(1)},\ldots,τ^{(r)}))$, where $\text{Av}(τ^{(1)},\ldots,τ^{(r)})$ is the set of permutations avoiding the patterns $τ^{(1)},\ldots,τ^{(r)}$. These preimage sets often turn out to be permutation classes themselves, so the current paper represents a new approach, based on …
We study permutations that are sorted by operators of the form $\mathbf{S} \circ α\circ \mathbf{S}$, where $\mathbf{S}$ is the usual stack sorting operator introduced by D. Knuth and $α$ is any $D_8$-symmetry obtained combining the classical reverse, complement and inverse operations. Such permutations can be characterized by excluded (generalized) patterns. Some conjectures about the enumeration of these permutations, refined with numerous classical statistics, have been proposed by A. Claesson, M. Dukes and E. Steingrímsson. We prove these conjectures, and enrich one of them with a few more …
In this work of thesis we introduce and study a new family of sorting devices, which we call pattern-avoiding machines. They consist of two stacks in series, equipped with a greedy procedure. On both stacks we impose a static constraint in terms of pattern containment: reading the content from top to bottom, the first stack is not allowed to contain occurrences of a given pattern $σ$, whereas the second one is not allowed to contain occurrences of $21$. By analyzing the behavior of pattern-avoiding machines, we aim to gain a better understanding of the problem of sorting permutations with two …
We consider two orthogonal points of view on finite permutations, seen as pairs of linear orders (corresponding to the usual one line representation of permutations as words) or seen as bijections (corresponding to the algebraic point of view). For each of them, we define a corresponding first-order logical theory, that we call $\mathsf{TOTO}$ (Theory Of Two Orders) and $\mathsf{TOOB}$ (Theory Of One Bijection) respectively. We consider various expressibility questions in these theories. Our main results go in three different direction. First, we prove that, for all $k \ge 1$, the set of $k$-s…
We introduce a sorting machine consisting of $k+1$ stacks in series: the first $k$ stacks can only contain elements in decreasing order from top to bottom, while the last one has the opposite restriction. This device generalizes \cite{SM}, which studies the case $k=1$. Here we show that, for $k=2$, the set of sortable permutations is a class with infinite basis, by explicitly finding an antichain of minimal nonsortable permutations. This construction can easily be adapted to each $k \ge 3$. Next we describe an optimal sorting algorithm, again for the case $k=2$. We then analyze two types of le…