Relationship to Other Classes

Slides:



Advertisements
Similar presentations
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Advertisements

Variants of Turing machines
1 Savitch and Immerman- Szelepcsènyi Theorems. 2 Space Compression  For every k-tape S(n) space bounded offline (with a separate read-only input tape)
Cook’s Theorem The Foundation of NP-Completeness.
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
Giorgi Japaridze Theory of Computability Savitch’s Theorem Section 8.1.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Having Proofs for Incorrectness
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 · L 2 means: For some polynomial time computable map r : 8 x: x 2 L 1 iff.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Introduction to Computability Theory
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.
Submitted by : Estrella Eisenberg Yair Kaufman Ohad Lipsky Riva Gonen Shalom.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
1 Polynomial Space The classes PS and NPS Relationship to Other Classes Equivalence PS = NPS A PS-Complete Problem.
1 The Cook-Levin Theorem Zeph Grunschlag. 2 Announcements Last HW due Thursday Please give feedback about course at oracle.seas.columbia.edu/wces oracle.seas.columbia.edu/wces.
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.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 ≤ L 2 means: For some polynomial time computable map r : x: x L 1 iff r(x)
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
A Problem That Is Complete for PSPACE (Polynomial Space) BY TEJA SUDHA GARIGANTI.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
Given this 3-SAT problem: (x1 or x2 or x3) AND (¬x1 or ¬x2 or ¬x2) AND (¬x3 or ¬x1 or x2) 1. Draw the graph that you would use if you want to solve this.
Theory of Computational Complexity Yuji Ishikawa Avis lab. M1.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
1 SAT SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?
The NP class. NP-completeness
P & NP.
More About Turing Machines
Intractable Problems Time-Bounded Turing Machines Classes P and NP
The Acceptance Problem for TMs
L is in NP means: There is a language L’ in P and a polynomial p so that L1 ≤ L2 means: For some polynomial time computable map r :  x: x  L1 iff.
Part VI NP-Hardness.
Turing Machines Acceptors; Enumerators
COSC 3340: Introduction to Theory of Computation
Summary.
Jaya Krishna, M.Tech, Assistant Professor
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Intractable Problems Time-Bounded Turing Machines Classes P and NP
How Hard Can It Be?.
Intractable Problems Time-Bounded Turing Machines Classes P and NP
The Satisfiability Problem
Chapter 11 Limitations of Algorithm Power
Dynamic Programming Dynamic Programming 1/18/ :45 AM
CS154, Lecture 13: P vs NP.
CS21 Decidability and Tractability
Our First NP-Complete Problem
This Lecture Substitution model
Instructor: Aaron Roth
More Undecidable Problems
Instructor: Aaron Roth
Theory of Computation Lecture 17: Calculations on Strings II
Turing Machines Everything is an Integer
The Satisfiability Problem
Intro to Theory of Computation
Presentation transcript:

Relationship to Other Classes Polynomial Space The classes PS and NPS Relationship to Other Classes Equivalence PS = NPS A PS-Complete Problem

Polynomial-Space-Bounded TM’s A TM M is said to be polyspace-bounded if there is a polynomial p(n) such that, given input of length n, M never uses more than p(n) cells of its tape. L(M) is in the class polynomial space, or PS.

Nondeterministic Polyspace If we allow a TM M to be nondeterministic but to use only p(n) tape cells in any sequence of ID’s when given input of length n, we say M is a nondeterministic polyspace-bounded TM. And L(M) is in the class nondeterministic polyspace, or NPS.

Relationship to Other Classes Obviously, P  PS and NP  NPS. If you use polynomial time, you cannot reach more than a polynomial number of tape cells. Alas, it is not even known whether P = PS or NP = PS. On the other hand, we shall show PS = NPS.

Exponential Polytime Classes A DTM M runs in exponential polytime if it makes at most cp(n) steps on input of length n, for some constant c and polynomial p. Say L(M) is in the class EP. If M is an NTM instead, say L(M) is in the class NEP (nondeterministic exponential polytime ).

More Class Relationships P  NP  PS  EP, and at least one of these is proper. A diagonalization proof shows that P  EP. PS  EP requires proof. Key Point: A polyspace-bounded TM has only cp(n) different ID’s. We can count to cp(n) in polyspace and stop it after it surely repeated an ID.

Proof PS  EP Let M be a p(n)-space bounded DTM with s states and t tape symbols. Assume M has only one semi-infinite tape. The number of possible ID’s of M is sp(n)tp(n) . Tape contents States Positions of tape head

Proof PS  EP – (2) Note that (t+1)p(n)+1 > p(n)tp(n). Use binomial expansion (t+1)p(n)+1 = tp(n)+1 + (p(n)+1)tp(n) + … Also, s = (t+1)c, where c = logt+1s. Thus, sp(n)tp(n) < (t+1)p(n)+1+c. We can count to the maximum number of ID’s on a separate tape using base t+1 and p(n)+1+c cells – a polynomial.

