 2005 SDU Lecture14 Mapping Reducibility, Complexity.

Slides:



Advertisements
Similar presentations
Variants of Turing machines
Advertisements

CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Reducibility 2 Theorem 5.1 HALT TM is undecidable.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 22-1 Computability and Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 13-1 Complexity Andrei Bulatov Hierarchy Theorem.
Measuring Time Complexity Sipser 7.1 (pages )
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
Mapping Reducibility Sipser 5.3 (pages ).
More Turing Machines Sipser 3.2 (pages ).
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Mapping Reducibility Sipser 5.3 (pages ). CS 311 Fall Computable functions Definition 5.17: A function f:Σ*→Σ* is a computable function.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
CHAPTER 4 Decidability Contents Decidable Languages
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
CS 310 – Fall 2006 Pacific University CS310 Complexity Section 7.1 November 27, 2006.
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
CSCI 2670 Introduction to Theory of Computing November 4, 2004.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Theory of Computing Lecture 21 MAS 714 Hartmut Klauck.
Measuring complexity Section 7.1 Giorgi Japaridze Theory of Computability.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 7 Undecidability cont. Jan Maluszynski, IDA, 2007
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Umans Complexity Theory Lectures Lecture 1b: Turing Machines & Halting Problem.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
Theory of Computational Complexity Yuji Ishikawa Avis lab. M1.
The Church-Turing Thesis
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
The Acceptance Problem for TMs
CSCI 2670 Introduction to Theory of Computing
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Theory of Computability
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions.
Reductions Costas Busch - LSU.
Automata, Grammars and Languages
HIERARCHY THEOREMS Hu Rui Prof. Takahashi laboratory
Intro to Theory of Computation
Summary.
CS154, Lecture 8: Undecidability, Mapping Reductions
Theory of Computational Complexity
CS154, Lecture 8: Undecidability, Mapping Reductions
Decidable Languages Costas Busch - LSU.
Theory of Computability
CS154, Lecture 12: Time Complexity
CSC 4170 Theory of Computation Mapping Reducibility Section 5.3.
CSC 4170 Theory of Computation Time complexity Section 7.1.
Turing Machines Complexity ©D.Moshkovitz.
Time Complexity Classes
Theory of Computability
Theory of Computability
Theory of Computability
Theory of Computability
CSC 4170 Theory of Computation Time complexity Section 7.1.
Intro to Theory of Computation
Presentation transcript:

 2005 SDU Lecture14 Mapping Reducibility, Complexity

 2005 SDU 2 Mapping reducibility A function f:  *   * is computable if some TM M exists which on every input w halts with f(w) on the tape. Definition: Language A is mapping reducible to language B, A  m B, if there is a computable function, f, such that for every w, w  A  f(w)  B, where f is called a reduction of A to B. ** A ** B f f

 2005 SDU 3 Conclusion If A  m B and B is decidable, then A is decidable. Proof. Let M be a decider for B and f:  *   *be the reduction function from A to B. The TM N that decides A is: N = “On input w: 1. Compute f(w). 2. Run M on input f(w) and output whatever M outputs.” Corollary: If A  m B and A is un-decidable, then B is un-decidable.

 2004 SDU 4 Example To reduce A TM to HALT TM we assume that HALT TM is decidable and let TM R decide it. Then we construct the TM S that decides A TM as follows: S = “on input, an encoding of a TM M and a string 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 accepted, accept; if M rejected, reject.”

 2004 SDU 5 Construction a reduction A TM  m HALT TM We can demonstrate a mapping reduction from A TM to HALT TM as follows: Find a computable function f that takes input and return, where  A TM iff  HALT TM

 2004 SDU 6 TM F that computes f F = “On input : 1.Construct the following machine M’: M’ = “On input x: (a) Run M on x. (b) If M accepts, accept. (c) If M rejects, enter a loop.” 2. Output.” It is easy to verify that  A TM   HALT TM

 2004 SDU 7 Another Example Assuming that EQ TM is decided by a TM R, then E TM can be decided by the machine S: S = “ On input, where M is a TM: 1.Run R on input, where M 1 is the TM that rejects all inputs. 2.If R accepts, accept; if R rejects, reject.” Sine E TM is un-decidable, R cannot exit. The mapping reduction f from E TM to EQ TM can be computed by the following TM: F =“On input, where M is the encoding of a TM: 1.Compute a TM M 1 that rejects all input. 2.Output. ”

 2004 SDU 8 Mapping reducibility is transitive Proof: Suppose A  m B and B  m C There are computable functions f and g such that:  x, x  A  f(x)  B and  y, y  B  g(y)  C. Consider the function composition: h = gf. We can build the TM M h that compute h as follows: M h = “On input x: 1. Simulate a TM that computes f on input x and let the result be y=f(x) (such TM exists because f is computable). 2. Simulate a TM that computes g on input y and let the result be z = g(y) (such TM exists because g is computable).”

 2004 SDU 9 Observation On proving the un-decidability of E TM, we reduce A TM to E TM by first defining a TM M 1 from : M 1 = “On input x: 1. If x  w, reject 2. If x = w, run M on input w and accept if M does.” If we define function f: f( ) = M 1, then f is a mapping reduction from A TM to. Since decidability is not affected by complementation, it still shows that E TM is un-decidable. But it does not give a mapping reduction from A TM to E TM, which in fact does not exist (exercise).

 2004 SDU 10 Conclusion If A  m B and B is Turing-recognizable, then A is Turing- recognizable. Proof : Assume that B is Turing recognizable, let M be a recognizer of B, f: A  B a mapping reduction from A to B. The TM N that recognizes A is defined by: N=“On input w: 1.Compute f(w) 2.Run M on input f(w) and output whatever M outputs.” Note, Since M is a recognizer for B and f is a mapping reduction from A to B, N is a recognizer for A. Corollary: If A  m B and A is not Turing-recognizable, then B is not Turing-recognizable

 2004 SDU 11 Application EQ TM is neither Turing-recognizable nor co-Turing-Recognizable. Proof. First, show that EQ TM is not Turing-recognizable. We can do so by showing that A TM is mapping reducible to. Since A TM  m implies that  m EQ TM, as required. The reduction f works as follows: F = “On input, where M is a TM and w is a string: 1.Construct the two machines M 1 and M 2 : M 1 = “On any input: a) Reject.” M 2 =“On any input: b) Run M on w. If it accepts, accept.” 2.Output.”

 2004 SDU 12 Observation To show that is not Turing-recognizable, we give a reduction function g from A TM to the complement of, which is EQ TM. Hence, we show that A TM  m EQ TM. The TM G that computes this reduction g follows: G = “On input, where M is a TM and w is a string: 1.Construct the two machines M 1 and M 2 : M 1 = “On any input: a)Accept.” M 2 = “On any input: a) Run M on w. If it accepts, accept.” 2.Output. ”

 2005 SDU 13 Definitions of time and space complexity Let M be a deterministic (multi-tape)TM that halts for every input. The running time or time complexity of M is the function f: N  N, where f(n) is the maximum number of steps that M uses on any input of length n. The running space or space complexity of M is the function f: N  N, where f(n) is the maximum number of distinct tape cells that M scans on any input of length n. If f(n) is the time complexity of M, we say that M runs in time f(n), or that M is an f(n)-time machine. Similarly, if f(n) is the space complexity of M, we say that M runs in space f(n), or that M is an f(n)-space machine. The same definitions apply to nondeterministic Turing machines. In particular, let M be a nondeterministic (multi-tape)TM such that for every input, every branch of computation halts. The time complexity of M is the function f: N  N, where f(n) is the maximum number of steps that M uses on any branch of its computation on any input of length n. The space complexity of M is the function f: N  N, where f(n) is the maximum number of tape cells that M scans on any branch of its computation on any input of length n.

 2004 SDU 14 time complexity classes Let f: N  N be a function. Define TIME (f(n)) = {L | L is decided by an O(f(n)) time multi- tape Turing machine}. NTIME(f(n)) = {L| L is decided by an O(f(n)) time non- deterministic Multi-tape Turing machine}. Note:  g(n) = O(f (n)), if there exist constant n 0 and c such that for all n  n 0, g(n)  cf(n)  Space complexity classes can be defined similarly.

 2004 SDU 15 Relationship among models Theorem. For every t(n)  n, each t(n) time multi-tape Turing machine has an equivalent O(t 2 (n)) time single-tape Turing machine. Theorem. For every t(n)  n, each t(n) time nondeterministic Turing machine has an equivalent 2 O(t(n)) time single-tape Turing machine.

 2004 SDU 16 Complexity class P and NP Alan Cobham[1964], Jack Edmonds[1965], and Michael Rabin[1966] Suggested the “polynomial time” as a broad classification of problems that are solvable in a reasonable amount of time NP is the nondeterministic counterpart of P

 2005 SDU 17 The classes P, NP, PSPACE and NPSPACE A polynomial function (or simply polynomial) is a function f(x) that can be written as f(x) = a k x k +a k-1 x k-1 +…+a 1 x 1 +a 0 x 0 for some nonnegative integer k and numbers a k,a k-1,…a 1,a 0. P the class of problems (languages ) that can be solved (decided) by a polynomial-time deterministic multi-tape TM NP the class of problems (languages) that can be solved (decided) by a polynomial-time non-deterministic multi-tape TM PSPACE the class of problems (languages) that can be solved (decided) by a polynomial-space deterministic multi-tape TM NPSPACE the class of problems (languages) that can be solved (decided) by a polynomial-space nondeterministic multi-tape TM It is known that P  NP  PSPACE=NPSPACE. However, the question on whether P  NP or even P  PSPACE remains the most challenging unsolved problem!

 2005 SDU 18 Complexity of regular languages Let A={w | w starts with a 0} What is the time complexity of (the most efficient TM that decides) A? Answer: f(n)=2. I.e., constant time. So that A  P. How about the space complexity? Answer: f(n)=1. I.e., constant space. So that A  PSPACE. Let B={w | w ends with a 0} What is the time complexity of (the most efficient TM that decides) B? Answer: f(n)=n+2. I.e., linear time. So that B  P. How about the space complexity? Answer: f(n)=n+1. I.e., linear space. So that B  PSPACE. Are all the regular languages in P and PSPACE? Answer: Certainly. Their time complexity is at most f(n)=n+2, and space complexity at most f(n)=n+1.

 2005 SDU 19 Complexity of context-free languages Let K={w | w=w R } What is the time complexity of (the most efficient TM that decides) K? Answer: At most f(n)=n 2. I.e., square time. So that K  P. How about the space complexity? Answer: f(n)=n+1. I.e., linear space. So that K  PSPACE. Generally, it is known that both the time and space complexities of any context-free language are polynomial (P and PSPACE).