prof. busch - lsu1 reductions. prof. busch - lsu2 problem is reduced to problem if we can solve...
TRANSCRIPT
Prof. Busch - LSU 1
Reductions
Prof. Busch - LSU 2
Problem is reduced to problemX Y
If we can solve problem then we can solve problemX
Y
Prof. Busch - LSU 3
Language is reduced tolanguage
There is a computable function (reduction) such that:f
BwfAw )(
A
B
Definition: A B
w )(wf
Prof. Busch - LSU 4
Computable function : f
which for any string computes )(wfwThere is a deterministic Turing machineM
Recall:
Prof. Busch - LSU 5
If: a: Language is reduced to b: Language is decidableThen: is decidable
Theorem:
Proof:
A BB
A
Basic idea:Build the decider for using the decider for
A
B
Prof. Busch - LSU 6
Decider for B
Decider for A
compute
)(wf
)(wfw
accept
reject
accept
reject
(halt)
(halt)(halt)
(halt)
Inputstring
BwfAw )(
END OF PROOF
Reduction YES YES
NO NO
Prof. Busch - LSU 7
Example:
}languages same the accept that
DFAs are and :,{ 2121 MMMMEQUALDFA
} language empty the
accepts that DFA a is :{
MMEMPTYDFA
is reduced to:
Prof. Busch - LSU 8
Turing Machinefor reduction
DFADFA EMPTYMEQUALMM 21,
f21,MM M
MMf
21,
DFA
We only need to construct:
Prof. Busch - LSU 9
21,MM M
MMf
21,
Let be the language of DFA Let be the language of DFA
1L
2L1M
2M
)()()( 2121 LLLLML
construct DFA by combining and so that:
M
DFA
1M 2M
Turing Machinefor reduction f
Prof. Busch - LSU 10
)(21 MLLL
)()()( 2121 LLLLML
DFADFA EMPTYMEQUALMM 21,
Prof. Busch - LSU 11
Decider
Decider for
compute M
Inputstring
DFAEQUAL
21,MM 21,MMf DFAEMPTY
YESYES
NONO
Reduction
Prof. Busch - LSU 12
If: a: Language is reduced to b: Language is undecidableThen: is undecidable
Theorem (version 1):
A B
BA
(this is the negation of the previous theorem)
Proof:
Using the decider for build the decider forA
BSuppose is decidable B
Contradiction!
Prof. Busch - LSU 13
Decider for B
Decider for A
compute
)(wf
)(wfw
accept
reject
accept
reject
(halt)
(halt)(halt)
(halt)
Inputstring
BwfAw )(
Reduction
END OF PROOF
If is decidable then we can build:B
CONTRADICTION!
YES YES
NO NO
Prof. Busch - LSU 14
Observation:
In order to prove that some language is undecidablewe only need to reduce a known undecidable language to
B
BA
Prof. Busch - LSU 15
State-entry problem
Input: M•Turing Machine•State q
Question: Does M
•Stringw
enter state qwhile processing input string ?w
Corresponding language:
} string input on state enters
that machine Turing a is :,,{
wq
MqwMSTATE TM
Prof. Busch - LSU 16
Theorem:
(state-entry problem is unsolvable)
Proof: Reduce (halting problem) to (state-entry problem)
TMSTATE is undecidable
TMHALT
TMSTATE
Prof. Busch - LSU 17
Decider for
YES
NO
wM,
state-entry problem decider
TMSTATEDeciderCompute
Reduction
wMf ,
wqM ,,ˆ
TMHALT
YES
NO
Given the reduction,if is decidable,then is decidable
TMSTATE
TMHALT
A contradiction!sinceis undecidable
Halting Problem Decider
TMHALT
Prof. Busch - LSU 18
wM,Compute
Reduction
wMf ,wqM ,,ˆ
We only need to build the reduction:
TMHALTwM , TMSTATEqwM ,,ˆ
wMf ,
So that:
Prof. Busch - LSU 19
Mqhalting
states
specialhalt state
M̂
Rxx ,
Construct from :M̂ M
A transition for every unused tape symbol of x
iq
iq
Prof. Busch - LSU 20
M̂ halts on state qM halts
Mqhalting
states
specialhalt state
M̂
iq
Prof. Busch - LSU 21
M̂ halts on state on inputq
M halts on input w
w
Therefore:
Equivalently:
END OF PROOF
TMHALTwM , TMSTATEqwM ,,ˆ
Prof. Busch - LSU 22
Blank-tape halting problem
Input: MTuring Machine
Question: Does M halt when started with
a blank tape?
Corresponding language:
}tape blank on started when halts
that machin aTuring is :{ eMMBLANKTM
Prof. Busch - LSU 23
Theorem:
(blank-tape halting problem is unsolvable)
Proof: Reduce (halting problem) to (blank-tape problem)
TMBLANK is undecidable
TMHALT
TMBLANK
Prof. Busch - LSU 24
Decider for
YES
NO
wM,
blank-tape problem decider
DeciderCompute
Reduction
wMf ,
M̂
TMHALT
YES
NO
Given the reduction,If is decidable,then is decidableTMHALT
A contradiction!sinceis undecidable
Halting Problem Decider
TMHALT
TMBLANK
TMBLANK
Prof. Busch - LSU 25
wM,Compute
Reduction
wMf ,M̂
We only need to build the reduction:
TMHALTwM , TMBLANKM ˆ
wMf ,
So that:
Prof. Busch - LSU 26
no
yes
M̂
Write on tape w
Tape is blank?
Run
with input
Construct from :M̂ wM,
If halts then halt
M
w
M
Accept and halt
Prof. Busch - LSU 27
M̂ halts when started on blank tape
M halts on input
no
yesM
Write on tape w
Tape is blank?
Run
with inputw
M̂
w
Accept and halt
Prof. Busch - LSU 28
END OF PROOF
M̂ halts when started on blank tape
M halts on inputw
TMHALTwM , TMBLANKM ˆ
Equivalently:
Prof. Busch - LSU 29
If: a: Language is reduced to b: Language is undecidableThen: is undecidable
Theorem (version 2):
A B
BA
Proof:
Using the decider for build the decider for A
B
Suppose is decidable B
Contradiction!
Then is decidableB
Prof. Busch - LSU 30
Suppose is decidableB
Decider for B
s
accept
reject
(halt)
(halt)
Prof. Busch - LSU 31
Suppose is decidableB
Decider for B
s
accept
reject
(halt)
(halt)
Then is decidableB(we have proven this in previous class)
reject
accept(halt)
(halt)
Decider for BNO YES
YES NO
Prof. Busch - LSU 32
Decider for B
Decider for A
compute
)(wf
)(wfw
accept
reject
accept
reject
(halt)
(halt)(halt)
(halt)
Inputstring
BwfAw )(
Reduction
If is decidable then we can build:B
CONTRADICTION!
YES YES
NO NO
Prof. Busch - LSU 33
Decider for B
Decider for A
compute
)(wf
)(wfw
accept
reject accept
reject
(halt)
(halt)(halt)
(halt)
Inputstring
BwfAw )(
Reduction
END OF PROOFCONTRADICTION!
Alternatively:
NO YES
YES NO
Prof. Busch - LSU 34
Observation:
In order to prove that some language is undecidablewe only need to reduce some known undecidable languagetoor to B
(theorem version 1)
(theorem version 2)
B
AB
Prof. Busch - LSU 35
Undecidable Problems for Turing Recognizable languages
• is empty?L
L• is regular?
L• has size 2?
Let be a Turing-acceptable language L
All these are undecidable problems
Prof. Busch - LSU 36
• is empty?L
L• is regular?
L• has size 2?
Let be a Turing-acceptable language L
Prof. Busch - LSU 37
Empty language problem
Input: MTuring Machine
Question: Is )(ML empty?
Corresponding language:
} language empty the accepts
that machine aTuring is :{
MMEMPTYTM
?)( ML
Prof. Busch - LSU 38
Theorem:
(empty-language problem is unsolvable)
is undecidable
Proof: Reduce (membership problem) to
(empty language problem)
TMA
TMEMPTY
TMEMPTY
Prof. Busch - LSU 39
Decider for
YES
NO
wM,
empty problem decider
DeciderCompute
Reduction
wMf ,
M̂YES
NO
Given the reduction,if is decidable,then is decidable
membership problem decider
TMA
TMATMEMPTY
TMEMPTY
A contradiction!sinceis undecidable
TMA
Prof. Busch - LSU 40
wM,Compute
Reduction
wMf ,M̂
We only need to build the reduction:
TMATwM , TMEMPTYM ˆ
wMf ,
So that:
Prof. Busch - LSU 41
•Write on tape, and•Simulate on input
wM w M w
M̂
sTape of M̂
input string
accepts ?
Louisiana?s
Construct from :M̂ wM,
yes
Turing Machine
Accepts
yes
Prof. Busch - LSU 42
The only possible accepted string
Louisiana
Prof. Busch - LSU 42
s
Prof. Busch - LSU 42
•Write on tape, and•Simulate on input
wM w M waccepts
?
Louisiana?s
yes
Turing MachineM̂
Accepts
yes
Prof. Busch - LSU 43
accepts }Louisiana{)ˆ(MLM w
does notaccept
M w )ˆ(ML
Prof. Busch - LSU 43Prof. Busch - LSU 43Prof. Busch - LSU 43
•Write on tape, and•Simulate on input
wM w M waccepts
?
Louisiana?s
yes
Turing MachineM̂
Accepts
yes
Prof. Busch - LSU 44
Therefore:
acceptsM w )ˆ(ML
Equivalently:
TMATwM , TMEMPTYM ˆ
END OF PROOF
Prof. Busch - LSU 45
• is empty?L
L• is regular?
L• has size 2?
Let be a Turing-acceptable language L
Prof. Busch - LSU 46
Regular language problem
Input: MTuring Machine
Question: Is )(ML a regular language?
Corresponding language:
language} regular a accepts
that machine aTuring is :{ MMREGULARTM
Prof. Busch - LSU 47
Theorem:
(regular language problem is unsolvable)
is undecidable
Proof: Reduce (membership problem) to (regular language problem)
TMA
TMREGULAR
TMREGULAR
Prof. Busch - LSU 48
Decider for
YES
NO
wM,
regular problem decider
DeciderCompute
Reduction
wMf ,
M̂YES
NO
Given the reduction,If is decidable,then is decidable
membership problem decider
TMA
TMA
TMREGULAR
A contradiction!sinceis undecidable
TMATMREGULAR
Prof. Busch - LSU 49
wM,Compute
Reduction
wMf ,M̂
We only need to build the reduction:
TMATwM , TMREGULARM ˆ
wMf ,
So that:
Prof. Busch - LSU 50
sTape of M̂
input string
Construct from :M̂ wM,
Prof. Busch - LSU 50Prof. Busch - LSU 50Prof. Busch - LSU 50Prof. Busch - LSU 50
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
?kkbas
yes yes
Turing MachineM̂)0 some (for k
Prof. Busch - LSU 51
accepts }0:{)ˆ( nbaML nnM w
does notaccept
M w )ˆ(ML
not regular
regular
Prof. Busch - LSU 51Prof. Busch - LSU 51Prof. Busch - LSU 51Prof. Busch - LSU 51Prof. Busch - LSU 51
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
?kkbas
yes yes
Turing Machine)0 some (for k
M̂
Prof. Busch - LSU 52
Therefore:
acceptsM w )ˆ(ML
Equivalently:
TMATwM , TMREGULARM ˆ
END OF PROOF
is not regular
Prof. Busch - LSU 53
• is empty?L
L• is regular?
L• has size 2?
Let be a Turing-acceptable language L
Prof. Busch - LSU 54
Does have size 2 (two strings)?
Size2 language problem
Input: MTuring Machine
Question: )(ML
Corresponding language:
strings} two exactly accepts
that machine aTuring is :{2 MMSIZE TM
?2|)(| ML
Prof. Busch - LSU 55
Theorem:
(size2 language problem is unsolvable)
is undecidable
Proof: Reduce (membership problem) to (size 2 language problem)
TMA
TMSIZE 2
TMSIZE 2
Prof. Busch - LSU 56
Decider for
YES
NO
wM,
size2 problem decider
DeciderCompute
Reduction
wMf ,
M̂YES
NO
Given the reduction,If is decidable,then is decidable
membership problem decider
TMA
TMA
A contradiction!sinceis undecidable
TMA
TMSIZE 2
TMSIZE 2
Prof. Busch - LSU 57
wM,Compute
Reduction
wMf ,M̂
We only need to build the reduction:
TMATwM , TMSIZEM 2ˆ
wMf ,
So that:
Prof. Busch - LSU 58
sTape of M̂
input string
Construct from :M̂ wM,
Prof. Busch - LSU 58Prof. Busch - LSU 58Prof. Busch - LSU 58Prof. Busch - LSU 58Prof. Busch - LSU 58
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
?}Rouge,Baton{s
yes yes
Turing MachineM̂
Prof. Busch - LSU 59
accepts }Rouge,Baton{)ˆ( MLM w
does notaccept
M w )ˆ(ML
2 strings
0 strings
M̂
Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
?}Rouge,Baton{s
yes yes
Turing Machine
Prof. Busch - LSU 60
Therefore:
acceptsM w )ˆ(ML
Equivalently:
TMATwM , TMSIZEM 2ˆ
END OF PROOF
has size 2
Prof. Busch - LSU 61
RICE’s Theorem
• is empty?L
L• is regular?
L• has size 2?
Undecidable problems:
This can be generalized to all non-trivialproperties of Turing-acceptable languages
Prof. Busch - LSU 62
Non-trivial property:
A property possessed by some Turing-acceptable languages but not all
: is empty?LExample:
L
}Louisiana{L
YES
NO
}Rouge,Baton{LNO
P
1P
Prof. Busch - LSU 63
: is regular?
More examples of non-trivial properties:
L
}0:{ nbaL nn
YES
NO
L2P
}0:{ naL nYES
: has size 2?L3PLNO
YES
NO }Louisiana{L}Rouge,Baton{L
Prof. Busch - LSU 64
Trivial property:
A property possessed by ALL Turing-acceptable languages
P
: has size at least 0?LExamples: 4PTrue for all languages
: is accepted by some Turing machine?
L5P
True for allTuring-acceptable languages
Prof. Busch - LSU 65
We can describe a property as the setof languages that possess the property
P
: is empty?LExample:
1LYES
NO
NO
P
}{ 1LP
If language has property then PL PL
}Louisiana{2 L
}Rouge,Baton{3 L
Prof. Busch - LSU 66
: has size 1?LP
}{a
},{ a
NO
NO
YES
Example: Suppose alphabet is }{a
}{aa},{ aa
}{aaa}{},{ aaa
}},{},{},{},{},{{ aaaaaaaaaaP
},,{ aaaNO },,{ aaaaaaaaa
Prof. Busch - LSU 67
Non-trivial property problem
Does have the non-trivial property ?
Input: MTuring Machine
Question: )(ML
Corresponding language:
})( is, that , property
trivial-non the has )( that such
machine aTuring is :{
PMLP
ML
MMPROPERTYTM
?)( PML P
Prof. Busch - LSU 68
Rice’s Theorem: TMPROPERTY is undecidable
(the non-trivial property problem is unsolvable)
Proof: Reduce (membership problem)
to
TMA
TMPROPERTY TMPROPERTYor
Prof. Busch - LSU 69
We examine two cases:
Case 1:
Case 2:
P
P
Examples: : is empty?)(MLP
: is regular?)(MLP
: has size 2?)(MLPExample:
Prof. Busch - LSU 70
Let be the Turing machine thataccepts
Case 1: P
Since is non-trivial, there is a Turing-acceptable languagesuch that:
PX
PX
XM
X
Prof. Busch - LSU 71
Reduce (membership problem) to
TMA
TMPROPERTY
Prof. Busch - LSU 72
Decider for
YES
NO
wM,
Non-trivial property problem decider
DeciderCompute
Reduction
wMf ,
M̂YES
NO
Given the reduction,if is decidable,then is decidable
membership problem decider
TMA
TMA
A contradiction!sinceis undecidable
TMA
TMPROPERTY
TMPROPERTY
Prof. Busch - LSU 73
wM,Compute
Reduction
wMf ,M̂
We only need to build the reduction:
TMATwM , TMPROPERTYM ˆ
wMf ,
So that:
Prof. Busch - LSU 74
sTape of M̂
input string
Construct from :M̂ wM,
?Xs
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
yes yes
Turing MachineM̂
Prof. Busch - LSU 75
For this we can run machine ,that accepts language , with input string
XMX
s
?Xs
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
yes yes
Turing MachineM̂
Prof. Busch - LSU 76
accepts XML )ˆ(M w
does notaccept
M w )ˆ(ML
P
P
Prof. Busch - LSU 76
?Xs
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
yes yes
Turing MachineM̂
Prof. Busch - LSU 77
Therefore:
acceptsM w PML )ˆ(
Equivalently:
TMATwM , TMPROPERTYM ˆ
Prof. Busch - LSU 78
Let be the Turing machine thataccepts
Case 2: P
Since is non-trivial, there is a Turing-acceptable languagesuch that:
PX
PX
XM
X
Prof. Busch - LSU 79
Reduce (membership problem) to
TMA
TMPROPERTY
Prof. Busch - LSU 80
Decider for
YES
NO
wM,
Non-trivial property problem decider
DeciderCompute
Reduction
wMf ,
M̂YES
NO
Given the reduction,if is decidable,then is decidable
membership problem decider
TMA
TMA
A contradiction!sinceis undecidable
TMA
TMPROPERTY
TMPROPERTY
Prof. Busch - LSU 81
wM,Compute
Reduction
wMf ,M̂
We only need to build the reduction:
TMATwM , TMPROPERTYM ˆ
wMf ,
So that:
Prof. Busch - LSU 82
sTape of M̂
input string
Construct from :M̂ wM,
?Xs
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
yes yes
Turing MachineM̂
Prof. Busch - LSU 83
accepts XML )ˆ(M w
does notaccept
M w )ˆ(ML
P
PM̂
?Xs
•Write on tape, and•Simulate on input
wM w M w
Accepts
accepts ?
yes yes
Turing Machine
Prof. Busch - LSU 84
Therefore:
acceptsM w PML )ˆ(
Equivalently:
TMATwM , TMPROPERTYM ˆ
END OF PROOF