Exact bounded-holeyness enumeration for permutations and single cycles
H. A. Helfgott asked how many permutations can increase the number of consecutive runs in any subset by at most \(k\), and how many such permutations consist of a single cycle. Both counts are given exactly for every integer \(n\ge 1\) and \(k\ge 0\). For fixed \(k\), they can be computed in time polynomial in \(n\), and the unrestricted counts are eventually polynomial in \(n\). Helfgott's MathOverflow question 340179, first display and both enumeration questions Write \([n]=\{1,\ldots,n\}\). For a subset \(S\subseteq[n]\), let \(\delta(S)\) count its runs of consecutive integers. Equivalently, it counts the elements \(i\in S\) for which \(i+1\notin S\), with \(n+1\) outside \([n]\). The linear holeyness of a permutation \(\pi\) is \(D(\pi)=\max_{S\subseteq[n]}[\delta(\pi(S))-\delta(S)]\), where \(\pi(S)=\{\pi(i):i\in S\}\). The adjacencies shared by the natural order and the inverse permutation cancel in this difference. Let \(P\) be the undirected path in natural order and \(Q\) the undirected path in the order \(q=(\pi^{-1}(1),\ldots,\pi^{-1}(n))\). With \(E(P)\) and \(E(Q)\) their edge sets, put \(R=E(P)\setminus E(Q)\) and \(B=E(Q)\setminus E(P)\). For an edge set \(A\), let \(e_A(S)\) count its edges with both endpoints in \(S\). If \(V\) is the set of endpoints of \(R\cup B\) and \(m=|R|=|B|\), then \[D(\pi)=\max_{S\subseteq V}\bigl(e_R(S)-e_B(S)\bigr)\ge \lceil m/9\rceil. \] Thus the maximum uses at most \(2^{4m}\) subsets, and every qualifying permutation has at most \(9k\) missing natural adjacencies. To compute the counts, choose \(m\) cuts among the \(n-1\) natural adjacencies for each \(0\le m\le\min(n-1,9k)\). Arrange the resulting \(m+1\) contiguous intervals in any order and read each interval in increasing or decreasing order, with one choice for a singleton. Concatenate the intervals to form \(q\). Discard any word with a joint between intervals whose endpoints differ by one. For each remaining word, use the cuts as \(R\) and the joints as \(B\), and retain the word if the displayed maximum is at most \(k\). The cuts recover precisely the natural adjacencies missing from \(q\), so each retained word occurs once. The unrestricted count is the number of retained words. For the single-cycle count, sum one over the retained words for which iteration of \(i\mapsto q_i\) from \(1\) first returns to \(1\) after exactly \(n\) steps, and zero over the others. Inversion preserves cycle lengths, so this tests the cycle condition on \(\pi\). The procedure examines at most \(\sum_{m=0}^{\min(n-1,9k)}\binom{n-1}{m}2^{m+1}(m+1)!\) choices, with at most \(n\) steps for each cycle test. The exponent in the polynomial time bound may depend on \(k\). At \(n=1\) both counts are one. At \(n=7\) and \(k=1\), the counts are \(522\) and \(60\), respectively. The unrestricted generating function can be computed without assigning interval lengths. For each number \(b\) of intervals from \(1\) to \(9k+1\), label them in natural order, mark each as a singleton or an interval of length at least two, and choose their order and orientations as above. Give a singleton one formal endpoint and each longer interval two distinct endpoints. Draw a cut from the right endpoint of label \(j\) to the left endpoint of label \(j+1\) for each \(1\le j<b\). Draw each joint from the exit endpoint of one oriented interval to the entry endpoint of the next in the chosen order. Discard choices where a joint equals a cut or the endpoint maximum exceeds \(k\). These tests depend only on the endpoint identities, which are preserved when a longer interval changes length. If \(\mathcal T_k\) is the set of retained choices and \(s(T)\) and \(t(T)\) are the numbers of singleton and longer intervals in a choice \(T\), the unrestricted count \(a_{n,k}\) satisfies \[\sum_{n\ge1}a_{n,k}x^n=\sum_{T\in\mathcal T_k}x^{s(T)}\left(\frac{x^2}{1-x}\right)^{t(T)}. \] Here \(x\) marks the length, so a singleton contributes \(x\) and a longer interval contributes one term for each length from two upwards. The denominator divides \((1-x)^{9k+1}\). A change of length can alter the cycle structure, so the single-cycle count uses the test at the actual lengths. These results concern the linear successor convention. Cyclic successors and real-rootedness are separate questions raised in the original discussion.
Authors
- Zixuan He
Institutions
- University of Glasgow (GB)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24798754
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint