Courtesy Costas Busch - RPI 1
Reducibility
Courtesy Costas Busch - RPI 2
Problem is reduced to problemA B
If we can solve problem thenwe can solve problem
BA
B
A
Courtesy Costas Busch - RPI 3
If is undecidable then is undecidable
If is decidable then is decidableB A
A B
Problem is reduced to problemA B
Courtesy Costas Busch - RPI 4
Example: the halting problem
is reduced to
the state-entry problem
Courtesy Costas Busch - RPI 5
The state-entry problem
Inputs: M•Turing Machine
•State q
Question: Does M
•Stringw
enter state q
on input ?w
Courtesy Costas Busch - RPI 6
Theorem:
The state-entry problem is undecidable
Proof: Reduce the halting problem to
the state-entry problem
Courtesy Costas Busch - RPI 7
state-entryproblem decider
M
w
q
YES
NO
entersM q
doesn’t enterM q
Suppose we have a Deciderfor the state-entry algorithm:
Courtesy Costas Busch - RPI 8
Halting problemdecider
M
w
YES
NO
halts onM w
doesn’t halt onM w
We want to build a deciderfor the halting problem:
Courtesy Costas Busch - RPI 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:
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 12
M halts on input
M halts on state on input q
if and only if
w
w
Courtesy Costas Busch - RPI 13
Generate
M M
w
M qw
Halting problem decider
YES
NO
YES
NO
State-entryproblemdecider
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 15
Another example:
the halting problem
is reduced to
the blank-tape halting problem
Courtesy Costas Busch - RPI 16
The blank-tape halting problem
Input: MTuring Machine
Question: Does M halt when started with
a blank tape?
Courtesy Costas Busch - RPI 17
Theorem:
Proof:Reduce the halting problem to the
blank-tape halting problem
The blank-tape halting problem is undecidable
Courtesy Costas Busch - RPI 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:
Courtesy Costas Busch - RPI 19
halting problemdecider
M
w
YES
NO
halts onM w
doesn’t halt onM w
We want to build a deciderfor the halting problem:
Courtesy Costas Busch - RPI 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:
Courtesy Costas Busch - RPI 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 ?
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 23
M halts on input string
wM halts when started with blank tape
if and only if
w
Courtesy Costas Busch - RPI 24
Generate
wMM
w
blank-tapehalting problemdecider
Halting problem decider
YES
NOwM
YES
NO
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 26
Does machine halt on input ?
Summary of Undecidable Problems
Halting Problem:
M w
Membership problem:
Does machine accept string ?M w
Courtesy Costas Busch - RPI 27
Does machine enter state on input ?
Does machine halt when startingon blank tape?
Blank-tape halting problem:
M
State-entry Problem:
Mw
q
Courtesy Costas Busch - RPI 28
Uncomputable Functions
Courtesy Costas Busch - RPI 29
Uncomputable Functions
A function is uncomputable if it cannotbe computed for all of its domain
Domain Valuesregion
f
Courtesy Costas Busch - RPI 30
An uncomputable function:
)(nfmaximum number of moves untilany Turing machine with stateshalts when started with the blank tape
n
Courtesy Costas Busch - RPI 31
Theorem:Function is uncomputable)(nf
Proof:
Then the blank-tape halting problem is decidable
Assume for contradiction that is computable)(nf
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 33
Therefore, the blank-tape haltingproblem is decidable
However, the blank-tape haltingproblem is undecidable
Contradiction!!!
Courtesy Costas Busch - RPI 34
Therefore, function in uncomputable)(nf
END OF PROOF
Courtesy Costas Busch - RPI 35
Undecidable Problems for
Recursively Enumerable Languages
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 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 )(
Courtesy Costas Busch - RPI 39
membershipproblemdecider
M
w
YES
NO
acceptsM w
rejectsM w
We will build the decider for the membership problem:
Courtesy Costas Busch - RPI 40
YES
NO
M
w
NO
YES
Membership problem decider
wM empty languageproblemdecider
We want to reduce the membership problem tothe empty language problem:
Courtesy Costas Busch - RPI 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 ?
Courtesy Costas Busch - RPI 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
Courtesy Costas Busch - RPI 43
Lw
)( wML is not empty
if and only if
}{)( wML w
Courtesy Costas Busch - RPI 44
construct
wM
YES
NO
M
w
NO
YES
Membership problem decider
wM
END OF PROOF
empty languageproblemdecider