Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.

Similar presentations


Presentation on theme: "Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve."— Presentation transcript:

1 Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve the first problem.

2 HALT TM ={ | M is a TM and M halts on input w} Thm: HALT TM is un-decidable

3 Proof: By contradiction, assume R is a TM that decides HALT TM. With R, we construct a TM S to decide A TM : S= “ On input, an encoding of M and w: 1. Run TM R on input 2. If R rejects, REJECT 3. If R accepts, simulate M on w until it halts. 4. If M has accepted, ACCEPT; If M has rejected, REJECT. “

4 (Proof conti.) If R decides HALT TM, then S decides A TM. But A TM is un-decidable, thus HALT TM is un-decidable.

5 E TM ={ | M is a TM and L(M)= ∅ } Thm: E TM is un-decidable.

6 Proof: Define M w = “ On input x: 1. If x ≠ w, reject 2. If x = w, run M on input w and accept if M does ” Assume that R decides E TM. Construct S that decides A TM as follows: S = “ On input 1. Use M and w to construct M w 2. Run R on 3. If R accepts, REJECT; if R rejects, ACCEPT. “ But A TM is un-decidable, thus E TM is un-decidable.

7 REGULAR TM = { | M is a TM and L(M) is regular }. Thm: REGULAR TM is un-decidable.

8 Proof: Assume R decides REGULAR TM. Construct TM S to decide A TM. S = “ On input : 1. Construct the following TM M w M w = “ On input x : 1. If x has the form 0 n 1 n,ACCEPT. 2. If x does not have this form, run M on input w and ACCEPT if M accepts w. 2. Run R on input 3. If R accepts, ACCEPT; If R rejects, REJECT. “

9 EQ TM = { | M 1 and M 2 are TMs and L(M 1 )=L(M 2 ) } Thm: EQ TM is un-decidable.

10 Proof: Let TM R decide EQ TM and construct S to decide E TM as follows: S = “ On input, where M is a TM: 1. Run R on input, where M 1 rejects all inputs. 2. If R accepts, accept; otherwise reject. “ If R decides EQ TM, S decides E TM.

11 Reductions via computation histories Def: M: Turing Machine w: an input string An accepting computation history for M on w is a sequence of configurations, C 1, C 2, …, C l, where C 1 is the start configuration of M on w, C l is an accepting configuration of M, and each C i legally follows from C i-1.

12 Def: Linear Bounded Automaton is a type of TM where in the tape head is not permitted to move off the portion of the tape containing the input.

13 A LBA = { | M is an LBA that accepts w} Lemma: Let M be an LBA with q states and g symbols in the tape alphabet. There are exactly qng n distinct configurations of M for a tape of length n.

14 Proof: Head positions : n states : q tape contents : g n 123 n-1 n

15 A LBA = { | M : LBA, M accepts w } Thm: A LBA is decidable.

16 Proof: Algorithm: L = “ On input, where M is an LBA and w is a string. 1. Simulate M on w for qng n steps until it halts. 2. If M has halted, accept if it has accepted; and reject if it has rejected. If it has not halted, reject. “

17 E LBA = { | M is an LBA where L(M)= ∅ } Thm: E LBA is un-decidable.

18 Proof: Suppose R decides E LBA. Construct S that decides A TM. S = “ On input, where M is a TM and w is a string : 1. Construct LBA B from M and w 2. Run R on. 3. If R rejects, accept; if R accepts, reject. “ Recognizes all accepting computation histories for M and w ### B CiCi ⊦ C i+1

19 ALL CFG = { | G is a CFG and L(G)=  * } Thm: ALL CFG is un-decidable.

20 A Simple un-decidable problem Post correspondence problem(PCP) Eg: : dominos match: Make a list of dominos (repetitions permitted) so that the string we get by reading off the symbols on the top is the same as the string of symbols on the bottom.

21 An instance of the PCP is a collection P of dominos: a match is a sequence i 1, i 2, …, i l, where The problem is to determine whether P has a match. PCP={ | P is an instance of the Post Correspondence Problem with a match.}

22 MPCP = { | P is an instance of the Post Correspondence Problem with a match that starts with the first domino } Thm: PCP is un-decidable.

23 Proof: Let TM R decide the PCP and construct S deciding A TM. Let M = (Q, , , , q 0, q accept, q reject ). S constructs an instance of the PCP P that has a match iff M accepts w.

