arXiv++ Combinatorics

Browse math.CO papers from arXiv

stack-sorting map

34 papers tagged with this keyword
2026-06-23 v2
Asymptotics of the Average Stack-Sorting Depth
Let $\mathcal{D}_n$ denote the average number of passes of the stack-sorting map $s$ required to sort a permutation in $S_n$. We use the recently introduced framework of stack-sorting diagrams and tableaux to prove that the limit $\lim_{n\to\infty}\mathcal{D}_n/n$ exists. This resolves a longstanding conjecture of West originally proposed in $1990$. As a consequence, we also provide a monotonically increasing sequence that converges to $\lim_{n\to\infty}\mathcal{D}_n/n$, improving upon Defant's lower bound of $λ\approx 0.62433$.
2026-06-07
A Characterization of the $2m-4$ Case of Highly Sorted Permutations
Let $s$ denote West's stack-sorting map. In 2020, Defant characterized and enumerated the set $s^{n-m}(S_n)$ for $n \geq 2m-3$. While $|s^{n-m}(S_n)| = B_m$ when $n \geq 2m-2$, where $B_m$ denotes the $m$th Bell number, there are additional permutations when $n = 2m-3$. In this paper, we explore the more complex $n = 2m-4$ case, with several forms of additional permutations. We characterize $s^{m-4}(S_{2m-4})$ and find that its size is \[B_m + \frac{m^2 + 7m - 28}{2}\] for $m \geq 5$. This answers Defant's question about the $2m-4$ case. Furthermore, we find some differences in the behavior of the $2m-5$ case compared to the $2m-3$ and $2m-4$ cases.
2026-04-28
Subword enumeration up to stack-sorting equivalence
Defant and Kravitz introduced generalizations of West's stack-sorting map $s$ from permutations to finite words. This raises questions as to how such generalizations could be applied in the field of combinatorics on words. The Defant-Kravitz generalizations of $s$ depend on how repeated occurrences of the same character within a word may be repositioned, according to their $\textsf{tortoise}$ and $\textsf{hare}$ operations. As demonstrated in this paper, these operations provide a natural way of extending abelian complexity functions for infinite sequences, in a way that gives light to structural properties associated with infinite words. We apply these new ideas to two famous infinite words: the paperfolding word and the Thue-Morse word. In the case of the Thue-Morse word, we discover an interesting connection to the previous work of several authors, such as de Luca and Varricchio, on the ``special'' factors of the Thue-Morse word. This may be seen as providing a basis for a new and interdisciplinary area linking the combinatorics about the stack-sorting of permutations with the field of combinatorics on words.
2026-04-12
Polynomial Time Enumeration of t-Stack-Sortable Permutations Ending in Their Least Entry
We study the behavior of West's stack-sorting map $s$ on permutations whose last entry is also their least. Let $S_{n}':=\{\pi0\mid π\in S_n\}$ where $\pi0$ denotes the concatenation of $π$ and $0$. For each permutation $π\in S_n'$, we introduce a new combinatorial object known as the stack-sorting tableau $T_π$, which ultimately serves as the key ingredient in the first polynomial time algorithm for counting the number of $t$-stack-sortable permutations in $S_n'$. We then establish a precise relationship between the behavior of $s$ on $S_{n}'$ and on $S_{n}$.
2024-11-18 v2
Stack-Sorting with Dotted-Pattern-Avoiding Stacks
In this paper, we introduce the dotted pattern-avoiding map $s_{\dotτ}$, which avoids the dotted pattern $\dotτ$ instead of descents as West's stack-sorting map $s$ does. We also extend the pattern-avoiding machine, which is composed of a $σ$ avoiding map and West's stack-sorting map $s$, to the dotted pattern-avoiding machine. In this paper, we prove the analogs of the classical results on West's stack sorting map for the length $2$ dotted pattern-avoiding maps. We end with several conjectures.
2024-10-19
Stack-sorting with Stacks Avoiding Vincular Patterns
We introduce the stack-sorting map $\text{SC}_σ$ that sorts, in a right-greedy manner, an input permutation through a stack that avoids some vincular pattern $σ$. The stack-sorting maps of Cerbai et al. in which the stack avoids a pattern classically and Defant and Zheng in which the stack avoids a pattern consecutively follow as special cases. We first characterize and enumerate the sorting class $\text{Sort}(\text{SC}_σ)$, the set of permutations sorted by $s\circ\text{SC}_σ$, for seven length $3$ patterns $σ$. We also decide when $\text{Sort}(\text{SC}_σ)$ is a permutation class. Next, we compute $\max_{π\in \mathfrak S_n}|\text{SC}_σ^{-1}(π)|$ and characterize the periodic points of $\text{SC}_σ$ for several length $3$ patterns $σ$. We end with several conjectures and open problems.
2024-08-09
More results on stack-sorting for set partitions
Let a sock be an element of an ordered finite alphabet A and a sequence of these elements be a sock sequence. In 2023, Xia introduced a deterministic version of Defant and Kravitz's stack-sorting map by defining the $φ_σ$ and $φ_{\overlineσ}$ pattern-avoidance stack-sorting maps for sock sequences. Xia showed that the $φ_{aba}$ map is the only one that eventually sorts all set partitions; in this paper, we prove deeper results regarding $φ_{aba}$ and $φ_{\overline{aba}}$ as a natural next step. We newly define two algorithms with time complexity $O(n^3)$ that determine if any given sock sequence is in the image of $φ_{aba}$ or $φ_{\overline{aba}}$ respectively. We also show that the maximum number of preimages that a sock sequence of length $n$ has grows at least exponentially under both the $φ_{aba}$ and $φ_{\overline{aba}}$ maps. Additionally, we prove results regarding fertility numbers (introduced by Defant) in the context of set partitions and multiple-pattern-avoiding stacks.
2024-08-09 v2
Fertility Numbers of Consecutive $S_3$ Pattern-Avoiding Stack-Sorting maps
In this paper, we show that for all length 3 patterns, all positive integers are fertility numbers for the consecutive-pattern-avoiding stack-sorting map $\textrm{SC}_σ$, which resolves conjecture 8.3 from Defant and Zheng. The paper ends with a conjecture.
2024-05-03
The Order of the (123, 132)-Avoiding Stack Sort
Let $s$ be West's deterministic stack-sorting map. A well-known result (West) is that any length $n$ permutation can be sorted with $n-1$ iterations of $s.$ In 2020, Defant introduced the notion of highly-sorted permutations -- permutations in $s^t(S_n)$ for $t \lessapprox n-1.$ In 2023, Choi and Choi extended this notion to generalized stack-sorting maps $s_σ,$ where we relax the condition of becoming sorted to the analogous condition of becoming periodic with respect to $s_σ.$ In this work, we introduce the notion of minimally-sorted permutations $\mathfrak{M}_n$ as an antithesis to Defant's highly-sorted permutations, and show that $\text{ord}_{s_{123, 132}}(S_n) = 2 \lfloor \frac{n-1}{2} \rfloor,$ strengthening Berlow's 2021 classification of periodic points.
2024-03-08
On the set partitions that require maximum sorts through the $aba-$avoiding stack
Recently, Xia introduced a deterministic variation $φ_σ$ of Defant and Kravitz's stack-sorting maps for set partitions and showed that any set partition $p$ is sorted by $φ^{N(p)}_{aba}$, where $N(p)$ is the number of distinct alphabets in $p$. Xia then asked which set partitions $p$ are not sorted by $φ_{aba}^{N(p)-1}$. In this note, we prove that the minimal length of a set partition $p$ that is not sorted by $φ_{aba}^{N(p)-1}$ is $2N(p)$. Then we show that there is only one set partition of length $2N(p)$ and ${{N(p) + 1} \choose 2} + 2{N(p) \choose 2}$ set partitions of length $2N(p)+1$ that are not sorted by $φ_{aba}^{N(p)-1}$.
2024-02-20
Operahedron Lattices
Laplante-Anfossi associated to each rooted plane tree a polytope called an operahedron. He also defined a partial order on the vertex set of an operahedron and asked if the resulting poset is a lattice. We answer this question in the affirmative, motivating us to name Laplante-Anfossi's posets operahedron lattices. The operahedron lattice of a chain with $n+1$ vertices is isomorphic to the $n$-th Tamari lattice, while the operahedron lattice of a claw with $n+1$ vertices is isomorphic to $\mathrm{Weak}(\mathfrak S_n)$, the weak order on the symmetric group $\mathfrak S_n$. We characterize semidistributive operahedron lattices and trim operahedron lattices. Let $Δ_{\mathrm{Weak}(\mathfrak S_n)}(w_\circ(k,n))$ be the principal order ideal of $\mathrm{Weak}(\mathfrak S_n)$ generated by the permutation ${w_\circ(k,n)=k(k-1)\cdots 1(k+1)(k+2)\cdots n}$. Our final result states that the operahedron lattice of a broom with $n+1$ vertices and $k$ leaves is isomorphic to the subposet of $\mathrm{Weak}(\mathfrak S_n)$ consisting of the preimages of $Δ_{\mathrm{Weak}(\mathfrak S_n)}(w_\circ(k,n))$ under West's stack-sorting map; as a consequence, we deduce that this subposet is a semidistributive lattice.
2023-09-26
Deterministic stack-sorting for set partitions
A sock sequence is a sequence of elements, which we will refer to as socks, from a finite alphabet. A sock sequence is sorted if all occurrences of a sock appear consecutively. We define equivalence classes of sock sequences called sock patterns, which are in bijection with set partitions. The notion of stack-sorting for set partitions was originally introduced by Defant and Kravitz. In this paper, we define a new deterministic stack-sorting map $φ_σ$ for sock sequences that uses a $σ$-avoiding stack, where pattern containment need not be consecutive. When $σ= aba$, we show that our stack-sorting map sorts any sock sequence with $n$ distinct socks in at most $n$ iterations, and that this bound is tight for $n \geq 3$. We obtain a fine-grained enumeration of the number of sock patterns of length $n$ on $r$ distinct socks that are $1$-stack-sortable under $φ_{aba}$, and we also obtain asymptotics for the number of sock patterns of length $n$ that are $1$-stack-sortable under $φ_{aba}$. Finally, we show that for all unsorted sock patterns $σ\neq a\cdots a b a \cdots a$, the map $φ_σ$ cannot eventually sort all sock sequences on any multiset $M$ unless every sock sequence on $M$ is already sorted.
On a conjecture on pattern-avoiding machines
Let $s$ be West's stack-sorting map, and let $s_{T}$ be the generalized stack-sorting map, where instead of being required to increase, the stack avoids subpermutations that are order-isomorphic to any permutation in the set $T$. In 2020, Cerbai, Claesson, and Ferrari introduced the $σ$-machine $s \circ s_σ$ as a generalization of West's $2$-stack-sorting-map $s \circ s$. As a further generalization, in 2021, Baril, Cerbai, Khalil, and Vajnovski introduced the $(σ, τ)$-machine $s \circ s_{σ, τ}$ and enumerated $|\Sort_{n}(σ,τ)|$ -- the number of permutations in $S_n$ that are mapped to the identity by the $(σ, τ)$-machine -- for six pairs of length $3$ permutations $(σ, τ)$. In this work, we settle a conjecture by Baril, Cerbai, Khalil, and Vajnovski on the only remaining pair of length $3$ patterns $(σ, τ) = (132, 321)$ for which $|\Sort_{n}(σ, τ)|$ appears in the OEIS. In addition, we enumerate $|\Sort_n(123, 321)|$, which does not appear in the OEIS, but has a simple closed form.
2023-08-10
Periodic Points of Consecutive-Pattern-Avoiding Stack-Sorting Maps
West's stack-sorting map involves a stack which avoids the permutation $21$ consecutively. Defant and Zheng extended this to a consecutive-pattern-avoiding stack-sorting map $SC_σ$, where the stack must always avoid a given permutation $σ$ consecutively. We address one of the main conjectures raised by Defant and Zheng in their dynamical approach to $SC_σ$. Specifically, we show that the periodic points of $SC_σ$ are precisely the permutations that consecutively avoid $σ$ and its reverse.
2023-01-03
A lift of West's stack-sorting map to partition diagrams
Published in Pacific J. Math. 324 (2023) 227-248 • View PublicationBIB
We introduce a lifting of West's stack-sorting map $s$ to partition diagrams, which are combinatorial objects indexing bases of partition algebras. Our lifting $\mathscr{S}$ of $s$ is such that $\mathscr{S}$ behaves in the same way as $s$ when restricted to diagram basis elements in the order-$n$ symmetric group algebra as a diagram subalgebra of the partition algebra $\mathscr{P}_{n}^ξ$. We then introduce a lifting of the notion of $1$-stack-sortability, using our lifting of $s$. By direct analogy with Knuth's famous result that a permutation is $1$-stack-sortable if and only if it avoids the pattern $231$, we prove a related pattern-avoidance property for partition diagrams, as opposed to permutations, according to what we refer to as stretch-stack-sortability.
2021-04-07 v2
Stack-Sorting for Coxeter Groups
Published • View PublicationBIB
Given an essential semilattice congruence $\equiv$ on the left weak order of a Coxeter group $W$, we define the Coxeter stack-sorting operator ${\bf S}_\equiv:W\to W$ by ${\bf S}_\equiv(w)=w\left(π_\downarrow^\equiv(w)\right)^{-1}$, where $π_\downarrow^\equiv(w)$ is the unique minimal element of the congruence class of $\equiv$ containing $w$. When $\equiv$ is the sylvester congruence on the symmetric group $S_n$, the operator ${\bf S}_\equiv$ is West's stack-sorting map. When $\equiv$ is the descent congruence on $S_n$, the operator ${\bf S}_\equiv$ is the pop-stack-sorting map. We establish several general results about Coxeter stack-sorting operators, especially those acting on symmetric groups. For example, we prove that if $\equiv$ is an essential lattice congruence on $S_n$, then every permutation in the image of ${\bf S}_\equiv$ has at most $\left\lfloor\frac{2(n-1)}{3}\right\rfloor$ right descents; we also show that this bound is tight. We then introduce analogues of permutree congruences in types $B$ and $\widetilde A$ and use them to isolate Coxeter stack-sorting operators $\mathtt{s}_B$ and $\widetilde{\hspace{.05cm}\mathtt{s}}$ that serve as canonical type-$B$ and type-$\widetilde A$ counterparts of West's stack-sorting map. We prove analogues of many known results about West's stack-sorting map for the new operators $\mathtt{s}_B$ and $\widetilde{\hspace{.05cm}\mathtt{s}}$. For example, in type $\widetilde A$, we obtain an analogue of Zeilberger's classical formula for the number of $2$-stack-sortable permutations in $S_n$.
2021-02-23 v2
Fertilitopes
Published • View PublicationBIB
We introduce tools from discrete convexity theory and polyhedral geometry into the theory of West's stack-sorting map $s$. Associated to each permutation $π$ is a particular set $\mathcal V(π)$ of integer compositions that appears in a formula for the fertility of $π$, which is defined to be $|s^{-1}(π)|$. These compositions also feature prominently in more general formulas involving families of colored binary plane trees called troupes and in a formula that converts from free to classical cumulants in noncommutative probability theory. We show that $\mathcal V(π)$ is a transversal discrete polymatroid when it is nonempty. We define the fertilitope of $π$ to be the convex hull of $\mathcal V(π)$, and we prove a surprisingly simple characterization of fertilitopes as nestohedra arising from full binary plane trees. Using known facts about nestohedra, we provide a procedure for describing the structure of the fertilitope of $π$ directly from $π$ using Bousquet-Mélou's notion of the canonical tree of $π$. As a byproduct, we obtain a new combinatorial cumulant conversion formula in terms of generalizations of canonical trees that we call quasicanonical trees. We also apply our results on fertilitopes to study combinatorial properties of the stack-sorting map. In particular, we show that the set of fertility numbers has density $1$, and we determine all infertility numbers of size at most $126$. Finally, we reformulate the conjecture that $\sum_{σ\in s^{-1}(π)}x^{\text{des}(σ)+1}$ is always real-rooted in terms of nestohedra, and we propose natural ways in which this new version of the conjecture could be extended.
2020-12-07
Highly Sorted Permutations and Bell Numbers
Published in Enumerative Combinatorics and Applications, 1 (2021) • View PublicationBIB
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$.
2020-08-27
Stack-Sorting with Consecutive-Pattern-Avoiding Stacks
Published • View PublicationBIB
We introduce consecutive-pattern-avoiding stack-sorting maps $\text{SC}_σ$, which are natural generalizations of West's stack-sorting map $s$ and natural analogues of the classical-pattern-avoiding stack-sorting maps $s_σ$ recently introduced by Cerbai, Claesson, and Ferrari. We characterize the patterns $σ$ such that $\text{Sort}(\text{SC}_σ)$, the set of permutations that are sortable via the map $s\circ\text{SC}_σ$, is a permutation class, and we enumerate the sets $\text{Sort}(\text{SC}_σ)$ for $σ\in\{123,132,321\}$. We also study the maps $\text{SC}_σ$ from a dynamical point of view, characterizing the periodic points of $\text{SC}_σ$ for all $σ\in S_3$ and computing $\max_{π\in S_n}|\text{SC}_σ^{-1}(π)|$ for all $σ\in\{132,213,231,312\}$. In addition, we characterize the periodic points of the classical-pattern-avoiding stack-sorting map $s_{132}$, and we show that the maximum number of iterations of $s_{132}$ needed to send a permutation in $S_n$ to a periodic point is $n-1$. The paper ends with numerous open problems and conjectures.
2020-04-23 v2
Troupes, Cumulants, and Stack-Sorting
Published • View PublicationBIB
Several sequences of free cumulants that count binary plane trees correspond to sequences of classical cumulants that count the decreasing versions of the same trees. Using two new operations on colored binary plane trees that we call insertion and decomposition, we prove that this surprising phenomenon holds for families of trees that we call troupes. We give a simple characterization of troupes, which provide a broad framework for generalizing several of the results known about West's stack-sorting map $s$. Indeed, we give new proofs of some of the main techniques that have been developed for understanding $s$; these new proofs are far more conceptual than the original ones, explain how the objects called valid hook configurations arise naturally, and generalize to troupes. For $t\in\{2,3\}$, we enumerate $t$-stack-sortable alternating permutations of odd length and $t$-stack-sortable permutations whose descents are all peaks. The unexpected connection between troupes and cumulants provides a powerful new tool for analyzing the stack-sorting map that hinges on free probability theory. We give numerous applications of this method. For example, we show that if $σ\in S_{n-1}$ is chosen uniformly at random, then the expected value of $\text{des}(s(σ))+1$ is \[\left(3-\sum_{j=0}^n\frac{1}{j!}\right)n.\] Furthermore, the variance of $\text{des}(s(σ))+1$ is asymptotically $(2+2e-e^2)n$. We obtain similar results concerning the expected number of descents of postorder readings of decreasing colored binary plane trees. We also obtain improved estimates for $|s(S_n)|$ and an improved lower bound for the degree of noninvertibility of $s$. We give two novel formulas that convert from free to classical cumulants. The first is given by a sum over noncrossing partitions, and the second is given by a sum over $231$-avoiding valid hook configurations. We pose several open problems.