Reductions
Problem is reduced to problem If we can solve problem then we can solve problem
Definition: Language is reduced to language There is a computable function (reduction) such that:
Recall: Computable function : There is a deterministic Turing machine which for any string computes
Theorem: If: a: Language is reduced to b: Language is decidable Then: is decidable Proof: Basic idea: Build the decider for using the decider for
Decider for Reduction compute Decider for END OF PROOF Input string YES Input string YES accept accept compute Decider for (halt) (halt) NO NO reject reject (halt) (halt) END OF PROOF
Example: is reduced to:
We only need to construct: Turing Machine for reduction DFA
Let be the language of DFA Turing Machine for reduction DFA construct DFA by combining and so that:
Decider for Reduction Input string YES compute YES Decider NO NO
If: a: Language is reduced to b: Language is undecidable Theorem (version 1): If: a: Language is reduced to b: Language is undecidable Then: is undecidable (this is the negation of the previous theorem) Proof: Suppose is decidable Using the decider for build the decider for Contradiction!
If is decidable then we can build: Decider for Reduction YES Input string YES accept accept compute Decider for (halt) (halt) NO NO reject reject (halt) (halt) CONTRADICTION! END OF PROOF
Observation: In order to prove that some language is undecidable we only need to reduce a known undecidable language to
State-entry problem Input: Turing Machine State String Question: Does enter state while processing input string ? Corresponding language:
Theorem: is undecidable (state-entry problem is unsolvable) Proof: Reduce (halting problem) to (state-entry problem)
Decider for Reduction Compute Decider Given the reduction, Halting Problem Decider Decider for state-entry problem decider Reduction YES YES Compute Decider NO NO Given the reduction, if is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : special halt state halting states A transition for every unused tape symbol of
special halt state halting states halts halts on state
Therefore: halts on input halts on state on input Equivalently: END OF PROOF
Blank-tape halting problem Input: Turing Machine Question: Does halt when started with a blank tape? Corresponding language:
Theorem: is undecidable Proof: Reduce (halting problem) to (blank-tape halting problem is unsolvable) Proof: Reduce (halting problem) to (blank-tape problem)
Decider for Reduction Compute Decider Given the reduction, Halting Problem Decider Decider for blank-tape problem decider Reduction YES YES Compute Decider NO NO Given the reduction, If is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : no yes Run with input If halts then halt Tape is blank? yes Run Write on tape with input If halts then halt
halts when started on blank tape no Tape is blank? yes Run Write on tape with input halts on input halts when started on blank tape
halts when started on blank tape halts on input halts when started on blank tape Equivalently: END OF PROOF
Theorem (version 2): If: a: Language is reduced to b: Language is undecidable Then: is undecidable Proof: Suppose is decidable Then is decidable Using the decider for build the decider for Contradiction!
Suppose is decidable reject Decider for (halt) accept (halt)
Suppose is decidable Then is decidable Decider for Decider for (we have proven this in previous class) Decider for NO YES reject accept Decider for (halt) (halt) YES NO accept reject (halt) (halt)
If is decidable then we can build: Decider for Reduction YES Input string YES accept accept compute Decider for (halt) (halt) NO NO reject reject (halt) (halt) CONTRADICTION!
Alternatively: Decider for Reduction compute Decider for NO Input string YES reject accept compute Decider for (halt) (halt) YES NO accept reject (halt) (halt) CONTRADICTION! END OF PROOF
that some language is undecidable we only need to reduce some Observation: In order to prove that some language is undecidable we only need to reduce some known undecidable language to or to (theorem version 1) (theorem version 2)
Undecidable Problems for Turing Recognizable languages Let be a Turing-acceptable language is empty? is regular? has size 2? All these are undecidable problems
Let be a Turing-acceptable language is empty? is regular? has size 2?
Empty language problem Input: Turing Machine Question: Is empty? Corresponding language:
(empty language problem) Theorem: is undecidable (empty-language problem is unsolvable) Proof: Reduce (membership problem) to (empty language problem)
Decider for Reduction Compute Decider Given the reduction, membership problem decider Decider for empty problem decider Reduction YES YES Compute Decider NO NO Given the reduction, if is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : Tape of input string yes write skip input run on tape on input yes If accepts ? then accept
Tape of yes write skip input run on tape string on input If accepts ? then accept
Tape of yes write skip input run on tape string on input If accepts ? then accept
During this phase this area is not touched working area of skip input string write on tape run on input yes If accepts ? then accept
Simply check if entered an accept state altered skip input string write on tape run on input yes If accepts ? then accept
Now check input string yes write skip input run on tape string on input yes If accepts ? then accept
The only possible accepted string t r o y skip input string write on tape run on input yes If accepts ? then accept
yes accepts does not accept write skip input run on tape string on input yes If accepts ? then accept
Therefore: accepts Equivalently: END OF PROOF
Let be a Turing-acceptable language is empty? is regular? has size 2?
Regular language problem Input: Turing Machine Question: Is a regular language? Corresponding language:
(regular language problem) Theorem: is undecidable (regular language problem is unsolvable) Proof: Reduce (membership problem) to (regular language problem)
Decider for Reduction Compute Decider Given the reduction, membership problem decider Decider for regular problem decider Reduction YES YES Compute Decider NO NO Given the reduction, If is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : Tape of input string yes write skip input run on tape on input yes If has the form accepts ? then accept
yes not regular accepts does not accept regular write skip input run string write on tape run on input yes If has the form accepts ? then accept
Therefore: accepts is not regular Equivalently: END OF PROOF
Let be a Turing-acceptable language is empty? is regular? has size 2?
Corresponding language: Size2 language problem Input: Turing Machine Question: Does have size 2? (accepts exactly two strings?) Corresponding language:
(size 2 language problem) Theorem: is undecidable (regular language problem is unsolvable) Proof: Reduce (membership problem) to (size 2 language problem)
Decider for Reduction Compute Decider Given the reduction, membership problem decider Decider for size2 problem decider Reduction YES YES Compute Decider NO NO Given the reduction, If is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : Tape of input string yes write skip input run on tape on input yes If accepts ? then accept
yes 2 strings accepts does not accept 0 strings write skip input run on tape run on input yes If accepts ? then accept
Therefore: accepts has size 2 Equivalently: END OF PROOF
RICE’s Theorem Undecidable problems: is empty? is regular? has size 2? This can be generalized to all non-trivial properties of Turing-acceptable languages
Non-trivial property: A property possessed by some Turing-acceptable languages but not all Example: : is empty? YES NO NO
More examples of non-trivial properties: : is regular? YES YES NO : has size 2? NO NO YES
Trivial property: A property possessed by ALL Turing-acceptable languages Examples: : has size at least 0? True for all languages : is accepted by some Turing machine? True for all Turing-acceptable languages
We can describe a property as the set of languages that possess the property If language has property then Example: : is empty? YES NO NO
Example: Suppose alphabet is : has size 1? NO YES NO NO
Non-trivial property problem Input: Turing Machine Question: Does have the non-trivial property ? Corresponding language:
Rice’s Theorem: is undecidable Proof: Reduce (membership problem) to (the non-trivial property problem is unsolvable) Proof: Reduce (membership problem) to or
We examine two cases: Case 1: Examples: : is empty? : is regular? Case 2: Example: : has size 2?
Case 1: Since is non-trivial, there is a Turing-acceptable language such that: Let be the Turing machine that accepts
Reduce (membership problem) to
Decider for Reduction Compute Decider Given the reduction, membership problem decider Decider for Non-trivial property problem decider Reduction YES YES Compute Decider NO NO Given the reduction, if is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : Tape of input string yes write skip input run on tape on input If yes accepts ? then accept
For this phase we can run machine that accepts , with input string skip input string write on tape run on input If yes accepts ? then accept
yes accepts does not accept write skip input run on tape string on input If yes accepts ? then accept
Therefore: accepts Equivalently:
Case 2: Since is non-trivial, there is a Turing-acceptable language such that: Let be the Turing machine that accepts
Reduce (membership problem) to
Decider for Reduction Compute Decider Given the reduction, membership problem decider Decider for Non-trivial property problem decider Reduction YES YES Compute Decider NO NO Given the reduction, if is decidable, then is decidable A contradiction! since is undecidable
We only need to build the reduction: Compute So that:
Construct from : Tape of input string yes write skip input run on tape on input If yes accepts ? then accept
yes accepts does not accept write skip input run on tape string on input If yes accepts ? then accept
Therefore: accepts Equivalently: END OF PROOF
This Summary is an Online Content from this Book: Michael Sipser, Introduction to the Theory of Computation, 2ndEdition It is edited for Computation Theory Course 6803415-3 by: T.Mariah Sami Khayat Teacher Assistant @ Adam University College For Contacting: mskhayat@uqu.edu.sa Kingdom of Saudi Arabia Ministry of Education Umm AlQura University Adam University College Computer Science Department المملكة العربية السعودية وزارة التعليم جامعة أم القرى الكلية الجامعية أضم قسم الحاسب الآلي