Average-Case Shellsort: Pass-Comparison Tradeoffs and Deterministic Construction

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.

Authors

Publication Details

Journal
arXiv
Published
2026-12-03
Primary Topic
Algorithms and Data Compression
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Average-Case Shellsort: Pass-Comparison Tradeoffs and Deterministic Construction

Wei Pang
arXiv
Algorithms and Data Compression
preprint

Average-Case Shellsort: Pass-Comparison Tradeoffs and Deterministic Construction

Wei Pang
preprint en

Abstract

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.

arXiv
Algorithms and Data Compression
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon