Lecture 22: PSPACE

Similar documents
COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness

Lecture 21: Space Complexity (The Final Exam Frontier?)

Lecture 23: More PSPACE-Complete, Randomized Complexity

PSPACE COMPLETENESS TBQF. THURSDAY April 17

conp, Oracles, Space Complexity

CS154, Lecture 17: conp, Oracles again, Space Complexity

Space is a computation resource. Unlike time it can be reused. Computational Complexity, by Fu Yuxi Space Complexity 1 / 44

Definition: conp = { L L NP } What does a conp computation look like?

Computability and Complexity CISC462, Fall 2018, Space complexity 1

Space Complexity. Huan Long. Shanghai Jiao Tong University

The space complexity of a standard Turing machine. The space complexity of a nondeterministic Turing machine

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

Notes on Complexity Theory Last updated: October, Lecture 6

Space Complexity. The space complexity of a program is how much memory it uses.

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

SOLUTION: SOLUTION: SOLUTION:

6.045 Final Exam Solutions

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

1 PSPACE-Completeness

Lecture 8. MINDNF = {(φ, k) φ is a CNF expression and DNF expression ψ s.t. ψ k and ψ is equivalent to φ}

CSE200: Computability and complexity Space Complexity

Lecture 20: conp and Friends, Oracles in Complexity Theory

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Review of Basic Computational Complexity

Space Complexity. Master Informatique. Université Paris 5 René Descartes. Master Info. Complexity Space 1/26

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

Advanced topic: Space complexity

Introduction to Computational Complexity

Computational Complexity IV: PSPACE

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

CS154, Lecture 13: P vs NP

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3

Umans Complexity Theory Lectures

PSPACE, NPSPACE, L, NL, Savitch's Theorem. More new problems that are representa=ve of space bounded complexity classes

Space and Nondeterminism

Complete problems for classes in PH, The Polynomial-Time Hierarchy (PH) oracle is like a subroutine, or function in

Exam Computability and Complexity

P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:

Notes on Space-Bounded Complexity

Undirected ST-Connectivity in Log-Space. Omer Reingold. Presented by: Thang N. Dinh CISE, University of Florida, Fall, 2010

Complexity (Pre Lecture)

CSCI 1590 Intro to Computational Complexity

Lecture 19: Finish NP-Completeness, conp and Friends

CS154, Lecture 13: P vs NP

The Polynomial Hierarchy

TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20

Notes on Space-Bounded Complexity

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

CSCI 1590 Intro to Computational Complexity

Time and space classes

INAPPROX APPROX PTAS. FPTAS Knapsack P

1 Deterministic Turing Machines

1 Deterministic Turing Machines

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

6.045J/18.400J: Automata, Computability and Complexity Final Exam. There are two sheets of scratch paper at the end of this exam.

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

Complexity Theory 112. Space Complexity

CSE 105 Theory of Computation

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Lecture 8: Alternatation. 1 Alternate Characterizations of the Polynomial Hierarchy

NP-Completeness and Boolean Satisfiability

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

Lecture 9: Polynomial-Time Hierarchy, Time-Space Tradeoffs

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

NP-Completeness. A language B is NP-complete iff B NP. This property means B is NP hard

NP-Completeness Part II

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Chapter 7: Time Complexity

Time to learn about NP-completeness!

198:538 Complexity of Computation Lecture 16 Rutgers University, Spring March 2007

Lecture 24: Randomized Complexity, Course Summary

Lecture Notes Each circuit agrees with M on inputs of length equal to its index, i.e. n, x {0, 1} n, C n (x) = M(x).

Intro to Theory of Computation

Polynomial Hierarchy

Lecture 10: Boolean Circuits (cont.)

Principles of Knowledge Representation and Reasoning

Time-Space Tradeoffs for SAT

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Lecture 16: Time Complexity and P vs NP

CSE 135: Introduction to Theory of Computation NP-completeness

CSCI 1590 Intro to Computational Complexity

Lecture 4 : Quest for Structure in Counting Problems

Definition: Alternating time and space Game Semantics: State of machine determines who

NP-Completeness. Sections 28.5, 28.6

6.840 Language Membership

Computability Theory

CS151 Complexity Theory. Lecture 4 April 12, 2017

Time Complexity. Definition. Let t : n n be a function. NTIME(t(n)) = {L L is a language decidable by a O(t(n)) deterministic TM}

