Download presentation
Presentation is loading. Please wait.
1
Automata, Grammars and Languages
CSC 473 Automata, Grammars and Languages 7/23/2018 Automata, Grammars and Languages Discourse 07 Reduction x C SC 473 Automata, Grammars and Languages
2
Reduction of One Problem to Another
CSC 473 Automata, Grammars and Languages Reduction of One Problem to Another 7/23/2018 Often want to solve a new problem P similar to a problem Q that has already been solved. One way of solving P is to transform each instance of P into an instance of the known problem Q, then solve the Q instance, and then use it to obtain a solution to the P instance. The solution to P uses the solution to Q as a “subroutine”. We often write P Q for “P is reducible to Q” Ex: Squaring Multiplication: Ex: Multiplication Squaring: Ex: DFA Equivalence DFA Emptiness C SC 473 Automata, Grammars and Languages
3
Using Reduction to Prove “Difficulty”
CSC 473 Automata, Grammars and Languages Using Reduction to Prove “Difficulty” 7/23/2018 If P Q and P is known to be “hard to solve”, then Q must be hard to solve too. For example¶, if P Q and P is undecidable, then Q must also be undecidable. For if Q is decidable, we can use the reduction P Q to construct a decider for P; contradiction. Ex: We will show by reduction that the problem is reducible to the problem The undecidability of will imply the undecidability of _______________________________ ¶Here stands for many-one or mapping reduction denoted m . It will be defined precisely later. C SC 473 Automata, Grammars and Languages
4
Undecidability via Reductions: Halting
CSC 473 Automata, Grammars and Languages Undecidability via Reductions: Halting 7/23/2018 HALTING PROBLEM ACCEPTANCE (MEMBERSHIP) PROBLEM Thm 5.1: is undecidable. Pf: We show that so that if we had a decider for we could build a decider for This contradicts the undecidability of , and so must be undecidable. Assume, contrary to what is to be proved, that has a decider R. Following is a visual proof that is reducible to : C SC 473 Automata, Grammars and Languages
5
Undecidability via Reductions (cont.)
CSC 473 Automata, Grammars and Languages Undecidability via Reductions (cont.) 7/23/2018 Consider a “compiler” (algorithm) C that given M constructs a new TM C( M ) as follows: Reduction: use this and R to build a decider for acc acc rej loop acc rej So S is a decider for Contradiction theorem. C SC 473 Automata, Grammars and Languages
6
Undecidability: Empty Tape Acceptance
CSC 473 Automata, Grammars and Languages Undecidability: Empty Tape Acceptance 7/23/2018 Thm: The EMPTY-TAPE-ACCEPTANCE problem is undecidable: Pf: We will show that Consider a “compiler” C that given M,w constructs TM C(M,w ): acc acc rej rej Summarze here 3/2/04. Compare this reduction to next slide. In fact: C SC 473 Automata, Grammars and Languages
7
Empty Tape Acceptance (cont’d)
CSC 473 Automata, Grammars and Languages Empty Tape Acceptance (cont’d) 7/23/2018 Reduction: assume a decider R for We construct a decider from it for E is a decider for Contradiction. acc acc rej rej Summarze here 3/2/04. Compare this reduction to next slide. C SC 473 Automata, Grammars and Languages
8
Undecidability: Empty Set Acceptance
CSC 473 Automata, Grammars and Languages Undecidability: Empty Set Acceptance 7/23/2018 Thm: The EMPTY-SET-ACCEPTANCE problem is undecidable: Pf: We will show that We reduce the complement of to this problem. Consider a “compiler” C that given M,w constructs TM C(M,w ): rej acc Summarze here 3/2/04. Compare this reduction to next slide. C SC 473 Automata, Grammars and Languages
9
Empty Set Acceptance (cont’d)
CSC 473 Automata, Grammars and Languages Empty Set Acceptance (cont’d) 7/23/2018 Reduction: assume a decider R for We construct a decider from it for E is a decider for Contradiction theorem acc acc rej rej Summarze here 3/2/04. Compare this reduction to next slide. C SC 473 Automata, Grammars and Languages
10
Undecidability: Regular Set Acceptance
CSC 473 Automata, Grammars and Languages Undecidability: Regular Set Acceptance 7/23/2018 Thm 5.3: The REGULAR-SET-ACCEPTANCE problem is undecidable: Pf: We will show that Consider a “compiler” C that given M,w constructs TM C(M,w ): (2) acc acc (1) Summarze here 3/2/04. Compare this reduction to next slide. rej acc rej C SC 473 Automata, Grammars and Languages
11
Regular Set Acceptance (cont’d)
CSC 473 Automata, Grammars and Languages Regular Set Acceptance (cont’d) 7/23/2018 Reduction: assume a decider R for We construct a decider from it for E is a decider for Contradiction theorem acc acc rej rej Summarze here 3/2/04. Compare this reduction to next slide. C SC 473 Automata, Grammars and Languages
12
Mapping Reduction: Motivation
CSC 473 Automata, Grammars and Languages Mapping Reduction: Motivation 7/23/2018 Halting Problem Empty-Tape Acceptance Problem Empty-Set Acceptance Problem Regular-Set Acceptance Problem Y Y x N N C is an algorithm in each case C SC 473 Automata, Grammars and Languages
13
TMs can Act as Recognizers or Transducers
CSC 473 Automata, Grammars and Languages TMs can Act as Recognizers or Transducers 7/23/2018 Defn 5.17: A function is a computable function† if a TM transducer M such that on every input w, M halts with f(w) on its tape. Such a TM is called an algorithm. Compare & contrast this definition with: Defn 3.6: A language is a decidable language if a TM recognizer M such that on every input w, if w L it halts with “accept” and if w L it halts with “reject” . Such a TM is called a decider. A recognizer can be viewed as a special case of a transducer that prints only a 1 or 0 A language can be viewed as a special case of a function that returns a boolean value. ____________________________ †Also called total computable function. “Total” means “defined for all arguments w”. C SC 473 Automata, Grammars and Languages
14
Function:Set :: Transducer:Recognizer
CSC 473 Automata, Grammars and Languages Function:Set :: Transducer:Recognizer 7/23/2018 Functions Sets (Languages) Computable† f TM transducer M (w) M on w halts & prints M(w) (w) M(w) = f(w) M is called an algorithm Decidable L TM recognizer M (w) M on w halts & prints 0,1 (w) M(w) = 1 w L M is called a decider ‡ Partial† Computable f (w) M on w halts f(w) defined M is called a procedure Recognizable L (w) M on w halts w L M is called a recognizer Special case of Special case of Special case of †A computable function is historically called a “total computable function” †A partial computable function is sometimes called an “effective function” and a procedure an “effective procedure”. “Partial” signifies that the function f might not be defined for some arguments. ‡A decider is sometimes just called an “algorithm” Special case of C SC 473 Automata, Grammars and Languages
15
Mapping Reduction: Definition
CSC 473 Automata, Grammars and Languages Mapping Reduction: Definition 7/23/2018 All have the same pattern f must be a computable function The “compiler” must be an algorithm Defn 5.20: Language is mapping reducible to language iff a computable function such that Function f is called the reduction of to Y Y x N N C SC 473 Automata, Grammars and Languages
16
Mapping Reduction: Definition (cont’d)
CSC 473 Automata, Grammars and Languages Mapping Reduction: Definition (cont’d) 7/23/2018 Picture: Y Y x N N equivalent to , C SC 473 Automata, Grammars and Languages
17
CSC 473 Automata, Grammars and Languages
Reduction (cont.) 7/23/2018 Thms 5.22, 5.23,5.28, 5.29: Let Then decidable decidable undecidable undecidable recognizable recognizable non-recognizable non-recognizable If you want to show a problem P is easier than problem Q then reduce P to Q If you want to show a problem P is harder than problem Q then reduce Q to P easiness hardness P: ? Q Q: ? P C SC 473 Automata, Grammars and Languages
18
CSC 473 Automata, Grammars and Languages
Reductions 7/23/2018 Thm: Ex: Reduction: major method for showing unsolvability or non-recognizability: Goal: to show is not recognizable [not decidable] Known: is not recognizable [not decidable] Strategy: reduce to Method: build computable “translator” f to accept assuming we have a recognizer [decider] for yes w f C SC 473 Automata, Grammars and Languages
19
Undecidable via Reductions
CSC 473 Automata, Grammars and Languages Undecidable via Reductions 7/23/2018 Thm: The NONEMPTY-SET-ACCEPTANCE problem is TM-recognizable but not decidable: Pf: It is easy to see that since So cannot be decidable. An acceptor for is the following nondeterministic TM encode yes yes †what if w is not a syntactically valid TM encoding? Which set is it in? ‡ a good illustration of the power of nondeterminism to describe processes C SC 473 Automata, Grammars and Languages
20
Non-Recognizable via Reductions
CSC 473 Automata, Grammars and Languages Non-Recognizable via Reductions 7/23/2018 Thm: The EQUIVALENCE problem is not recognizable: Pf: We show that is not recognizable by showing that (which means that ). The reducing function generates a pair of TMs with the following behaviors: rej †what if w is not a syntactically valid TM encoding? Which set is it in? ‡ a good illustration of the power of nondeterminism to describe processes acc C SC 473 Automata, Grammars and Languages
21
Non-recognizable via m (cont’d)
CSC 473 Automata, Grammars and Languages Non-recognizable via m (cont’d) 7/23/2018 Reduction: assume a decider for We construct a decider from it for S is a decider for So This implies that and so cannot be recognizable acc acc rej rej Summarze here 3/2/04. Compare this reduction to next slide. C SC 473 Automata, Grammars and Languages
22
Non-Recognizable via Reductions (cont’d)
CSC 473 Automata, Grammars and Languages Non-Recognizable via Reductions (cont’d) 7/23/2018 Exercise: The FINITE-SET-ACCEPTANCE problem is not TM-recognizable: Proof: Show that Exercise: The INFINITE-SET-ACCEPTANCE problem is not TM-recognizable: C SC 473 Automata, Grammars and Languages
23
Equivalence and Completeness
CSC 473 Automata, Grammars and Languages Equivalence and Completeness 7/23/2018 Definition: Let C be a class of sets. A set A is mapping reduction complete ( complete ) in C iff Remark: “A is complete” says A is a “hardest problem in C” A is mapping equivalent to B iff Fact: all complete sets in C are mapping equivalent Exercise: Start here 3/3/04 C SC 473 Automata, Grammars and Languages
24
CSC 473 Automata, Grammars and Languages
Completeness 7/23/2018 Theorem: is complete in the class TM of Turing-recognizable sets. Proof: is accepted by U, so is in TM. To show completeness, let B be any Turing-recognizable set in TM. Then a TM such that Define the computable function Then Since B was chosen arbitrarily in TM the result follows Exercise: Show the Halting Prob is complete in TM C SC 473 Automata, Grammars and Languages
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.