You are on page 1of 44

Reducibility

1
Problem A is reduced to problem B

If we can solve problem B then


we can solve problem A

B
A

2
Problem A is reduced to problem B

If B is decidable then A is decidable

If A is undecidable then B is undecidable

3
Example: the halting problem

is reduced to

the state-entry problem

4
The state-entry problem
Inputs: •Turing Machine M
•State q
•String w

Question: Does M enter state q


on input w ?
5
Theorem:
The state-entry problem is undecidable

Proof: Reduce the halting problem to

the state-entry problem

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:

Halting problem decider

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

Halting problem decider

M Convert M′ YES YES


State-entry
Inputs q
problem
w NO NO
w ? decider

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

M ′ halts on state q on input w

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

Since the halting problem is undecidable,


the state-entry problem is undecidable

END OF PROOF
14
Another example:

the halting problem

is reduced to

the blank-tape halting problem

15
The blank-tape halting problem

Input: Turing Machine M

Question: Does M halt when started with


a blank tape?

16
Theorem:
The blank-tape halting problem is undecidable

Proof: Reduce the halting problem to the

blank-tape halting problem

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:

Halting problem decider

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

Halting problem decider

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

• Then continues execution like M

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

M w halts when started with blank tape

23
Halting problem decider

blank-tape YES YES


M Generate M w halting problem
w Mw NO NO
decider

24
We reduced the halting problem
to the blank-tape halting problem

Since the halting problem is undecidable,


the blank-tape halting problem is undecidable

END OF PROOF
25
Summary of Undecidable Problems
Halting Problem:

Does machine M halt on input w?

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:

Does machine M enter state q


on input w ?

27
Uncomputable Functions

28
Uncomputable Functions

f Values
Domain
region

A function is uncomputable if it cannot


be computed for all of its domain

29
An uncomputable function:

maximum number of moves until


f (n) = any Turing machine with n states
halts when started with the blank tape

30
Theorem: Function f (n) is uncomputable

Proof: Assume for contradiction that


f (n) is computable

Then the blank-tape halting problem


is decidable
31
Decider for blank-tape halting problem:

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

However, the blank-tape halting


problem is undecidable

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?

All these problems are undecidable

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

Suppose we have a decider for the


empty language problem:

YES L(M ) empty


empty language
M problem
decider NO L(M ) not empty

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:

Membership problem decider

YES NO
M Mw empty language
problem
w decider NO YES

40
We need to convert one problem instance
to the other problem instance

Membership problem decider

YES NO
M Convert Mw empty language
inputs problem
w ? decider NO YES

41
Construct machine Mw :
On arbitrary input string s

M w executes the same as with M

When M enters a final state,


compare s with w

Accept only if s=w


42
w∈ L

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

You might also like