Transcription:

6.045 Lecture 22: PSPACE 1

VOTE VOTE VOTE For your favorite course on automata and complexity Please complete the online subject evaluation for 6.045 2

Final Exam Information Who: You On What: Everything through PSPACE With What: One sheet (double-sided) of notes are allowed When: Friday, May 26 1:30PM - 4:30PM Where: HERE, 04-270 Why: Because you ll ace it How: By studying Practice final exam coming soon! 3

Definition: SPACE(s(n)) = { L L is decided by a Turing machine with O(s(n)) space complexity} Definition: NSPACE(s(n)) = { L L is decided by a non-deterministic Turing Machine with O(s(n)) space complexity} 4

One Tape vs Many Tapes Theorem: Let s : N N satisfy s(n) n, for all n. Then every s(n) space multi-tape TM has an equivalent O(s(n)) space one-tape TM The simulation of multitape TMs by one-tape TMs achieves this! Corollary: The number of tapes doesn t matter for space complexity! One tape TMs are as good as basically any other model! 5

Theorem: NSPACE S(n) computations can also be simulated in at most 2 O(S(n)) time steps NSPACE(s(n)) TIME(2 c s(n) ) c N Key Idea: Think of the problem of simulating NSPACE(s(n)) as a problem on graphs. 6

Def: The configuration graph of M on x has nodes C for every configuration C of M on x, and edges (C, C ) if and only if C yields C G M,x To simulate a non-deterministic M in 2 O(S x ) time: do BFS in G M,x from the initial configuration! M has space complexity S(n) G M,x has 2 nodes c S( x ) M is deterministic every node has outdegree 1 M is nondeterministic some nodes may have outdegree > 1 7

k N PSPACE = SPACE(n k ) NPSPACE = NSPACE(n k ) k N 8

Savitch s Theorem Theorem: For functions s(n) where s(n) n Proof Try: NSPACE(s(n)) SPACE(s(n) 2 ) Let N be a non-deterministic TM with space complexity s(n) Construct a deterministic machine M that tries every possible branch of N Since each branch of N uses space at most s(n), then M uses space at most s(n)? There are 2^(2 s(n) ) branches to keep track of! 9

Given configurations C 1 and C 2 of a s(n) space machine N, and a number t, want to know if N can get from C 1 to C 2 within t = 2 k steps Procedure SIM(C 1, C 2, t): If t = 1 then accept iff C 1 = C 2 or C 1 yields C 2 within one step. [ uses space O(s(n)) ] If t > 1, then for every configuration C m of size s(n), if SIM(C 1,C m,t/2) and SIM(C m,c 2,t/2) accept then return accept return reject if no such C m is found SIM(C 1, C 2, t) has O(log t) levels of recursion Each level of recursion uses O(s(n)) additional space. Therefore SIM(C 1, C 2, t) uses only O(s(n) log t) space! 10

Theorem: For functions s(n) where s(n) n NSPACE(s(n)) SPACE(s(n) 2 ) Proof: Let N be a nondeterministic TM using s(n) space Let d > 0 be such that the number of configurations of N(w) is at most 2 d s( w ) Here s a deterministic O(s(n) 2 ) space algorithm for N: M(w): For all configurations C acc of N(w) in the accept state, If SIM(q o w, C acc, 2 d s( w ) ) accepts, then accept else reject Claim: L(M) = L(N) 11

Theorem: For functions s(n) where s(n) n NSPACE(s(n)) SPACE(s(n) 2 ) Proof: Let N be a nondeterministic TM using s(n) space Let d > 0 be such that the number of configurations of N(w) is at most 2 d s( w ) Here s a deterministic O(s(n) 2 ) space algorithm for N: M(w): For all configurations C acc of N(w) in the accept state, If SIM(q o w, C acc, 2 d s( w ) ) accepts, then accept else reject Why does it take only s(n) 2 space? 12

Theorem: For functions s(n) where s(n) n NSPACE(s(n)) SPACE(s(n) 2 ) Proof: Let N be a nondeterministic TM using s(n) space Let d > 0 be such that the number of configurations of N(w) is at most 2 d s( w ) Here s a deterministic O(s(n) 2 ) space algorithm for N: M(w): For all configurations C acc of N(w) in the accept state, If SIM(q o w, C acc, 2 d s( w ) ) accepts, then accept else reject SIM uses O(s(n) log t) space to simulate t steps of N. Set t = 2 d s( w ). Uses O(s(n) 2 ) space overall! 13

