[Paper Review] Most Programs Stop Quickly or Never Halt
This paper proposes a probabilistic analysis of the Halting Problem by extending the probability space over both program space and time, using an a priori computable runtime distribution. It proves that for any k > 0, a time bound T can be effectively computed such that the probability an N-bit program halts after T, given it hasn't halted by then, is less than 2^{-k}, showing that long runtimes are effectively rare.
Since many real-world problems arising in the fields of compiler optimisation, automated software engineering, formal proof systems, and so forth are equivalent to the Halting Problem--the most notorious undecidable problem--there is a growing interest, not only academically, in understanding the problem better and in providing alternative solutions. Halting computations can be recognised by simply running them; the main difficulty is to detect non-halting programs. Our approach is to have the probability space extend over both space and time and to consider the probability that a random $N$-bit program has halted by a random time. We postulate an a priori computable probability distribution on all possible runtimes and we prove that given an integer k>0, we can effectively compute a time bound T such that the probability that an N-bit program will eventually halt given that it has not halted by T is smaller than 2^{-k}. We also show that the set of halting programs (which is computably enumerable, but not computable) can be written as a disjoint union of a computable set and a set of effectively vanishing probability. Finally, we show that ``long'' runtimes are effectively rare. More formally, the set of times at which an N-bit program can stop after the time 2^{N+constant} has effectively zero density.
Motivation & Objective
- To provide a non-quantum probabilistic analysis of the Halting Problem by extending probability over both programs and time.
- To demonstrate that for any k > 0, a time bound T can be effectively computed such that the probability of halting after T is less than 2^{-k} given non-halting by T.
- To show that the set of halting programs can be decomposed into a computable set and a set of effectively vanishing probability.
- To argue that runtimes significantly longer than 2^{N+constant} have effectively zero density for N-bit programs.
Proposed method
- Postulate an a priori computable probability distribution over all possible runtimes to define a joint probability space over programs and time.
- Use the product measure of uniform program distribution and the chosen runtime distribution to compute conditional halting probabilities.
- Establish that the probability of halting after time T, given non-halting by T, is bounded by 2^{-k} for effectively computable T.
- Leverage algorithmic randomness to show that nonrandom, long runtimes are effectively rare.
- Prove that the set of halting programs is a disjoint union of a computable set and a set of probability < 2^{-k}.
- Demonstrate that programs not halting by time 2^{N+constant} cannot halt at later random times, due to algorithmic nonrandomness of such runtimes.
Experimental results
Research questions
- RQ1Can we effectively compute a time bound T such that the probability of a non-halting N-bit program halting after T is less than 2^{-k}?
- RQ2Can the set of halting programs be decomposed into a computable part and a part of effectively vanishing probability?
- RQ3Are runtimes much longer than 2^{N+constant} effectively rare for N-bit programs?
- RQ4Does the choice of runtime distribution matter in the limit, given computable distributions all yield similar rareness of long times?
Key findings
- For any k > 0, a time bound T can be effectively computed such that the conditional probability of halting after T, given non-halting by T, is less than 2^{-k}.
- The set of halting programs can be written as a disjoint union of a computable set and a set of probability effectively smaller than 2^{-k} for any k > 0.
- Runtimes longer than 2^{N+constant} have effectively zero density for N-bit programs, regardless of the choice of computable runtime distribution.
- The probability that an N-bit program never halts on a convergent Turing machine tends to one as N increases.
- Programs that have not halted by time 2^{N+constant} cannot halt at a later time that is algorithmically nonrandom.
- The result holds independently of the specific choice of computable runtime distribution, as long as most long times are effectively rare.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.