reducibility
DESCRIPTION
Reducibility. Problem is reduced to problem. If we can solve problem then we can solve problem. Problem is reduced to problem. If is decidable then is decidable. If is undecidable then is undecidable. Example:. the halting problem. is reduced to. - PowerPoint PPT PresentationTRANSCRIPT
Fall 2004 COMP 335 1
Reducibility
Fall 2004 COMP 335 2
Problem is reduced to problemA B
If we can solve problem thenwe can solve problem
BA
B
A
Fall 2004 COMP 335 3
If is undecidable then is undecidable
If is decidable then is decidableB A
A B
Problem is reduced to problemA B
Fall 2004 COMP 335 4
Example: the halting problem
is reduced to
the state-entry problem
Fall 2004 COMP 335 5
The state-entry problem
Inputs: M•Turing Machine
•State q
Question: Does M
•Stringw
enter state q
on input ?w
Fall 2004 COMP 335 6
Theorem:
The state-entry problem is undecidable
Proof: Reduce the halting problem to
the state-entry problem
Fall 2004 COMP 335 7
state-entryproblem decider
M
w
q
YES
NO
entersM q
doesn’t enterM q
Suppose we have a Deciderfor the state-entry algorithm:
Fall 2004 COMP 335 8
Halting problemdecider
M
w
YES
NO
halts onM w
doesn’t halt onM w
We want to build a deciderfor the halting problem:
Fall 2004 COMP 335 9
M qw
State-entryproblemdecider
Halting problem decider
YES
NO
YES
NO
M
w
We want to reduce the halting problem tothe state-entry problem:
Fall 2004 COMP 335 10
M qw
Halting problem decider
YES
NO
YES
NO
M
w
ConvertInputs ?
We need to convert one problem instanceto the other problem instance
State-entryproblemdecider
Fall 2004 COMP 335 11
Convert to :M
•Add new state q
•From any halting state of add transitions to q
M q
halting statesSinglehalt state
M
M
M
Fall 2004 COMP 335 12
M halts on input
M halts on state on input q
if and only if
w
w
Fall 2004 COMP 335 13
Generate
M M
w
M qw
Halting problem decider
YES
NO
YES
NO
State-entryproblemdecider
Fall 2004 COMP 335 14
Since the halting problem is undecidable,the state-entry problem is undecidable
END OF PROOF
We reduced the halting problemto the state-entry problem
Fall 2004 COMP 335 15
Another example:
the halting problem
is reduced to
the blank-tape halting problem
Fall 2004 COMP 335 16
The blank-tape halting problem
Input: MTuring Machine
Question: Does M halt when started with
a blank tape?
Fall 2004 COMP 335 17
Theorem:
Proof:Reduce the halting problem to the
blank-tape halting problem
The blank-tape halting problem is undecidable
Fall 2004 COMP 335 18
blank-tape halting problemdecider
M
YES
NO
halts onblank tape
M
doesn’t halton blank tape
M
Suppose we have a decider for the blank-tape halting problem:
Fall 2004 COMP 335 19
halting problemdecider
M
w
YES
NO
halts onM w
doesn’t halt onM w
We want to build a deciderfor the halting problem:
Fall 2004 COMP 335 20
M
w
Blank-tapehalting problemdecider
Halting problem decider
YES
NOwM
YES
NO
We want to reduce the halting problem tothe blank-tape halting problem:
Fall 2004 COMP 335 21
M
w
Blank-tapehalting problemdecider
Halting problem decider
YES
NOwM
YES
NO
We need to convert one problem instanceto the other problem instance
ConvertInputs ?
Fall 2004 COMP 335 22
wMConstruct a new machine
• When started on blank tape, writesw
• Then continues execution like M
wM
Mthen write w
step 1 step2
if blank tape executewith input w
Fall 2004 COMP 335 23
M halts on input string
wM halts when started with blank tape
if and only if
w
Fall 2004 COMP 335 24
Generate
wMM
w
blank-tapehalting problemdecider
Halting problem decider
YES
NOwM
YES
NO
Fall 2004 COMP 335 25
Since the halting problem is undecidable,the blank-tape halting problem is undecidable
END OF PROOF
We reduced the halting problemto the blank-tape halting problem
Fall 2004 COMP 335 26
Does machine halt on input ?
Summary of Undecidable Problems
Halting Problem:
M w
Membership problem:
Does machine accept string ?M w
Fall 2004 COMP 335 27
Does machine enter state on input ?
Does machine halt when startingon blank tape?
Blank-tape halting problem:
M
State-entry Problem:
Mw
q
Fall 2004 COMP 335 28
Uncomputable Functions
Fall 2004 COMP 335 29
Uncomputable Functions
A function is uncomputable if it cannotbe computed for all of its domain
Domain Valuesregion
f
Fall 2004 COMP 335 30
An uncomputable function:
)(nfmaximum number of moves untilany Turing machine with stateshalts when started with the blank tape
n
Fall 2004 COMP 335 31
Theorem:Function is uncomputable)(nf
Proof:
Then the blank-tape halting problem is decidable
Assume for contradiction that is computable)(nf
Fall 2004 COMP 335 32
Decider for blank-tape halting problem:
Input: machineM
1. Count states of : M m
2. Compute )(mf
3. Simulate for steps starting with empty tape
M )(mf
If halts then return YES otherwise return NO
M
Fall 2004 COMP 335 33
Therefore, the blank-tape haltingproblem is decidable
However, the blank-tape haltingproblem is undecidable
Contradiction!!!
Fall 2004 COMP 335 34
Therefore, function in uncomputable)(nf
END OF PROOF
Fall 2004 COMP 335 35
Undecidable Problems for
Recursively Enumerable Languages
Fall 2004 COMP 335 36
• is empty?L
L• is finite?
L• contains two different strings of the same length?
Take a recursively enumerable language L
Decision problems:
All these problems are undecidable
Fall 2004 COMP 335 37
Theorem:
For any recursively enumerable language Lit is undecidable to determine whether is empty L
Proof:
We will reduce the membership problemto this problem
Fall 2004 COMP 335 38
empty languageproblemdecider
M
YES
NO
Suppose we have a decider for theempty language problem:
Let be the TM withM
)(ML
)(ML
empty
not empty
LML )(
Fall 2004 COMP 335 39
membershipproblemdecider
M
w
YES
NO
acceptsM w
rejectsM w
We will build the decider for the membership problem:
Fall 2004 COMP 335 40
YES
NO
M
w
NO
YES
Membership problem decider
wM empty languageproblemdecider
We want to reduce the membership problem tothe empty language problem:
Fall 2004 COMP 335 41
YES
NO
M
w
NO
YES
Membership problem decider
wM empty languageproblemdecider
We need to convert one problem instanceto the other problem instance
Convertinputs ?
Fall 2004 COMP 335 42
Construct machine : wM
When enters a final state, compare with w
M
Accept only if ws
wM executes the same as with M
On arbitrary input strings
s
Fall 2004 COMP 335 43
Lw
)( wML is not empty
if and only if
}{)( wML w
Fall 2004 COMP 335 44
construct
wM
YES
NO
M
w
NO
YES
Membership problem decider
wM
END OF PROOF
empty languageproblemdecider