Skip to content

Shellsort on Random Interleavings of Sorted Chains Optimal Divisibility Tables and Unrestricted Bounds

Pang Wei

cs.CC

Abstract

Let the input be uniform among the permutations increasing in each of aa residue classes, each containing mm keys, where a≥2a\ge2 is fixed and n=amn=am. We count comparisons from this given partially sorted input; a new gap table may start above aa. Among all decreasing tables whose successive gaps divide their predecessors, the minimum expected cost is (βa/2)nln⁡m+Oa(n)(β_a/2)n\ln m+O_a(n), where βaβ_a is an explicit integer optimization involving the Janson--Knuth coefficient. Powers of a single optimal quotient attain this bound even when competitors may vary every quotient. For a=2a=2, the unique optimal quotient within this divisibility model is 77, giving coefficient 13/(14ln⁡7)13/(14\ln7). We characterize tables within O(n)O(n) of the optimum, prove that every exact minimizer starts at the square-root scale, and analyze constraints on the first gap. Without divisibility, the optimal order remains Θa(nlog⁡m)Θ_a(n\log m). For two chains we prove that the unrestricted leading coefficient exists, characterize it as an infimum over finite odd-gap blocks, and exhibit a block strictly improving on the divisibility optimum. Its exact numerical value and attainment by a finite block remain open. A shortest-path formulation computes the exact divisibility optimum at finite lengths.

Create a lesson

Metadata

Comments
19 pages