k N PSPACE = SPACE(n k ) NPSPACE = NSPACE(n k ) k N PSPACE = NPSPACE 14

PSPACE-complete problems 15

Definition: Language B is PSPACE-complete if: 1. B PSPACE 2. Every A in PSPACE is poly-time reducible to B (i.e. B is PSPACE-hard) Why poly-time? Theorem: If B is PSPACE-complete and B is in P then P = PSPACE Theorem: If B is PSPACE-complete and B is in NP then NP = PSPACE 16

Definition: A fully quantified Boolean formula is a Boolean formula where every variable in the formula is quantified ( or ) at the beginning the formula. These formulas are either true or false x y [ x y ] x [ x x ] x [ x ] x y [ (x y) ( x y) ] 17

TQBF = { is a true fully quantified Boolean formula} - SAT is the special case where all quantifiers are - TAUTOLOGY is the special case where all quantifiers are So, SAT P TQBF and TAUTOLOGY P TQBF Theorem (Meyer-Stockmeyer): TQBF is PSPACE-complete 18

QBF-SOLVER( ): TQBF is in PSPACE 1. If has no quantifiers, then it is an expression with only constants. Evaluate. Accept iff evaluates to 1. 2. If = x, call QBF-SOLVER on twice: first with x set to 0, then with x set to 1. Accept iff at least one call accepts. 3. If = x, call QBF-SOLVER on twice: first with x set to 0, then with x set to 1. Accept iff both calls accept. 19

TQBF is PSPACE-hard: Every language A in PSPACE is polynomial time reducible to TQBF We ll outline a proof of this. The missing details aren t necessary, but please ask questions! For every language A is in PSPACE, there is some k and some deterministic TM M that decides A using space kn k Our polynomial-time reduction will map every string w to a fully quantified Boolean formula of O(n 2k ) size that simulates M on w 20

A tableau for M on w is an table whose rows are the configurations of M on input w # q 0 w 1 w 2 w n # # # 2 O(nk ) # # n k 21

We ll construct a QBF that is true if and only if M accepts w of length n Let s(n) = n k. Suppose M(w) has 2b s n configs. Using two blocks of b s(n) Boolean variables denoted C and D representing two configurations of M on w, and integer t = 2 k, we ll construct a QBF C,D,t C,D,t is true if and only if M starting in config C reaches config D in t steps Then we ll set = C, C, h, where start acc h = 2 b s(n), upper bounds the number of configurations of M on w of length n C start = initial configuration of M on w, C acc = (unique) accepting configuration of M 22

IDEA: Work like Savitch s theorem. Guess the configuration in the middle of the computation, and use recursion! C,D,t will informally say: there exists a configuration E such that C,E,t/2 is true and E,D,t/2 is true Goal: If M uses n k space on inputs of length n, then our QBF will have size O(n 2k ) 23

If t = 1, then C,D,t should look like: C,D,1 = C equals D OR D follows from C in a single step of M How do we logically express C equals D? Write a Boolean formula saying that the block of b s(n) variables representing C equals the block of b s(n) variables representing D b s n i=1 C i = D i = i ((C i D i ) ( C i D i )) D follows from C in a single step of M? Use 2 x 3 windows as in the Cook-Levin theorem, and write a CNF formula 24

For t > 1, let s try to construct C,D,t recursively: C,D,t = E [ C,E,t/2 E,D,t/2 ] e 1 e 2 e S where S = b n k But how long is this formula?? Every level of the recursion cuts t in half but roughly doubles the size of the formula! We can get around this. Modify the formula to be: C,D,t = E X,Y [( (X,Y)=(C,E) (X,Y)=(E,D) ) x,y,t/2 ] This folds the two recursive sub-formulas into one! 25

C,D,t = E X,Y [( (X,Y)=(C,E) (X,Y)=(E,D) ) x,y,t/2 ] Set = c, c, h where h = 2 b s(n) start acc Each recursive step adds a part that is linear in the size of the configurations, so has size O(s(n)) Number of levels of recursion is log h O(s(n)) Therefore the size of is O(s(n) 2 ) 26

PSPACE is a complexity class for two-player games of perfect information For formalizations of many popular two-player games, it is PSPACE-complete to decide who has a winning strategy on a game board 27