Undecidable Problems
(unsolvable problems)
Recall that:
A language is decidable,
if there is a Turing machine (decider) that accepts the language and
halts on every input string
A
M
A
Turing Machine Input
string
Accept
M
Decider for
A
Decision On Halt:
Decidable Languages
YES NO
A computational problem is decidable
if the corresponding language is decidable
We also say that the problem is solvable
Problem: Does DFA accept
the empty language ?
M
Corresponding Language:
} language
empty accepts
that DFA
a is :
{
M M
EMPTYDFA
X
Description of DFA as a string
M
)
(
M L
(For example, we can represent as a
M
(Decidable)
Determine whether there is a path from the initial state to any accepting state
Decider for : On input : M
DFA
)
(M L
M DFA M
)
(M L
Reject M
Decision: Accept M
EMPTYDFA
Problem: Does DFA accept a finite language?
M
Corresponding Language:
} language finite
a accepts that
DFA a
is :
{
M M FINITEDFA
X (Decidable)
Decider for : On input : M
DFA M DFA M
Reject M
Decision: Accept M
Check if there is a walk with a cycle
from the initial state to an accepting state
infinite finite
FINITEDFA
Problem: Does DFA accept string ?
M
Corresponding Language:
} string
accepts that
DFA a
is :
, {
M w M w
ADFA
X
w
(Decidable)
Decider for :
On input string : ADFA
Run DFA on input string M
w
If accepts
Then accept (and halt) Else reject (and halt)
M
w
w M,
w M,
w M,
Problem: Do DFAs and
accept the same language?
M
1Corresponding Language:
} languages same
the
accept that
DFAs are
and :
, {
M1 M2 M1 M2 EQUALDFA
X
M
2(Decidable)
Let be the language of DFA Let be the language of DFA
L
1L
2) (
) (
)
( M L
1L
2L
1L
2L
Decider for : On input : M1,M2
M
1M
2Construct DFA such that:
M
(combination of DFAs) EQUALDFA
) ( ) ( L
1L
2L
1L
2
21
L
L
andL
1 L
2
L L L
1L
2L
2L
12
1
L
L L
2 L
1L
2L
1
) ( ) ( L
1L
2L
1L
2
21
L
L
orL
1 L
2 L
1L
2L
2L
12
1
L
L L
2 L
12
1
L
L
Therefore, we only need to determine whether
( ) ( ) )
( M L
1L
2L
1L
2L
which is a solvable problem for DFAs:
EMPTY
DFAUndecidable Languages
there is no Turing Machine which accepts the language and makes a decision (halts) for every input string
undecidable language = not decidable language There is no decider:
(machine may make decision for some input strings)
For an undecidable language, the corresponding problem is undecidable (unsolvable):
there is no Turing Machine (Algorithm) that gives an answer (yes or no)
for every input instance
(answer may be given for some input instances)
We have shown before that there are undecidable languages:
Decidable
Turing-Acceptable
L
L
L
is Turing-Acceptable and undecidableWe will prove that two particular problems are unsolvable:
Membership problem
Halting problem
Membership Problem Input: •Turing Machine
M
•String
w
Question: Does accept ?
M w
? ) ( M L
w
Corresponding language:
} string
accepts
that machine
Turing a
is :
, {
w M
w M ATM
Theorem:
(The membership problem is unsolvable)
Proof:
We will assume that is decidable;
We will then prove that every decidable language is Turing-Acceptable
A
TM is undecidableA
TMBasic idea:
Suppose that is decidable
M H
w
YES
M
acceptsw
NO
M
rejectsw A
TMDecider for
A
TMw M,
Input string
Let be a Turing recognizable language
L
Let be the Turing Machine that accepts
M
LL
We will prove that is also decidable:
L
we will build a decider for
L
NO YES
M
Ls
accept
L
reject Decider for
(and halt) (and halt)
Decider for ATM
Input string
s s
M
L accepts ?sString description of
M
LTherefore,
L
is decidableBut there is a Turing-Acceptable language which is undecidable
Contradiction!!!!
Since is chosen arbitrarily, every
Turing-Acceptable language is decidable
L
We have shown:
Decidable
A
TMUndecidable
We can actually show:
Decidable
A
TMTuring-Acceptable
Turing machine that accepts :
A
TMw M,
1. Run on input
2. If accepts then accept
M w
M w
w M,
A
TM is Turing-AcceptableHalting Problem Input: •Turing Machine
M
•String
w
Question: Does halt while
processing input string ?
M
w
Corresponding language:
} string
input on
halts
that machine
Turing a
is :
, {
w M
w M HALTTM
Theorem:
(The halting problem is unsolvable)
Proof:
Suppose that is decidable;
we will prove that
every decidable language is also Turing-Acceptable
HALT
TM is undecidableBasic idea:
A contradiction!
HALT
TMM
w
YES
M
halts oninputw
M
doesn’t halt on inputw
NO
Suppose that is decidable
HALT
TMDecider for
HALT
TMw M ,
Input string
Let be a Turing-Acceptable language
L
Let be the Turing Machine that accepts
M
LL
We will prove that is also decidable:
L
we will build a decider for
L
halts and accepts
ML halts on ?s
YES NO
ML
Run
with input
M
Lreject
s
accept reject Decider for
L
s s s
Input string
Decider for HALTTM
s
ML
and halt
halts and rejects
ML
and halt
Contradiction!!!!
Therefore,
L
is decidableBut there is a Turing-Acceptable language which is undecidable
Since is chosen arbitrarily, every
Turing-Acceptable language is decidable
L
Theorem:
Proof:
Assume for contradiction that the halting problem is decidable;
(The halting problem is unsolvable)
HALT
TM is undecidablewe will obtain a contradiction
An alternative proof
Basic idea:
M H
w
YES
M
halts onw
M
doesn’thalt on
w
NO
Suppose that is decidable
HALT
TMDecider
for
HALT
TMw
M ,
Input string
H
w
M , q
0accept
q
reject
q
Input string: YES
NO Looking inside
H
Decider for HALTTM
M
halts on ?w
H
q
0NO
q
aq
bH
Loop foreverYES
w M ,
Construct machine :
H
If halts on input Then Loop Forever Else Halt
M w
M
halts on ?w
accept
q
reject
q
Construct machine :
M M, Copy
on tape
H
F
If
M
halts on inputM
Then loop forever
M M
F
Run with input itself F
F , Copy
on tape
H
If
F
halts on inputF
Then loops forever on input Else halts on input
F F
F
F
F F
F F
CONTRADICTION!!!
We have shown:
Decidable
Undecidable HALTTM
We can actually show:
Decidable Turing-Acceptable
HALT
TMTuring machine that accepts :
w M,
1. Run on input 2. If halts on then accept
M w
M w
w M,
HALTTM
is Turing-Acceptable HALTTM
This Summary is an Online Content from this Book:
Michael Sipser, Introduction to the Theory of Computation, 2ndEdition
It is edited for
Computation Theory Course 6803415-3
T.Mariah Sami Khayat
by:
Teacher Assistant @ Adam University College
For Contacting:
Kingdom of Saudi Arabia Ministry of Education Umm AlQura University Adam University College Computer Science Department
ةيدوعسلا ةيبرعلا ةكلمملا ميلعتلا ةرازو ىرقلا مأ ةعماج مضأ ةيعماجلا ةيلكلا يللا بساحلا مسق