On the generic undecidability of the Halting
Problem for normalized Turing machines
Alexander Rybalov ∗,
Omsk State Technical University,
prospekt Mira 11, Omsk 644050, Russia.
Abstract
Hamkins and Miasnikov presented in 2004 a generic algorithm deciding the classical Halting Problem for Turing machines with one-way
tape on a set of asymptotic probability one (on a so-called generic
set). Rybalov in 2007 showed that there is no generic algorithm deciding this problem on strongly generic sets of inputs (some subclass
of generic sets). In this paper we prove that there is no generic algorithm deciding the Halting Problem for normalized Turing machines
on generic sets of inputs. Normalized Turing machines have programs
with the following natural restriction: internal states with large indices
are not allowed at the beginning of the program. This condition does
not reduce the class of computable functions because for every Turing
machine there exists a normalized Turing machine which computes
the same function. Our proof holds for machines with one-way and
two-way tape. It also implies that the Hamkins-Miasnikov algorithm
is not generic for normalized Turing machines.
1
Introduction
In [4] a theory of generic-case complexity was developed. The generic-case
approach considers an algorithmic problem on most inputs instead of the
whole domain and ignores its behaviour on the rest of inputs. This generic
∗
Supported by Russian Science Foundation, grant 14-11-00085
1
complexity approach has numerous applications, especially in cryptography,
where cryptosystems must be based on problems which are hard on almost
all (random) instances. Usually such behavior of problems is studied in
terms of average-case complexity, but generic-case complexity and generic
computability are much more convenient in applications, in particular they
allow to study the complexity of undecidable problems.
Hamkins and Miasnikov proved in [3] that the classical Halting Problem
is generically decidable (even quickly decidable) for Turing machines with
one-way infinite tape. Namely, the set of all Turing machines such that the
head of the machine falls off the tape (starting on the empty tape) before
repeating a state is generic. This result is model sensitive and it is an open
problem to transfer it to Turing machines with two-way tape. On the other
hand Rybalov proved in [5] that the Halting Problem (both for one-way
and two-way models) remains undecidable on strongly generic sets of inputs
(some subclass of generic sets). In this paper we strengthen this result for
so-called normalized Turing machines. A Turing machine M over alphabet
{a1 , . . . , ak } is called normalized if its program satisfies the following condition: from every non-final state qi of M we can only reach states qj , where
j ≤ ki + 1. It corresponds to the reasonable process of program design, when
we introduce a new state qi+1 after using of state qi in the right sides of
rules of the program. This condition does not reduce the class of computable
functions because for every Turing machine there exists a normalized Turing machine which computes the same function. We prove that there is no
generic algorithm deciding the Halting Problem for normalized Turing machines on generic sets of inputs. Our proof holds for machines with one-way
and two-way tape. It also implies that the Hamkins-Miasnikov algorithm is
not generic for normalized Turing machines.
Note that in the classical work of Chaitin [2] the probability space is
defined over the set of all programs (in some effective binary coding of programs). Chaitin’s famous constant Ω is the sum of probabilities of all halting
programs. Calude and Stay in [1] extend the probability space over both
space and time and consider the probability that a random N-bit program
has halted by a random time. An analogous result about the undecidability
of the Halting Problem on the set of programs of probability one immediately
follows from the worst-case undecidability because every individual program
has a non-zero probability.
2
2
Generic algorithms
Let M be a set of all machines. Suppose that there is a function size : M →
N such that for all n the set Mn = {x ∈ M : size(x) = n} is finite. For a
subset S ⊆ M define the following sequence
ρn (S) =
|S ∩ Mn |
, n = 1, 2, 3, . . .
|Mn |
The value ρn (S) is the probability to generate a machine from S during
random and uniform generation of machines from Mn . The asymptotic
density of S is the following limit (if it exists)
ρ(S) = lim ρn (S).
n→∞
S is called generic if ρ(S) = 1 and negligible if ρ(S) = 0. Clearly, S is generic
if and only if its complement in M is negligible. We call a set S strongly
negligible if the sequence ρn (S) converges to 0 exponentially fast, i.e. there
are constants 0 < σ < 1 and C > 0 such that for every n
ρn (S) < Cσ n .
Now S is called strongly generic if its complement is strongly negligible.
An algorithm A with input set M and output set J ∪{?} (? ∈
/ J) is called
(strongly) generic if
1. A stops on every input from M,
2. the set {x ∈ M : A(x) =?} is (strongly) negligible.
Generic algorithm A computes a function f : M → J if for all x ∈ M
A(x) = y ∈ J ⇒ f (x) = y. The situation A(x) =? means that A cannot
compute the function f for argument x. But condition 2 says that A correctly
computes f on almost all inputs (inputs from generic set).
The Halting Problem for Turing machines is the problem of computing
of the function
1, if machine M halts on empty tape,
h(M ) =
0, otherwise,
defined on the class of all Turing machines M. It is undecidable in the
classical sense.
3
A model of Turing machines is called effective if there is an algorithm
A : M × N → M such that for every machine M and for every n ∈ N the
machine A(M, n) computes the same function as M . For every machine M
define
c(M ) = {A(M, n) : n ∈ N}.
Theorem 1. Suppose that a model of Turing machines is effective.
1. If for every machine M the set c(M ) is not negligible, then there is no
generic algorithm computing function h.
2. If for every machine M the set c(M ) is not strongly negligible, then
there is no strongly generic algorithm computing function h.
Proof. We will prove the case 1 of the theorem. Case 2 is proved similarly.
Suppose, to the contrary, that there exists a generic algorithm A, computing
function h. Then there is a classical algorithm B, computing h for every
input M in the following way. Algorithm B enumerates the set c(M ) in some
increasing order and runs algorithm A on every M 0 ∈ c(M ) until A(M 0 ) 6=?.
The set c(M ) is not negligible. By definition of generic algorithms the set
{M ∈ M : A(M ) =?} is negligible. So there exists a machine M 0 ∈ c(M )
such that A(M 0 ) 6=?. Now B outputs A(M 0 ) = A(M ) = h(M ). Thereby
algorithm B computes function h for all inputs. This contradiction proves
the theorem.
3
Normalized Turing machines
Every Turing machine M has a finite set of states Q = {q0 , q1 , . . . , qn }, where
q1 is the start state and q0 is the final state. The head of the machine M
can read and write symbols from the alphabet Σ = {0, 1, } ( is the blank
symbol) while moving on an infinite tape divided into cells. The program
PM of a Turing machine M consists of a finite set of instructions (one for
every non-final qi ∈ Q and a ∈ Σ)
(qi , a) → (qj , b, S),
where qj ∈ Q, b ∈ Σ, and S ∈ {R, L} – shift to the right or to the left. This
instruction says that M being in state qi with the head, reading symbol a on
the tape, must change state to qj , replace symbol a by b and move the head
4
(to right or left adjacent cell). We identify machine M with its program PM .
Note that our result does not depend on the size of alphabet Σ and holds for
any alphabet with at least two symbols. The size of a Turing machine is the
number of its non-final states.
A Turing machine M is called normalized if its program satisfies the
following condition: from every non-final state qi of M we can only reach
states qj , where j ≤ 3i + 1. This condition corresponds to the reasonable
process of program design, when we introduce a new state qi+1 after using
state qi in the right sides of rules of the program. This condition does not
reduce the class of computable functions.
Lemma 1. For every Turing machine M there exists a normalized Turing
machine M ∗ , computing the same function.
Proof. Note that if we swap non-final states qi and qj in the program of M ,
then the new machine M 0 will run on any input in the same way as M .
Now we can normalize machine M by swapping states starting with the first
instruction.
Denote by M the set of all normalized Turing machines.
Lemma 2. The number of normalized Turing machines of size n is
b(n−1)/3c
3n
|Mn | = 6 (n + 1)
3(n−b(n−1)/3c)
Y
(3i + 2)3 .
i=1
Proof. For every three instructions
(qi , a) → (qj , b, S), a ∈ {0, 1, }, S ∈ {R, L}
there are 3i + 2 variants to choose a state qj if 3i + 1 < n and n + 1 variants
if 3i + 1 ≥ n. Also there are 3 variants to choose symbol a and 2 variants to
choose a shift S. Multiplying these numbers for all n states we obtain the
formula.
Now define an algorithm A, which for every normalized Turing machine
M effectively enumerates the set c(M ) of all machines obtained from M by
adding new states and arbitrary normalized instructions for the new states
to the program of M . All machines from c(M ) compute the same function
as M because all new states are unreachable from the old states of M . So
the model of normalized Turing machines is effective.
5
Lemma 3. For every machine M the set c(M ) is not negligible.
Proof. Let M have k states. Consider machines from c(M ) with k + n states,
where n > 3k + 1. The number of such machines is the number of variants
to chose instructions for states qk+1 , . . . , qk+n . As in the proof of Lemma 2
we can compute
b(k+n−1)/3c
3n
|c(M )k+n | = 6 (k + n + 1)
3(k+n−b(k+n−1)/3c)
Y
(3i + 2)3 .
i=k+1
So
|c(M )k+n |
=
n→∞ |Mk+n |
Qb(k+n−1)/3c
3(k+n−b(k+n−1)/3c)
ρ(c(M )) = lim
= lim
n→∞
(3i + 2)3
i=k+1
Q
(3i + 2)3
1)3(k+n−b(k+n−1)/3c) b(k+n−1)/3c
i=1
63n (k + n + 1)
63(k+n) (n + k +
=
1
= lim const = const > 0.
Q
k
3
n→∞ 63k
n→∞
(3i
+
2)
i=1
= lim
Now Lemma 3 and Theorem 1 imply the following statement.
Theorem 2. For normalized Turing machines there is no generic algorithm
computing function h.
For non-normalized Turing machines a weaker result (proven in [5]) follows from Theorem 1 and Lemma 2 from [5].
Theorem 3. For non-normalized Turing machines there is no strongly generic
algorithm computing function h.
Note also that a similar result about undecidability of the Halting Problem for Chaitin’s model can be obtained in these frameworks.
The author thanks Volker Diekert for useful suggestions and the anonymous referee for many useful remarks. Also the author thanks the Russian
Science Foundation (grant 14-11-00085) for financial support.
6
References
[1] C.S. Calude, M.A. Stay. Most programs stop quickly or never halt, Advances in Applied Mathematics, 40 (2008), No. 3, 295–308.
[2] G. J. Chaitin. A theory of program size formally identical to information
theory, Journal of ACM, 22 (1975), 329340.
[3] J.D. Hamkins, A. Miasnikov. The halting problem is decidable on a set
of asymptotic probability one. Notre Dame Journal of Formal Logic, 47
(2006), No. 4, 515–524.
[4] I. Kapovich, A. Myasnikov, P. Schupp, V. Shpilrain. Generic-case complexity, decision problems in group theory and random walks. J. Algebra,
264 (2003), No. 2, 665–694.
[5] A.Rybalov. On the strongly generic undecidability of the Halting Problem. Theoretical Computer Science, 377 (2007), pp. 268–270
7
© Copyright 2026 Paperzz