# Program size versus program running time

Short "naive" question:

Is it true that faster algorithms require longer programs ?

Given a decision problem $$A$$ and a reasonable model of computation, there can be many ways (algorithms) to solve it, and some of them can be extremely inefficient or extremely efficient (when the time complexity of the algorithm matches the time complexity of the problem). For example the primality test can be done using the Sieve of Eratosthenes algorithm which is quite simple but requires exponential time or the AKS primality test which runs in polynomial time but is rather complex and requires a "lot of code".

Are there other examples of problems that can be solved "slowly" by a very simple algorithm, but the most efficient algorithm known is very complicated and requires a much bigger program?

What could be the underlying explanation for such behviour? (e.g. Kolmogorov complexity seems not to play any role)

• Not sure if this is what you're looking for, but Blum's speed-up theorem shows that there exists an (artificial) problem such that for any program you may write, there exists a longer program that solve the problem substantially more efficiently. – Yonatan N Mar 18 '20 at 2:06
• This paper claims that it overcomes the speedup theorem: arxiv.org/abs/cs/0206022 – Mohammad Al-Turkistany Mar 18 '20 at 17:46
• @YonatanN: thanks! But I'm more interested in examples of "natural" problems (and if the rule faster-bigger also applies to them, or there is a counterexample) ... – Marzio De Biasi Mar 18 '20 at 23:04
• Hutter search doesn't 'overcome' Blum, Hutter search doesn't terminate on programs where an asymptotic bound cannot be proven in the ambient logic that Hutter search diagonalises over. – Martin Berger Mar 18 '20 at 23:40
• I think the way to interpret Hutter's result is that asymptotic time complexity measures really break down and become useless when you allow programs that diagonalise over everything. – Martin Berger Mar 18 '20 at 23:57