Professional Documents
Culture Documents
(unsolvable problems)
Decidable Languages
Recall that:
A language A is decidable,
if there is a Turing machine M (decider)
that accepts the language A and
halts on every input string
Decision
On Halt:
Turing Machine M
YES
Accept
Input
Decider for A
string
NO
Reject
Corresponding Language:
X
(Decidable)
EMPTYDFA
{ M : M is a DFA that accepts empty language }
Decision:
DFA M
DFA M
L (M )
L (M )
Reject M
Accept M
Corresponding Language:
X
(Decidable)
FINITE DFA
{ M : M is a DFA that accepts a finite language }
Decision:
DFA M
infinite
finite
Reject M
(NO)
Accept M
(YES)
Corresponding Language:
X
accept string w ?
(Decidable)
ADFA
{ M ,w : M is a DFA that accepts string w }
Corresponding Language:
X
(Decidable)
EQUALDFA
{ M1 , M2 : M1 and M2 are DFAs that accept
the same languages }
M1 , M2 :
( L1 L2 ) ( L1 L2 )
L1 L2
L1
and
L2 L
2
L1 L2
L1 L2
L2
L1 L1
L2 L1
L1 L2
( L1 L2 ) ( L1 L2 )
L1 L2
L1
or
L1 L2
L2
L2
L1 L2
L1
L2 L1
L1 L2
EMPTYDFA
Undecidable Languages
undecidable language = not decidable language
There is no decider:
there is no Turing Machine
which accepts the language
and makes a decision (halts)
for every input string
(machine may make decision for some input strings)
L
Turing-Acceptable
Decidable
Membership problem
Halting problem
Membership Problem
Input:
Turing Machine
String w
Question:
Does M
accept w ?
w L(M ) ?
Corresponding language:
Theorem:
ATM is undecidable
(The membership problem is unsolvable)
Proof:
Basic idea:
We will assume that ATM is decidable;
We will then prove that
every decidable language
is Turing-Acceptable
A contradiction!
Suppose that
Input
string
M ,w
ATM is decidable
Decider
for ATM
YES
accepts
NO
rejects
Let
is also decidable:
String description of ML
Decider for
ML
ML accepts s ?
s
Input
string
YES
accept s
(and halt)
NO
reject s
(and halt)
Therefore,
is decidable
END OF PROOF
We have shown:
Undecidable
Decidable
ATM
Turing-Acceptable
Decidable
ATM
ATM is Turing-Acceptable
M ,w
ATM :
2. If M accepts w
then accept M ,w
Halting Problem
Input:
Turing Machine
String w
Question:
Corresponding language:
Theorem:
HALTTM is undecidable
(The halting problem is unsolvable)
Proof:
Basic idea:
Suppose that HALTTM is decidable;
we will prove that
every decidable language
is also Turing-Acceptable
A contradiction!
Suppose that
HALTTM is decidable
Input
string
M ,w
M
w
Decider for
HALTTM
YES
NO
halts on
input
doesnt halt
on input
Let
Let
be a Turing-Acceptable language
is also decidable:
Decider for
ML
s
Input
string
Decider for
HALTTM
ML halts on s ?
L
NO
YES
ML halts
Run ML
with input s
and accepts
ML halts
and rejects
reject s
and halt
accept s
and halt
reject s
and halt
Therefore,
is decidable
Contradiction!!!!
END OF PROOF
An alternative proof
Theorem:
HALTTM is undecidable
(The halting problem is unsolvable)
Proof:
Basic idea:
Assume for contradiction that
the halting problem is decidable;
we will obtain a contradiction
using a diagonilization technique
Suppose that
Input
string
M ,w
M
w
HALTTM is decidable
Decider
for HALTTM
YES
NO
halts on
doesnt
halt on
Looking inside
M ,w
H
q0
qaccept YES
halts on
w?
qreject NO
Construct machine
H
M ,w
H :
Loop forever
qacceptYES
qa
qb
q0 M halts on w?
qreject NO
If
Construct machine F :
F
M
Copy M
on tape
If
M, M
M halts on input M
Then loop forever
Else halt
Run F
F
F
If
Copy F
on tape
F ,F
F halts on input F
Then F loops forever on input F
Else F halts on input F
CONTRADICTION!!!
END OF PROOF
We have shown:
Undecidable HALTTM
Decidable
Turing-Acceptable
Decidable
HALTTM
HALTTM is Turing-Acceptable
Turing machine that accepts HALTTM :
1. Run M on input
M ,w
2. If M halts on w
then accept M ,w