We study ordinary Shellsort with an input-independent decreasing gap table, charging all key comparisons. Let $A_p(n)$ be its minimum uniform-permutation mean among tables of at most $p$ passes. We construct an explicitly sampleable distribution showing, for an absolute constant $C$ and all $n\ge2$, $p\ge1$, \[ A_p(n)\le Cnp \bigl(n^3\lceil\log_2(2n)\rceil\bigr)^{1/(p+3/2)}. \] The construction combines prime gaps that reduce uncertainty on the original random input with a coprime suffix valid for each entrance state. A second-moment interface joins the phases without resampling their intermediate chains. A Frobenius bound pays the final insertion pass. In particular, at $p=\lfloor c\log n\rfloor$ the limiting mean coefficient is $O(ce^{3/c})$ for $0<c\le1$, compared with the classical $Ω(ce^{1/c})$ lower bound. We also give a pointwise randomized-table bound $2^{58}np\,n^{4/(p+1/2)}$ for every fixed input. Separately, we approximate the complete mean of any legal table to additive error one deterministically in $\exp(n^{2/3+o(1)})$ time and polynomial space. The reduction uses coupled Boolean evaluations and the comparator-circuit pseudorandom generator of Cavalar and Lu. Enumerating our support then deterministically selects a table meeting the mean upper bound, up to additive two, when $p=O(\log n)$. Our companion manuscript independently establishes unrestricted average order $Θ(n\log n)$ and a subexponential deterministic construction; Du and Wan independently obtain the same optimal average order. The results here refine the pass-dependent bounds and improve the deterministic preprocessing guarantee. They do not determine the optimal general exponent or give a polynomial-time deterministic construction.
翻译:暂无翻译