Fertility and two-pass sorting of repeated-letter words
Repetition changes what a stack pass emits and when. For the questions in Defant and Kravitz's §6, this paper gives exact two-pass counts at fixed letter multiplicities for both the hare and tortoise maps. Through a constant input run the hare retains the same support after the first copy and can lengthen a later equal-output run. The tortoise emits the old copy on equality. A recurrence tracks the support of each stack and the last emitted value. For their Question 5.4, every nonnegative integer is realized as a preimage count for a word using each of its letters twice, under either map separately. Ordered splits at maxima construct the witnesses. The same split counts answer Cerbai's question on \(21\)-sortable Cayley permutations by summing interval fertilities over the strict-\(231\)-avoiding packed words. For the two-pass calculation use state \(s=(P_1,P_2,\ell)\) with the sets of values presently in the two stacks and the most recent final output \(\ell\). Initially both supports are empty and \(\ell=0\) is below every input symbol. Feed the ordered emissions from the first stack to the second. Reject whenever a final output is below \(\ell\); otherwise update it. For each input letter \(x\), let \(T_x\) be this deterministic transition matrix with failed moves omitted, and let \(g\) be the indicator that draining both stacks maintains weak increase. For a content vector \(c\) the count is \(A_cg\), with \(A_0=e_{s_0}\) and \(A_d=\sum_{x:d_x>0}A_{d-e_x}T_x\). Choose either hare or tortoise for both passes and use its own matrices. The equal-copy rule affects multiplicity of even runs but the order check sees only the support and last output. Fertility means the number of single-pass preimages of the prescribed output word under one chosen map. Each value in \(\mathbb Z_{\ge0}\) occurs even when the output uses every letter exactly twice. The Cayley enumeration uses the hare split recurrence on packed words avoiding strict \(231\) after the first pass, so it is a separate class from the arbitrary fixed-content counts.
Authors
- Zixuan He
Institutions
- University of Glasgow (GB)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-30
- DOI
- https://doi.org/10.5281/zenodo.24665845
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint