Professional Documents
Culture Documents
1
Problem A is reduced to problem B
B
A
2
Problem A is reduced to problem B
3
Example: the halting problem
is reduced to
4
The state-entry problem
Inputs: •Turing Machine M
•State q
•String w
6
Suppose we have a Decider
for the state-entry algorithm:
M YES M enters q
state-entry
w problem
decider NO doesn’t
q M q
enter
7
We want to build a decider
for the halting problem:
M YES M halts on w
Halting problem
decider
w NO doesn’t
M w
halt on
8
We want to reduce the halting problem to
the state-entry problem:
M M′ YES YES
State-entry
q
problem
w NO NO
w decider
9
We need to convert one problem instance
to the other problem instance
10
Convert M to M′ :
•Add new state q
•From any halting state of M add transitions to q
M′
M q
Single
halting states halt state
11
M halts on input w
if and
only if
12
Halting problem decider
M′ YES YES
State-entry
Generate q
M M′ w
problem
NO NO
decider
w
13
We reduced the halting problem
to the state-entry problem
END OF PROOF
14
Another example:
is reduced to
15
The blank-tape halting problem
16
Theorem:
The blank-tape halting problem is undecidable
17
Suppose we have a decider for the
blank-tape halting problem:
M halts on
YES
blank-tape blank tape
M halting problem
decider NO M doesn’t halt
on blank tape
18
We want to build a decider
for the halting problem:
M YES M halts on w
halting problem
decider
w NO doesn’t
M w
halt on
19
We want to reduce the halting problem to
the blank-tape halting problem:
M YES YES
Blank-tape
M w halting problem
NO NO
decider
w
20
We need to convert one problem instance
to the other problem instance
M YES YES
Convert Blank-tape
M w halting problem
Inputs NO
decider NO
w ?
21
Construct a new machine Mw
• When started on blank tape, writes w
Mw
step 1 step2
if blank tape execute M
then write w with input w
22
M halts on input string w
if and
only if
23
Halting problem decider
24
We reduced the halting problem
to the blank-tape halting problem
END OF PROOF
25
Summary of Undecidable Problems
Halting Problem:
Membership problem:
Does machine M accept string w?
26
Blank-tape halting problem:
Does machine M halt when starting
on blank tape?
State-entry Problem:
27
Uncomputable Functions
28
Uncomputable Functions
f Values
Domain
region
29
An uncomputable function:
30
Theorem: Function f (n) is uncomputable
Input: machine M
1. Count states of M: m
2. Compute f (m)
3. Simulate M for f (m) steps
starting with empty tape
If M halts then return YES
otherwise return NO
32
Therefore, the blank-tape halting
problem is decidable
Contradiction!!!
33
Therefore, function f (n) in uncomputable
END OF PROOF
34
Undecidable Problems
for
Recursively Enumerable Languages
35
Take a recursively enumerable language L
Decision problems:
• L is empty?
• L is finite?
• L contains two different strings
of the same length?
36
Theorem:
For any recursively enumerable language L
it is undecidable to determine whether
L is empty
Proof:
We will reduce the membership problem
to this problem
37
Let M be the TM with L( M ) = L
38
We will build the decider for the
membership problem:
M YES M accepts w
membership
problem
w decider NO
M rejects w
39
We want to reduce the membership problem to
the empty language problem:
YES NO
M Mw empty language
problem
w decider NO YES
40
We need to convert one problem instance
to the other problem instance
YES NO
M Convert Mw empty language
inputs problem
w ? decider NO YES
41
Construct machine Mw :
On arbitrary input string s
if and
only if
L( M w ) is not empty
L( M w ) = {w}
43
Membership problem decider
YES NO
M construct M w
empty language
problem
Mw decider
w NO YES
END OF PROOF
44