SOLUTION: SOLUTION: SOLUTION:

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

Advanced topic: Space complexity

6.045 Final Exam Solutions

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

CSE200: Computability and complexity Space Complexity

6.840 Language Membership

Introduction to Computational Complexity

Lecture 22: PSPACE

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

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

Time and space classes

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

Exam Computability and Complexity

Lecture 23: More PSPACE-Complete, Randomized Complexity

Outline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018

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

Space Complexity. Huan Long. Shanghai Jiao Tong University

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

Time to learn about NP-completeness!

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

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

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

1 PSPACE-Completeness

CS154, Lecture 13: P vs NP

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

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

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

CS154, Lecture 13: P vs NP

CSCE 551 Final Exam, April 28, 2016 Answer Key

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

Notes on Space-Bounded Complexity

MTAT Complexity Theory October 13th-14th, Lecture 6

BBM402-Lecture 11: The Class NP

INAPPROX APPROX PTAS. FPTAS Knapsack P

Intro to Theory of Computation

Notes on Space-Bounded Complexity

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

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

Complexity Theory 112. Space Complexity

Complexity (Pre Lecture)

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

PSPACE COMPLETENESS TBQF. THURSDAY April 17

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

Computability and Complexity CISC462, Fall 2018, Space complexity 1

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).

Time to learn about NP-completeness!

Lecture 16: Time Complexity and P vs NP

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

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

Notes for Lecture Notes 2

Lecture 24: Randomized Complexity, Course Summary

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

CSCI3390-Lecture 14: The class NP

1 More finite deterministic automata

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

9. PSPACE 9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

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

Notes on Complexity Theory Last updated: October, Lecture 6

CSE 135: Introduction to Theory of Computation NP-completeness

1 Computational Problems

CSCE 551 Final Exam, Spring 2004 Answer Key

Chapter 9. PSPACE: A Class of Problems Beyond NP. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

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

Umans Complexity Theory Lectures

CS5371 Theory of Computation. Lecture 24: Complexity IX (PSPACE-complete, L, NL, NL-complete)

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

The Cook-Levin Theorem

Answers to the CSCE 551 Final Exam, April 30, 2008

UNIT-IV SPACE COMPLEXITY

Computer Sciences Department

Chapter 7: Time Complexity

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

Lecture 4 : Quest for Structure in Counting Problems

Lecture 7: The Polynomial-Time Hierarchy. 1 Nondeterministic Space is Closed under Complement

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

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

CSCI3390-Lecture 16: NP-completeness

NP Complete Problems. COMP 215 Lecture 20

Complexity Theory Part II

Computability and Complexity

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

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

Theory of Computation

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

NP-Completeness. Sections 28.5, 28.6

Quantum Computing Lecture 8. Quantum Automata and Complexity

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

1 Deterministic Turing Machines

Finish K-Complexity, Start Time Complexity

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Friday Four Square! Today at 4:15PM, Outside Gates

Lecture 8: Complete Problems for Other Complexity Classes

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

1 Deterministic Turing Machines

Computability and Complexity Theory: An Introduction

Transcription:

Convert R and S into nondeterministic finite automata N1 and N2. Given a string s, if we know the states N1 and N2 may reach when s[1...i] has been read, we are able to derive the states N1 and N2 may reach when s[1...i+1] has been read. Consider the following nondeterministic Turing machine M which tries to guess a string on which exactly one of N1 and N2 accepts. Instead of storing the guessed string, M keeps guessing the next bit of the string and forget about its previous bits. Upon guessing the next bit, M updates the states N1 and N2 may reach after reading the string guessed so far. If after guessing some bit, M finds that exactly one of N1 and N2 may reach an accepting state while the other cannot, M declares N1 and N2 are different and accepts. Note that M runs in polynomial space although it may fail to halt. Clearly N1 and N2 differ if and only if M(R,S) has an accepting

computation branch. Applying Savitch's theorem that NPSPACE=PSPACE=coNPSPACE will do the job. Solution: To show GM PSPACE, we assume that P is a grid of X,O and empty with input length is O(n 2 ). Now we will write algorithm, it accept incase of winning strategy for player X with starting point is P. Algorithm: 1. Potential X moves without marking on all spaces i in position P.

