Stable sorting in o(Nlog⁡N)o(N \log N) steps on a multitape Turing machine

Yann Tal

For n pairs of binary keys and associated strings of total encoded length N, including delimiters, Theorem 1.1 gives stable lexicographic sorting in O(Nlog⁡n/(log⁡log⁡log⁡n)(1/2−o(1)))O(N \log n / (\log \log \log n)^{(1/2-o(1))}) time and O(N)O(N) space. Appendix B implements it with two writable tapes. The same bounds apply to signed numbers written as finite expansions in a fixed base.

What was already known

Penttonen and Katajainen asked whether the O(Nlog⁡n)O(N \log n) tape mergesort bound could be improved. Tal’s algorithm combines fast matrix transposition on tapes with radix routing and preserves the order of records with equal keys.

How the result developed

  1. 28 Nov 2026 · Improved time bound and circuit extension reported [1]

    Yann Tal with GPT-6 · Tal reports a deterministic stable sorter that uses less than N log⁡N\log N time on a fixed multitape Turing machine, where N counts all input bits, including the data attached to keys.

Follow new evidence and revisions to this result.

Get email updates

Download contribution history

Contribution Assessment

AI involvementAI-centered
ImportanceNotable
Technical verificationReported
Human understandingFew

AI involvement

Tal credits GPT-6 with work including balanced-word routing and deterministic block shifts

Importance

The reported algorithm improves asymptotically on whole-key comparison sorting in the tape model with attached variable-length data.

Technical verification

The preprint gives a proof. The public sources do not document a completed independent check of the sorting argument.

Human understanding

The paper credits GPT-6 with refining its proof and exposition. A separate human explanation of the balanced-word routing argument is undocumented.

Research Opportunities 2

Browse all opportunities

Research directions discussed by researchers in connection with this discovery.

A larger time saving for stable sorting on tapes

Sharper bounds · Algorithm design · Computational complexity

Can a deterministic machine with a fixed number of tapes and linear space stably sort nn items of Θ(log⁡n)\Theta(\log n) bits each in O(n(log⁡n)2−δ)O(n(\log n)^{2-\delta}) time for a fixed δ>0\delta>0?

Tal retains this question in the revised paper. The tape algorithm saves a power of the triple logarithm over tape mergesort. Technical report · Status update on A larger time saving for stable sorting on tapes

Fast routing on tapes for polynomial-width strings

Generalization · Algorithm design · Computational complexity

Can a deterministic machine with a fixed number of tapes and linear space route QQ strings to their prescribed destinations in O((log⁡Q)1−δ)O((\log Q)^{1-\delta}) steps per bit, for some fixed δ>0\delta>0, when each string has at least QaQ^a bits for a fixed a>0a>0?

Main obstacle The method reaches the requested time bound when string width is exponential in a power of the number of strings.

Corollary A.2 gives an iterated-logarithm time saving for polynomial-width strings. Question 7.2 asks for a saving by a power of the logarithm. Technical report · Status update on Fast routing on tapes for polynomial-width strings

Other useful sources

View revision history
· publication