ECS 120 Lesson 18 – Decidable Problems, the
Halting Problem
Oliver Kreylos
Friday, May 11th, 2001
In the last lecture, we had a look at a problem that we claimed was not
solvable by an algorithm – the problem whether a given
C
program prints
the message “Hello World” and then exits. Today we are going to look at a
very similar problem and prove formally that there exists no Turing Machine
that can decide it.
1
Problems and Languages
Let us start by defining some terminology for problems. A problem
P
is a
question that can be asked about entities
E
of some type (Turing Machines,
integers, graphs, etc.) and answers either “yes” or “no.” For example, the
“Hello World” problem can be applied to
C
programs and asks whether an
entity
E
(a certain
C
program) prints “Hello World” and then exits.
We
denote the answer that problem
P
gives about entity
E
as
P
(
E
). If
P
(
E
) is
“yes,” we call
E
an
instance
of
P
.
At first glance, it seems that the theory about languages we have investi
gated so thoroughly cannot be applied to reason about problems. A language
is merely a set of words over some alphabet, whereas a problem is a question
about some entity, that can either be answered “yes” or “no.” As it turns out,
this difference is not fundamental, but just a matter of notation. We have al
ready seen that any entity of some type we can reason about mathematically
can also be converted into words over some alphabet by the encoding mech
anism discussed earlier; this means that any entity
E
can be converted to a
word
E
∈
Σ
*
for some alphabet Σ. We can now define a language
L
(
P
) for
problem
P
as follows:
L
(
P
) :=
O
∈
Σ
*
E
is an instance of
P
, where
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Σ is the alphabet needed to encode entity
O
. In other words, the language for
a problem
P
consists of exactly those words that are encodings of instances
of
P
, i. e., that are encodings of entities for which
P
’s answer is “yes.” Being
a set of words,
L
(
P
) is a language in the usual sense.
We can now directly apply language theory to solving problems: If and
only if
P
is a problem that can be solved by an algorithm, i. e., there exists
an algorithm that always terminates and either answers “yes” or “no,” then
the language
L
(
P
) must be Turingdecidable: Given any word
w
∈
Σ
*
, there
is a Turing Machine
D
(
P
) that can decode
w
=
E
back to an entity
E
,
and can then apply the algorithm to answer
P
to that entity. An algorithm
comes up with an answer after a finite number of steps; therefore,
D
(
P
) can
accept or reject the word after a finite number of steps.
This means that
D
(
P
) is a decider for
L
(
P
).
2
The Halting Problem Revisited
We defined the halting problem as the question whether a given Turing
Machine
M
halts on input word
w
.
Using the conversion strategy from
above, we convert the halting problem to a language
H
TM
:=
M, w
TM
M
halts on input
w
. The words in
H
TM
are encodings of Turing Ma
chines and the input words they halt on. Let us first look at a slightly modi
fied version of the halting problem: Let
A
TM
:=
M, w
TM
M
accepts
w
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '07
 Filkov
 Turing Machines

Click to edit the document details