24 (Proof conti.) Part 1: Putinto P ’ as the 1 st domino. Part 2: For every a,b ∈  and every q,r ∈ Q, if  (q,a)=(r,b,R), put into P ’. Part 3: For every a,b,c ∈  and every q,r ∈ Q, if  (q,a)=(r,b,L), put into P ’. Part 4: For every a ∈ , put into P ’. MPCP

25 (Proof conti.) Eg.  ={0,1,2, }. w = 0100 Suppose  (q 0,0)=(q 7,2,R), then Part 2: places into P ’. Part 4: places into P ’. # q 0 0 1 0 0 # # q 0 0 1 0 0 # 2q 7 1 0 0 #

26 (Proof conti.) Part 5: Put and into P ’. If  (q 7,1)=(q 5,0,R), then is in P ’. # 2 q 7 1 0 0 # ⋯ # 2 q 7 1 0 0 # 2 0 q 5 0 0 # If  (q 5,0)=(q 9,2,L), then we have # 2 0 q 5 0 0 # ⋯ # 2 0 q 5 0 0 # 2 q 9 0 2 0 #

27 (Proof conti.) Part 6: for every a ∈ , Put into P ’. # 2 1 q accept 0 2 # ⋯ # q accept # # ⋯ # 2 1 q accept 0 2 # 2 1 q accept 2 # ⋯ # q accept # # Part 7: Add # q accept # # ⋯ # q accept # #

28 (Proof conti.) Convert P ’ to P: Let u = u 1 u 2 …u n Define *u = *u 1 *u 2 … *u n u*= u 1 *u 2 *…*u n * *u*=*u 1 *u 2 *…*u n * P ’ : P : ■ Must start with the first domino, and ends with an extra * on the top

29 Mapping Reducibility: (many- one reducibility) Def: f :  *   * is a computable function if some TM M, on every input w, halts with just f(w) on its step.

30 Def: Language A is mapping reducible to B, written A ≤ m B, if there is a computable function f :  *   *, where for every w, w ∈ A ⇔ f(w) ∈ B f is called the reduction of A to B w AB f f

31 Thm: If A ≤ m B and B is decidable, then A is decidable.

32 Proof: Let M be the decider for B, f be the reduction from A to B. N = “ On input w: 1. Compute f(w) 2. Run M on input f(w) and output whatever M outputs. “

33 Cor: If A ≤ m B and A is un-decidable, then B is un-decidable. Thm: If A ≤ m B and B is Turing-recognizable, then A is Turing-recognizable. Cor: If A ≤ m B and A is not Turing-recognizable, then B is not Turing-recognizable.

34 Thm: EQ TM is neither Turing-recognizable nor co- Turing-recognizable. __ Pf: We prove by showing A TM ≤ m EQ TM and A TM ≤ m EQ TM. Why? F=“On input : 1. Construct M 1 and M 2. M 1 = “On any input: Reject.” M 2 = “On any input: Run M on w. If it accepts, accept.” 2. Output.

35 G=“On input : 1. Construct M 1 and M 2. M 1 = “On any input: Accept.” M 2 = “On any input: Run M on w. If it accepts, accept.” 2. Output. G completes the reduction of A TM ≤ m EQ TM.

36 Turing Reducibility (mapping reducibility?) Def: An oracle for a language B is an external device that is capable of reporting whether any string w is a member of B. Def: An oracle Turing machine is a modified Turing machine that has the additional capability of querying an oracle. M B : an oracle TM that has an oracle for B.

37 Eg: E TM : un-decidable. = “ On input, where M is a TM: 1. Construct TM N: N = “ On any input: 1. Run M in parallel on all strings in  *. 2. If M accepts any of these strings, accept. “ 2. Query the oracle to determine whether ∈ A TM. 3. If the oracle answers NO, accept; if YES, reject. “ decides E TM. Thus, E TM is decidable relative to A TM.

38 Def: Language A is Turing reducible to language B, written A ≤ T B, if A is decidable relative to B. Thm: If A ≤ T B and B is decidable, then A is decidable.

39 Proof: If B is decidable, then replace the oracle for B by an actual procedure(or TM) that decides B. Thus, we may replace the oracle TM that decides A by an ordinary TM that decides A.


Download ppt "Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve."

Similar presentations


Ads by Google