1 ELTP-GATE 2017
Consider problems with answer YES or NO
Examples:
• Does Machine M have three states ?
2 ELTP-GATE 2017
A problem is decidable if some Turing machine
Solves (decides) the problem
Decidable problems:
• Does Machine M have three states ?
3 ELTP-GATE 2017
The Turing machine that solves a problem
answers YES or NO for each instance
Input YES
problem Turing Machine
instance NO
ELTP-GATE 2017
The machine that decides a problem:
• If the answer is NO
then halts in a no state
5 ELTP-GATE 2017
Turing Machine that decides a problem
YES states
NO states
7 ELTP-GATE 2017
Some problems are undecidable:
which means:
there is no Turing Machine that
solves all instances of the problem
8 ELTP-GATE 2017
A simple undecidable problem:
9 ELTP-GATE 2017
The Membership Problem for TM
w∈ L(M ) ?
10 ELTP-GATE 2017
Thus, there exists a Turing Machine H
that solves the membership problem
M YES M accepts w
H
w NO M rejects w
11 ELTP-GATE 2017
Turing Machine that accepts L
and halts on any input
H
M YES accept w
M accepts w ?
w NO reject w
12 ELTP-GATE 2017
Since L is chosen arbitrarily
But there are recursively enumerable
languages which are not recursive
ELTP-GATE 2017
Another famous undecidable problem:
14 ELTP-GATE 2017
The Halting Problem
15 ELTP-GATE 2017
If the halting problem was decidable then
would be recursive
16 ELTP-GATE 2017
Turing Machine that accepts L and halts on any input
M H
NO reject w
M halts on w ?
w YES
accept w
Halts on final state
Run M
with input w reject w
Halts on non-final
state
ELTP-GATE 2017
Since L is chosen arbitrarily
But there are recursively enumerable
languages which are not recursive
18 ELTP-GATE 2017
Reducibility
19 ELTP-GATE 2017
Problem A is reduced to problem B
B
A
20 ELTP-GATE 2017
Problem A is reduced to problem B
21 ELTP-GATE 2017
Example: the halting problem (A)
is reduced to
22 ELTP-GATE 2017
The state-entry problem
Inputs: •Turing Machine M
•State q
•String w
23 ELTP-GATE 2017
Theorem:
The state-entry problem is undecidable
24 ELTP-GATE 2017
Suppose we have an algorithm (Turing Machine)
that solves the state-entry problem
25 ELTP-GATE 2017
Assume we have the state-entry algorithm:
YES
M Algorithm for M enters q
w state-entry
problem NO
q M doesn’t q
enter
26 ELTP-GATE 2017
We want to design the halting algorithm:
M YES M halts on w
Algorithm for
Halting problem
w NO doesn’t
M w
halt on
27 ELTP-GATE 2017
Modify input machine M :
• Add new state q
• From any halting state add transitions to q
M′
M q
Single
halting states halt state
28 ELTP-GATE 2017
M halts
if and
only if
M ′ halts on state q
29 ELTP-GATE 2017
Algorithm for halting problem:
30 ELTP-GATE 2017
Halting problem algorithm
M′ YES YES
Generate q State-entry
M M′ w algorithm NO NO
31 ELTP-GATE 2017
We reduced the halting problem
to the state-entry problem
END OF PROOF
32 ELTP-GATE 2017
Another example:
is reduced to
33 ELTP-GATE 2017
The blank-tape halting problem
34 ELTP-GATE 2017
Theorem:
The blank-tape halting problem is undecidable
35 ELTP-GATE 2017
Suppose we have an algorithm
for the blank-tape halting problem
36 ELTP-GATE 2017
Assume we have the
blank-tape halting algorithm:
M halts on
YES
Algorithm for blank tape
M blank-tape
halting problem NO M doesn’t halt
on blank tape
37 ELTP-GATE 2017
We want to design the halting algorithm:
M YES M halts on w
Algorithm for
halting problem
w NO doesn’t
M w
halt on
38 ELTP-GATE 2017
Construct a new machine Mw
• On blank tape writes w
39 ELTP-GATE 2017
M halts on input string w
if and
only if
40 ELTP-GATE 2017
Algorithm for halting problem:
1. Construct Mw
42 ELTP-GATE 2017
We reduced the halting problem
to the blank-tape halting problem
END OF PROOF
43 ELTP-GATE 2017
Another example:
is reduced to
44 ELTP-GATE 2017
membership problem algorithm
M H
NO reject w
M halts on w ?
w YES
accept w
Halts on final state
Run M
with input w reject w
Halts on non-final
state
45 ELTP-GATE 2017