Two reverse passes on inversion sequences
Mansour, Skogman and Smith's Open Question 5.4 asks for the inversion sequences sorted by at most two reverse passes of an ordinary stack. This paper gives exact counts at every length with \(O(n^2(16/3)^n)\) arithmetic operations. A pop of the next required value has priority, and the second pass uses the first pass's residue in reverse input order. Label each occurrence by when it leaves the stack. The resulting sortable permutation records the trace, and every blocked comparison tells which two ranks cannot be assigned the same value. A quadratic recurrence per permutation enforces these inequalities and the original position bounds, so ties are counted without an arbitrary relabeling. For a sortable rank permutation \(\pi\), trace the greedy two-pass machine and collect the pairs \(B_\pi\) of emitted ranks \((r,h)\) with \(r<h\) whose blocked comparison forbids them to tie. Rank \(j\) can take values at most \(c_j=\pi^{-1}(j)-1\) by the original position bound. When assigning a block \([a,b]\) of equal labels \(t\), require \[a>\max\!\bigl(\{r:(r,h)\in B_\pi,\ h\le b\}\cup\{j\le b:c_j<t\}\cup\{0\}\bigr). \] Between blocks increase the assigned label strictly. Start with the empty prefix ending at sentinel \(-1\) and sum over legal block starts and earlier labels. Using two prefix sums fills the counts \(D_{b,t}\) for prefixes ending in \(t\) in quadratic time. Summing the final row over \(t\) and over every sortable rank permutation counts each original indexed word once. The strict constraints derive from the actual greedy trace, so an equality never changes a blocked comparison into an allowed pop.
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.24668449
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint