Let $s$ denote West's stack-sorting map. For all positive integers $m$ and all integers $n\geq 2m-2$, we give a simple characterization of the set $s^{n-m}(S_n)$; as a consequence, we find that $|s^{n-m}(S_n)|$ is the $m^\text{th}$ Bell number $B_m$. We also prove that the restriction $n\geq 2m-2$ is tight by showing that $|s^{m-3}(S_{2m-3})|=B_m+m-2$ for all $m\geq 3$.
Let $s$ denote West's stack-sorting map. A permutation is called $t-\textit{sorted}$ if it is of the form $s^t(μ)$ for some permutation $μ$. We prove that the maximum number of descents that a $t$-sorted permutation of length $n$ can have is $\left\lfloor\frac{n-t}{2}\right\rfloor$. When $n$ and $t$ have the same parity and $t\geq 2$, we give a simple characterization of those $t$-sorted permutations in $S_n$ that attain this maximum. In particular, the number of such permutations is $(n-t-1)!!$.
For each positive integer $k$, we consider five well-studied posets defined on the set of Dyck paths of semilength $k$. We prove that uniquely sorted permutations avoiding various patterns are equinumerous with intervals in these posets. While most of our proofs are bijective, some use generating trees and generating functions. We end with several conjectures.
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.
In this paper, we study merging-free partitions with their canonical forms and run-sorted permutations. We give a combinatorial proof of the conjecture made by Nabawanda et al. We describe the distribution of the statistics of runs and right-to-left minima over the set of run-sorted permutations and we give the exponential generating function for their joint distribution. We show the number of right-to-left minima is given by the shifted distribution of the Stirling number of the second kind. We also prove that the non-crossing merging-free partitions are enumerated by powers of 2. We use one …
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 …
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.
Associate to each sequence $A$ of integers (intending to represent packet IDs) a sequence of positive integers of the same length ${\mathcal M}(A)$. The $i$'th entry of ${\mathcal M}(A)$ is the size (at time $i$) of the smallest buffer needed to hold out-of-order packets, where space is accounted for unreceived packets as well. Call two sequences $A$, $B$ {\em equivalent} (written $A\equiv_{FB} B$) if ${\mathcal M}(A)={\mathcal M}(B)$. We prove the following result: any two permutations $A,B$ of the same length with $SUS(A)$, $SUS(B)\leq 3$ (where SUS is the {\em shuffled-up-sequences} reorder…
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.
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.
We study a sorting procedure (run-sorting) on permutations, where runs are rearranged in lexicographic order. We describe a rather surprising bijection on permutations on length $n$, with the property that it sends the set of peak-values to the set of peak-values after run-sorting. We also prove that the expected number of descents in a permutation $σ\in S_{n}$ after run-sorting is equal to $(n-2)/3$. Moreover, we provide a closed form of the exponential generating function introduced by Nabawanda, Rakotondrajao and Bamunoba in 2020, for the number of run-sorted permutations of $[n]$, ($RSP(n)…
We answer a question of R. J. Mathar and confirm that the counting sequence for $\bar{2}413\bar{5}$-avoiding permutations is the Invert transform of the Bell numbers. The proof relies on a simple decomposition of these permutations and the known fact that $\bar{2}413$-avoiding permutations are counted by the Bell numbers.
We study sorting operators $\mathbf{A}$ on permutations that are obtained composing Knuth's stack sorting operator $\mathbf{S}$ and the reversal operator $\mathbf{R}$, as many times as desired. For any such operator $\mathbf{A}$, we provide a size-preserving bijection between the set of permutations sorted by $\mathbf{S} \circ \mathbf{A}$ and the set of those sorted by $\mathbf{S} \circ \mathbf{R} \circ \mathbf{A}$, proving that these sets are enumerated by the same sequence, but also that many classical permutation statistics are equidistributed across these two sets. The description of this …
In this paper, we study classes of subexcedant functions enumerated by the Bell numbers and present bijections on set partitions. We present a set of permutations whose transposition arrays are the restricted growth functions, thus defining Bell permutations of the second kind. We describe a bijection between Bell permutations of the first kind (introduced by Ponti and Vajnovzski) and the second kind. We present two other Bell number enumerated classes of subexcedant functions. Further, we present bijections on set partitions, in particular, an involution that interchanges the set of merging b…
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…
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.
We consider the problem of upper bounding the number of circular transpositions needed to sort a permutation. It is well known that any permutation can be sorted using at most $n(n-1)/2$ adjacent transpositions. We show that, if we allow all adjacent transpositions, as well as the transposition that interchanges the element in position 1 with the element in the last position, then the number of transpositions needed is at most $n^2/4$. This answers an open question posed by Feng, Chitturi and Sudborough (2010).
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$.
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.
In this paper we introduce mixed coloured permutation, permutations with certain coloured cycles, and study the enumerative properties of these combinatorial objects. We derive the generating function, closed forms, recursions and combinatorial identities for the counting sequence, mixed Stirling numbers of the first kind. In this comprehensive study we consider further the conditions on the length of the cycles, $r$-mixed Stirling numbers and the connection to Bell polynomials.
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 give a solution to a problem posed by Corteel and Nadeau concerning permutation tableaux of length n and the number of occurrences of the dashed pattern 32--1 in permutations on [n]. We introduce the inversion number of a permutation tableau. For a permutation tableau T and the permutation $π$ obtained from T by the bijection of Corteel and Nadeau, we show that the inversion number of T equals the number of occurrences of the dashed pattern 32--1 in the reverse complement of $π$. We also show that permutation tableaux without inversions coincide with L-Bell tableaux introduced by Corteel an…
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…
Set partitions and permutations with restrictions on the size of the blocks and cycles are important combinatorial sequences. Counting these objects lead to the sequences generalizing the classical Stirling and Bell numbers. The main focus of the present article is the analysis of combinatorial and arithmetical properties of them. The results include several combinatorial identities and recurrences as well as some properties of their $p$-adic valuations.
Babson and Steingrìmsson introduced generalized permutation patterns that allow the requirement that two adjacent letters in a pattern must be adjacent in the permutation. Subsequently, Claesson presented a complete solution for the number of permutations avoiding any single pattern of type (1,2) or (2,1). For eight of these twelve patterns the answer is given by the Bell numbers. For the remaining four the answer is given by the Catalan numbers. In the present paper we give a complete solution for the number of permutations avoiding a pair of patterns of type (1,2) or (2,1). We also conjectur…
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 give a positive answer to a question raised by Davis et al. ({\em Discrete Mathematics} 341, 2018), concerning permutations with the same pinnacle set. Given $π\in S_n$, a {\em pinnacle} of $π$ is an element $π_i$ ($i\neq 1,n$) such that $π_{i-1}<π_i>π_{i+1}$. The question is: given $π,π'\in S_n$ with the same pinnacle set $S$, is there a sequence of operations that transforms $π$ into $π'$ such that all the intermediate permutations have pinnacle set $S$? We introduce {\em balanced reversals}, defined as reversals that do not modify the pinnacle set of the permutation to which they are app…
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 define a generalization of the Eulerian polynomials and the Eulerian numbers by considering a descent statistic on segmented permutations coming from the study of 2-species exclusion processes and a change of basis in a Hopf algebra. We give some properties satisfied by these generalized Eulerian numbers. We also define a $q$-analog of these Eulerian polynomials which gives back usual Eulerian polynomials and ordered Bell polynomials for specific values of its variables. We also define a noncommutative analog living in the algebra of segmented compositions. It gives us an explicit generatin…
This paper continues the analysis of the pattern-avoiding sorting machines recently introduced by Cerbai, Claesson and Ferrari [CCF]. These devices consist of two stacks, through which a permutation is passed in order to sort it, where the content of each stack must at all times avoid a certain pattern. Here we characterize and enumerate the set of permutations that can be sorted when the first stack is $132$-avoiding, solving one of the open problems proposed in [CCF]. To that end we present several connections with other well known combinatorial objects, such as lattice paths and restricted …
Recall that an excedance of a permutation $π$ is any position $i$ such that $π_i > i$. Inspired by the work of Hopkins, McConville and Propp (Elec. J. Comb., 2017) on sorting using toppling, we say that a permutation is toppleable if it gets sorted by a certain sequence of toppling moves. One of our main results is that the number of toppleable permutations on $n$ letters is the same as those for which excedances happen exactly at $\{1,\dots, \lfloor (n-1)/2 \rfloor\}$. Additionally, we show that the above is also the number of acyclic orientations with unique sink (AUSOs) of the complete bipa…
Babson and Steingr\'ımsson introduced generalized permutation patterns that allow the requirement that two adjacent letters in a pattern must be adjacent in the permutation. We consider n-permutations that avoid the generalized pattern 1-32 and whose k rightmost letters form an increasing subword. The number of such permutations is a linear combination of Bell numbers. We find a bijection between these permutations and all partitions of an $(n-1)$-element set with one subset marked that satisfy certain additional conditions. Also we find the e.g.f. for the number of permutations that avoid a g…
Babson and Steingr\'ımsson introduced generalized permutation patterns that allow the requirement that two adjacent letters in a pattern must be adjacent in the permutation. Claesson presented a complete solution for the number of permutations avoiding any single pattern of type $(1,2)$ or $(2,1)$. For eight of these twelve patterns the answer is given by the Bell numbers. For the remaining four the answer is given by the Catalan numbers. With respect to being equidistributed there are three different classes of patterns of type $(1,2)$ or $(2,1)$. We present a recursion for the number of perm…
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 …
A fork stack is a generalised stack which allows pushes and pops of several items at a time. We consider the problem of determining which input streams can be sorted using a single forkstack, or dually, which permutations of a fixed input stream can be produced using a single forkstack. An algorithm is given to solve the sorting problem and the minimal unsortable sequences are found. The results are extended to fork stacks where there are bounds on how many items can be pushed and popped at one time. In this context we also establish how to enumerate the collection of sortable sequences.
A permutation $π$ over alphabet $Σ= {1,2,3,\ldots,n}$, is a sequence where every element $x$ in $Σ$ occurs exactly once. $S_n$ is the symmetric group consisting of all permutations of length $n$ defined over $Σ$. $I_n$ = $(1, 2, 3,\ldots, n)$ and $R_n =(n, n-1, n-2,\ldots, 2, 1)$ are identity (i.e. sorted) and reverse permutations respectively. An operation, that we call as an $LRE$ operation, has been defined in OEIS with identity A186752. This operation is constituted by three generators: left-rotation, right-rotation and transposition(1,2). We call transposition(1,2) that swaps the two left…
Recently, Deutsch and Elizalde studied the largest and the smallest fixed points of permutations. Motivated by their work, we consider the analogous problems in set partitions. Let $A_{n,k}$ denote the number of partitions of $\{1,2,\dots, n+1\}$ with the largest singleton $\{k+1\}$ for $0\leq k\leq n$. In this paper, several explicit formulas for $A_{n,k}$, involving a Dobinski-type analog, are obtained by algebraic and combinatorial methods, many combinatorial identities involving $A_{n,k}$ and Bell numbers are presented by operator methods, and congruence properties of $A_{n,k}$ are also in…
This paper makes a combinatorial study of the two monoids and the two types of tableaux that arise from the two possible generalizations of the Patience Sorting algorithm from permutations (or standard words) to words. For both types of tableaux, we present Robinson--Schensted--Knuth-type correspondences (that is, bijective correspondences between word arrays and certain pairs of semistandard tableaux of the same shape), generalizing two known correspondences: a bijective correspondence between standard words and certain pairs of standard tableaux, and an injective correspondence between words…
Let $r(n,k)$ (resp. $s(n,k)$) be the number of Schröder paths (resp. little Schröder paths) of length $2n$ with $k$ hills, and set $r(0,0)=s(0,0)=1$. We bijectively establish the following recurrence relations: \begin{align*} r(n,0)&=\sum\limits_{j=0}^{n-1}2^{j}r(n-1,j), r(n,k)&=r(n-1,k-1)+\sum\limits_{j=k}^{n-1}2^{j-k}r(n-1,j),\quad 1\le k\le n, s(n,0) &=\sum\limits_{j=1}^{n-1}2\cdot3^{j-1}s(n-1,j), s(n,k) &=s(n-1,k-1)+\sum\limits_{j=k+1}^{n-1}2\cdot3^{j-k-1}s(n-1,j),\quad 1\le k\le n. \end{align*} The infinite lower triangular matrices $[r(n,k)]_{n,k\ge 0}$ and $[s(n,k)]_{n,k\ge 0}$, whose r…