Decidability Reductions
Decidability Reductions
Decidability Reductions
There is a computable
function f (reduction) such that:
w A f (w ) B
Computable function f :
There is a deterministic Turing machine M
which for any string w computes f (w)
Proof:
Basic idea:
Build the decider for A
using the decider for B
w A f (w ) B
END OF PROOF
Fall 2006 Costas Busch - RPI 6
Example:
is reduced to:
Turing Machine
M1 , M2 for reduction f f M1 , M2
M DFA
M1 , M2 EQUALDFA M EMPTYDFA
Turing Machine
M1 , M2 for reduction f f M1 , M2
M DFA
construct DFA M
by combining M1 and M2 so that:
L1 L2 L(M )
M1 , M2 EQUALDFA M EMPTYDFA
w A f (w ) B
CONTRADICTION!
END OF PROOF
Fall 2006 Costas Busch - RPI 13
Observation:
In order to prove
that some language B is undecidable
we only need to reduce a
known undecidable language A
to B
Proof: Reduce
HALTTM (halting problem)
to
STATETM (state-entry problem)
Reduction
Compute
M ,w Mˆ, q ,w
f M ,w
f M ,w
So that:
Equivalently:
END OF PROOF
Fall 2006 Costas Busch - RPI 21
Blank-tape halting problem
Corresponding language:
BLANKTM { M : M is aTuring machine that
halts when started on blank tape}
Fall 2006 Costas Busch - RPI 22
Theorem: BLANKTM is undecidable
Proof: Reduce
HALTTM (halting problem)
to
BLANKTM (blank-tape problem)
Reduction
Compute
M ,w M̂
f M ,w
f M ,w
So that:
M ,w HALTTM Mˆ BLANKTM
no
Tape is blank?
yes
Run M
Write w on tape
with input w
no
Tape is blank?
yes
Run M
Write w on tape
with input w
M halts on input w
Equivalently:
M ,w HALTTM Mˆ BLANKTM
END OF PROOF
Fall 2006 Costas Busch - RPI 28
Theorem (version 2):
If: a: Language A is reduced to B
b: Language A is undecidable
Then: B is undecidable
Contradiction!
Fall 2006 Costas Busch - RPI 29
Suppose B is decidable
reject
Decider (halt)
s
for B
accept
(halt)
Decider for B
NO YES
reject accept
(halt)
Decider (halt)
s
for B YES NO
accept reject
(halt)
(halt)
w A f (w ) B
CONTRADICTION!
Fall 2006 Costas Busch - RPI 32
Alternatively:
Decider for A
Reduction NO
Input reject YES
accept
string compute f (w ) Decider (halt) (halt)
w
f (w ) for B YES NO
accept reject
(halt)
(halt)
w A f (w ) B
CONTRADICTION!
END OF PROOF
Fall 2006 Costas Busch - RPI 33
Observation:
In order to prove
that some language B is undecidable
we only need to reduce some
known undecidable language A
to B (theorem version 1)
or to B (theorem version 2)
• L is empty?
• L is regular?
• L has size 2?
• L is empty?
• L is regular?
• L has size 2?
Corresponding language:
EMPTYTM { M : M is aTuring machine that
accepts the empty language }
Fall 2006 Costas Busch - RPI 37
Theorem: EMPTYTM is undecidable
(empty-language problem is unsolvable)
Proof: Reduce
ATM (membership problem)
to
EMPTYTM (empty language problem)
Reduction
Compute
M ,w M̂
f M ,w
f M ,w
So that:
M ,w ATTM Mˆ EMPTYTM
If s troy yes
M accepts w ?
then accept s
If s troy yes
M accepts w ?
then accept s
If s troy yes
M accepts w ?
then accept s
s w
working area of M
M̂
skip input write w run M
string s on tape on input w
If s troy yes
M accepts w ?
then accept s
s altered w
M̂
skip input write w run M
string s on tape on input w
If s troy yes
M accepts w ?
then accept s
If s troy yes
M accepts w ?
then accept s
M̂
skip input write w run M
string s on tape on input w
If s troy yes
M accepts w ?
then accept s
M̂
skip input write w run M
string s on tape on input w
If s troy yes
M accepts w ?
then accept s
M accepts w L(Mˆ)
Equivalently:
M ,w ATTM Mˆ EMPTYTM
END OF PROOF
Fall 2006 Costas Busch - RPI 49
Let L be a Turing-acceptable language
• L is empty?
• L is regular?
• L has size 2?
Corresponding language:
REGULARTM { M : M is aTuring machine that
accepts a regular language}
Fall 2006 Costas Busch - RPI 51
Theorem: REGULARTM is undecidable
Proof: Reduce
ATM (membership problem)
to
REGULARTM (regular language problem)
Reduction
Compute
M ,w M̂
f M ,w
f M ,w
So that:
M ,w ATTM Mˆ REGULARTM
does not
M w L(Mˆ) regular
accept
M̂
skip input write w run M
string s on tape on input w
Equivalently:
M ,w ATTM Mˆ REGULARTM
END OF PROOF
Fall 2006 Costas Busch - RPI 57
Let L be a Turing-acceptable language
• L is empty?
• L is regular?
• L has size 2?
Corresponding language:
SIZE 2TM { M : M is aTuring machine that
accepts exactly two strings}
Fall 2006 Costas Busch - RPI 59
Theorem: SIZE 2TM is undecidable
(regular language problem is unsolvable)
Proof: Reduce
ATM (membership problem)
to
SIZE 2TM (size 2 language problem)
Reduction
Compute
M ,w M̂
f M ,w
f M ,w
So that:
does not
M w L(Mˆ) 0 strings
accept
M̂
skip input write w run M
string s on tape on input w
Equivalently:
END OF PROOF
Fall 2006 Costas Busch - RPI 65
RICE’s Theorem
Undecidable problems:
• L is empty?
• L is regular?
• L has size 2?
Example: P1 : L is empty?
YES L
NO L {troy }
NO L {troy , albany }
P3 : L has size 2?
NO L
NO L {troy }
YES L {troy , albany }
Fall 2006 Costas Busch - RPI 68
Trivial property:
A property P possessed by ALL
Turing-acceptable languages
Example: P : L is empty?
YES L
P { } NO L {troy }
NO L {troy , albany }
P : L has size 1?
NO
YES { } {a } {aa } {aaa }
NO { , a } { , aa } {a , aa }
NO { , a , aa } {aa , aaa , aaaa }
Corresponding language:
Proof: Reduce
ATM (membership problem)
to
PROPERTYTM or PROPERTYTM
Case 1: P
Examples: P : L(M ) is empty?
P : L(M ) is regular?
Case 2: P
Reduction
Compute
M ,w M̂
f M ,w
f M ,w
So that:
M ,w ATTM Mˆ PROPERTYTM
If s X yes
M accepts w ?
then accept s
M̂
skip input write w run M
string s on tape on input w
If s X yes
M accepts w ?
then accept s
If s X yes
M accepts w ?
then accept s
M accepts w L(Mˆ) P
Equivalently:
M ,w ATTM Mˆ PROPERTYTM
Reduction
Compute
M ,w M̂
f M ,w
f M ,w
So that:
M ,w ATTM Mˆ PROPERTYTM
If s X yes
M accepts w ?
then accept s
If s X yes
M accepts w ?
then accept s
M accepts w L(Mˆ) P
Equivalently:
M ,w ATTM Mˆ PROPERTYTM
END OF PROOF
Fall 2006 Costas Busch - RPI 89