English

Stack-sorting for Words

Combinatorics 2018-12-11 v2

Abstract

We introduce operators hare\mathsf{hare} and tortoise\mathsf{tortoise}, which act on words as natural generalizations of West's stack-sorting map. We show that the heuristically slower algorithm tortoise\mathsf{tortoise} can sort words arbitrarily faster than its counterpart hare\mathsf{hare}. We then generalize the combinatorial objects known as valid hook configurations in order to find a method for computing the number of preimages of any word under these two operators. We relate the question of determining which words are sortable by hare\mathsf{hare} and tortoise\mathsf{tortoise} to more classical problems in pattern avoidance, and we derive a recurrence for the number of words with a fixed number of copies of each letter (permutations of a multiset) that are sortable by each map. In particular, we use generating trees to prove that the \ell-uniform words on the alphabet [n][n] that avoid the patterns 231231 and 221221 are counted by the (+1)(\ell+1)-Catalan number 1n+1((+1)nn)\frac{1}{\ell n+1}{(\ell+1)n\choose n}. We conclude with several open problems and conjectures.

Keywords

Cite

@article{arxiv.1809.09158,
  title  = {Stack-sorting for Words},
  author = {Colin Defant and Noah Kravitz},
  journal= {arXiv preprint arXiv:1809.09158},
  year   = {2018}
}

Comments

23 pages, 8 figures

R2 v1 2026-06-23T04:16:58.470Z