Proof PS  EP – (2) Redesign M to have a second tape and to count on that tape to sp(n)tp(n). The new TM M’ is polyspace bounded. M’ halts if its counter exceeds sp(n)tp(n). If M accepts, it does so without repeating an ID. Thus, M’ is exponential-polytime bounded, proving L(M) is in EP.

Savitch’s Theorem: PS = NPS Key Idea: a polyspace NTM has “only” cp(n) different ID’s it can enter. Implement a deterministic, recursive function that decides, about the NTM, whether I⊦*J in at most m moves. Assume m < cp(n), since if the NTM accepts, it does so without repeating an ID.

Savitch’s Theorem – (2) Recursive doubling trick: to tell if I⊦*J in < m moves, search for an ID K such that I⊦*K and K⊦*J, both in < m/2 moves. Complete algorithm: ask if I0⊦*J in at most cp(n) moves, where I0 is the initial ID with given input w of length n, and J is any of the ID’s with an accepting state and length < p(n).

Recursive Doubling boolean function f(I, J, m) { for (all ID’s K using p(n) tape) if (f(I, K, m/2) && f(K, J, m/2)) return true; return false; }

Stack Implementation of f I, J, m O(p(n)) space I, K, m/2 O(p(n)) space L, K, m/4 O(p(n)) space . . . M, N, 1 O(p(n)) space O(p2(n)) space

Space for Recursive Doubling f(I, J, m) requires space O(p(n)) to store I, J, m, and the current K. m need not be more than cp(n), so it can be stored in O(p(n)) space. How many calls to f can be active at once? Largest m is cp(n).

Space for Recursive Doubling – (2) Each call with third argument m results in only one call with argument m/2 at any one time. Thus, at most log2cp(n) = O(p(n)) calls can be active at any one time. Total space needed by the DTM is therefore O(p2(n)) – a polynomial.

PS-Complete Problems A problem P in PS is said to be PS-complete if there is a polytime reduction from every problem in PS to P. Note: it has to be polytime, not polyspace, because: Polyspace can exponentiate the output size. Without polytime, we could not deal with the question P = PS?

What PS-Completeness Buys If some PS-complete problem is: In P, then P = PS. In NP, then NP = PS.

Quantified Boolean Formulas We shall meet a PS-complete problem, called QBF : is a given quantified boolean formula true? But first we meet the QBF’s themselves. We shall give a recursive (inductive) definition of QBF’s along with the definition of free/bound variable occurrences.

QBF’s – (2) First-order predicate logic, with variables restricted to true/false. Basis: Constants 0 (false) and 1 (true) are QBF’s. A variable is a QBF, and that variable occurrence is free in this QBF.

QBF’s – (3) Induction: If E and F are QBF’s, so are: E AND F, E OR F, and NOT F. Variables are bound or free as in E or F. (x)E and (x)E for any variable x. All free occurrences x are bound to this quantifier, and other occurrences of variables are free/bound as in E. Use parentheses to group as needed. Precedence: quantifiers, NOT, AND, OR.

Example: QBF (x)(y)(((x)(x OR y)) AND NOT (x AND y)) bound bound

Evaluating QBF’s In general, a QBF is a function from truth assignments for its free variables to {0, 1} (false/true). Important special case: no free variables; a QBF is either true or false. We shall give the evaluation only for these formulas.

Evaluating QBF’s – (2) Induction on the number of operators, including quantifiers. Stage 1: eliminate quantifiers. Stage 2: evaluate variable-free formulas. Basis: 0 operators. Expression can only be 0 or 1, because there are no free variables. Truth value is 0 or 1, respectively.

Induction Expression is NOT E, E OR F, or E AND F. Evaluate E and F; apply boolean operator to the results. Expression is (x)E. Construct E0 = E with each x bound to this quantifier replaced by 0, and analogously E1. E is true iff both E0 and E1 are true. Expression is (x)E. Same, but E is true iff either E0 or E1 is true.

Example: Evaluation (x)(y)(((x)(x OR y)) AND NOT (x AND y)) Substitute x = 0 for outer quantifier: (y)(((x)(x OR y)) AND NOT (0 AND y)) Substitute x = 1 for outer quantifier: (y)(((x)(x OR y)) AND NOT (1 AND y))

Example: Evaluation – (2) Let’s follow the x = 0 subproblem: (y)(((x)(x OR y)) AND NOT (0 AND y)) Two cases: y = 0 and y = 1. ((x)(x OR 0)) AND NOT (0 AND 0) ((x)(x OR 1)) AND NOT (0 AND 1)

Example: Evaluation – (3) Let’s follow the y = 0 subproblem: ((x)(x OR 0)) AND NOT (0 AND 0) Need to evaluate (x)(x OR 0). x = 0: 0 OR 0 = 0. x = 1: 1 OR 0 = 1. Hence, value is 1. Answer is 1 AND NOT (0 AND 0) = 1.