i. Change the position to p by putting the X marker on space i. if there is 5 X s in a row, accept (good move), if board is full now and no one is winner, reject. ii. else Potential O moves without marking on all spaces j in position P. a. Change the position to P by putting the O on space j. if there is 5 O s in a row or board full and no one is winner then loop to next i, move to step1, poor move by putting an X on i. b. else run GM(p ). if accept then loop to next j and go to step b.,if iii. rejects then loop to the next I and go to step1. If GM(p ) accept due to all j, i good move for X, all possible O moves has been covered, accept. 2. Reject, if no i in step 1 causes accept, bad move from this point, hence reject. We can reuse the space, so O(n 2 ) deep. We require to store configurations P,P at each level, it means we need O(n 2 ) space for maximum n 2 moves. Total space required is O (n 4 ) for polynomial time input length O (n 2 ). Now consider the given problem with 19 X19 grid mean 19 2 spaces on the board with 3 19X19 configurations. It is a big enough. In complexity theory even though a number is too bigger but any expression without variable is just a small constant. We can fit things into our complexity classes by generalizing things to variable length. So we prefer to generalize things to variable length. We have risk of input too small if configuration down as n. if we want to know winning strategy from the start because no markers have been placed. There is required to much space to write down the number n with input length log n. Might be O(n 4 ) spaces are still required for algorithm but it exponential in our input length, this shows that GM PSPACE Solutions: P NP P-SPACE NP P-SPACE Given every NP-Hard language is also PSPACE-Hard want to show that NP =PSPACE. From our assumption we know that if every NP-Hard is also PSPACEHard we know that then every NP-Complete language is also PSPACE-Hard since NP-Hard contains all of the NP-complete problems by definition. So we also know that SAT is PSPACE-Hard. And from the assumption that for any A in PSPACE, A reduces to SAT. Claim then we can solve A in NP. Create a TM, N as follows. on input x, do Compute f(x), the poly-time reduction between A and SAT. Decide whether f(x) is satisfiable, if so, accept, otherwise reject. Claim N decides A since x is in A iff f(x) is in SAT. Also notice that N is an NP machine since computing SAT is in NP

Solution: We will reduce TQBF to PUZZLE. Consider any TQBF instance in its CNF form. Let m denote the number of clauses and n denote the number of variables. We will consider an instance of PUZZLE with n cards, each of which corresponds to one of the variables and in the same order as the quantifiers in the TQBF instance. The box have m holes all on the right column. We will define each card as follows: For each row i, the card would have exactly one hole on the right for row i if letting the variable to be true would satisfies the i th clause; it would have exactly one hole on the left if letting the variable to be false would satisfies the clause; let there be two holes otherwise. Each step, the player chooses one side of the cards and hence choose the truth assignment for the corresponding variable (front for true, and back for false). The TQBF instance is satisfied if-and-only-if for each row at least one of the cards blocks the hole, that is, at least one of the literals in the clause has value true.

Solution: We first note that the game can have only 2n 2 configurations, defined by position of the cat, position of the mouse and if it is cat s turn. So, we can construct a directed graph consisting of 2n 2 nodes where each node corresponds to a game configuration and there is an edge from node u to node v, if we can go from configuration corresponding to u to configuration corresponding to v in one move. Now following algorithm solves HAPPY-CAT. 1. Mark all nodes (a, a, x) where a is a node in G, and x {true, false}. 2. If for a node u = (a, b, ture), there is a node v = (c, b, false) which is marked and (u, v) is an edge then mark u. 3. If for a node u = (a, b, false), all nodes v = (a, c, false) are marked and (u, v) is an edge then mark u. 4. Repeat steps 2 and 3 until no new nodes are marked. 5. Accept if start node s = (c, m, true) is marked. The algorithm takes O(n 2 ) time to perform step 1, O(n 2 ) time per iteration of the loop and loop is executed O(n 2 ) times. Hence runs in polynomial time. Solution. We know that the class L contains all problems requiring only a fixed number of counters/pointers to solve them. The language A requires one counter. Initially, the counter is 0, and, as the head moves to the right along the tape, the counter is incremented by 1 if the symbol read is (, and it is decremented by 1 if the symbol read is ). If the counter ever becomes negative we reject the string (more closing parentheses then opening ones). If the counter is positive after reading the last symbol in the string, we reject (more opening parentheses then closing ones). Otherwise, we accept.

Solution I show that BIPARTITE NL. Since NL = conl, the desired result follows. An undirected graph G is not bipartite, if and only if G contains an odd cycle. Given G, we then search for odd cycles non deterministically using log-space. First nondeterministically choose a vertex u V(G) and remember u till the end of all branches of computation originating from the selection of u. Also maintain a current vertex v and a count i. Initially set v := u and i := 0. While i < m (where m is the number of vertices in G) repeat: If v has degree 0, reject, else nondeterministically choose an edge (v, v0) E(G). Increment i and set v := v0. If i is odd and v = u, accept. Otherwise, repeat the loop with the new v. If the loop terminates (i.e., if i > m), reject. It is clear that this nondeterministic algorithm detects odd cycles in G. On the other hand, if G does not contain an odd cycle, all branches of computation reject. We need to provide storage only for the vertices u, v, v 0 and for the counter i. This can be achieved in log-space only.

First, A_NFA is in NL, as we can, on input NFA M and x, non deterministically choose one next state transition. The variables recording "how much of x has been read" and "what state M is in" are only logarithmically long. To show A_NFA NL-hard, we need only show that PATH log-space reduces to A_NFA: Given as input a directed graph G=(V,E) and two of its nodes, x and y, we construct an NFA N with its states corresponding to G's nodes, its transitions under alphabet 0 corresponding to G's directed edges. Then, for N's accepting state (the state representing y), we let it go back to itself on all input alphabets, and, for other states, upon reading a 1, we go into a "trap" state which is deemed to reject. It can now be shown that x goes to y in G iff on input 00...000 ( V of 0's), N accepts. This completes the proof.