Example: Evaluation – (4) Let’s follow the y = 1 subproblem: ((x)(x OR 1)) AND NOT (0 AND 1) Need to evaluate (x)(x OR 1). x = 0: 0 OR 1 = 1. x = 1: 1 OR 1 = 1. Hence, value is 1. Answer is 1 AND NOT (0 AND 1) = 1.

Example: Evaluation – (5) Now we can resolve the (outermost) x = 0 subproblem: (y)(((x)(x OR y)) AND NOT (0 AND y)) We found both of its subproblems are true. We only needed one, since the outer quantifier is y. Hence, 1.

Example: Evaluation – (6) Next, we must deal with the x = 1 case: (y)(((x)(x OR y)) AND NOT (1 AND y)) It also has the value 1, because the subproblem y = 0 evaluates to 1. Hence, the entire QBF has value 1.

The QBF Problem The problem QBF is: Theorem: QBF is PS-complete. Given a QBF with no free variables, is its value 1 (true)? Theorem: QBF is PS-complete. Comment: What makes QBF extra hard? Alternation of quantifiers. Example: if only  used, then the problem is really SAT.

Part I: QBF is in PS Suppose we are given QBF F of length n. F has at most n operators. We can evaluate F using a stack of subexpressions that never has more than n subexpressions, each of length < n. Thus, space used is O(n2).

QBF is in PS – (2) Suppose we have subexpression E on top of the stack, and E = G OR H. Push G onto the stack. Evaluate it recursively. If true, return true. If false, replace G by H, and return what H returns.

QBF is in PS – (3) Cases E = G AND H and E = NOT G are handled similarly. If E = (x)G, then treat E as if it were E = E0 OR E1. Observe: difference between  and OR is succinctness; you don’t write both E0 and E1. But E0 and E1 must be almost the same. If E = (x)G, then treat E as if it were E = E0 AND E1.

Part II: All of PS Polytime Reduces to QBF Recall that if a polyspace-bounded TM M accepts its input w of length n, then it does so in cp(n) moves, where c is a constant and p is a polynomial. Use recursive doubling to construct a QBF saying “there is a sequence of cp(n) moves of M leading to acceptance of w.”

Polytime Reduction: The Variables We need collections of boolean variables that together represent one ID of M. A variable ID I is a collection of O(p(n)) variables yj,A. True iff the j-th position of the ID I is A (a state or tape symbol). 0 < j < p(n)+1 = length of an ID.

The Variables – (2) We shall need O(p(n)) variable ID’s. So the total number of boolean variables is O(p2(n)). Shorthand: (I), where I is a variable ID, is short for (y1)(y2)(…), where the y’s are the boolean variables belonging to I. Similarly (I).

Structure of the QBF The QBF is (I0)(If)(S AND N AND F AND U), where: I0 and If are variable ID’s representing the start and accepting ID’s respectively. U = “unique” = one symbol per position. S = “starts right”: I0 = q0w. F = “finishes right” = If accepts. N = “moves right.”

Structure of U, S, and F U is as done for Cook’s theorem. S asserts that the first n+1 symbols of I0 are q0w, and other symbols are blank. F asserts one of the symbols of If is a final state. All are easy to write in O(p(n)) time.

Structure of QBF N N(I0,If) needs to say that I0⊦*If by at most cp(n) moves. We construct subexpressions N0, N1, N2,… where Ni(I,J) says “I⊦*J by at most 2i moves.” N is Nk, where k = log2cp(n) = O(p(n)). Note: differs from text, where the subscripts exponentiate.

Constructing the Ni’s Basis: N0(I, J) says “I=J OR I⊦J.” If I represents variables yj,A and J represents variables zj,A, we say I=J by the boolean expression for yj,A = zj,A for all j and A. Remember: a=b is (a AND b) OR (NOT a AND NOT b). I⊦J uses the same idea as for SAT.

Induction Suppose we have constructed Ni and want to construct Ni+1. Ni+1(I, J) = “there exists K such that Ni(I, K) and Ni(K, J).” We must be careful: We must write O(p(n)) formulas, each in polynomial time.

Induction – (2) If each formula used two copies of the previous formula, times and sizes would exponentiate. Trick: use  to make one copy of Ni serve for two. Ni+1(I, J) = “if (P,Q) = (I,K) or (P,Q) = (K,J), then Ni(P, Q).”

Induction – (3) More formally, Ni+1(I, J) = (K)(P)(Q)( Express as boolean variables Induction – (3) More formally, Ni+1(I, J) = (K)(P)(Q)( ((P  I OR Q  K) AND (P  K OR Q  J)) OR Ni(P, Q)) Pair (P,Q) is neither (I,K) nor (K,J) Or P⊦*Q in at most 2i moves.

Induction – (4) We can thus write Ni+1 in time O(p(n)) plus the time it takes to write Ni. Remember: N is Nk, where k = log2cp(n) = O(p(n)). Thus, we can write N in time O(p2(n)). Finished!! The whole QBF for w can be written in polynomial time.