Presentation on theme: "CSCI 4325 / 6339 Theory of Computation Zhixiang Chen."— Presentation transcript:
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen
Chapter 8 Space Complexity
Topics Savitch’s Theorem PSPACE Class, PSPACE-Completeness, The TQBE Problem L and NL NL-Completeness, the PATH Problem NL=co-NL
Space Complexity Definition. Let M be a DTM that halts on all inputs. The space complexity of M is the function where f(n) is the maximum number of tape cells that M scans on any input of length n. We say M runs in space f(n). If M is a NTM wherein all branches halt on all inputs, we define its space complexity f(n) to be the maximum number of tape cells that M scans on any branch of its computation for any input of length n.
Space Complexity Classes Definition Let be a function. We define space complexity classes L is a language decided by an O(f(n)) space DTM} L is a language decided by an O(f(n)) space NTM}
Savitch’s Theorem Theorem. For any function where we have
Proof. For space O(f(n)), the total number of config’s is Use “binary-search” to decide whether C-start yields c-accept in steps. Use a stack to maintain the recursive calls. Initial Config C-start Final Config c-accept mid Config c-middle
PSPACE vs. NPSPACE Definition By Savitch’s Theorem,
A New World P NP NP-complete PSPACE EXPTIME
PSPACE-Completeness Definition A language B is PSPACE-complete if 1. B is in PSPACE 2. Every language in PSPACE is ploy-time reducible to B. If M merely satisfies condition 2, we say B is PSPACE-hard.
The TQBF Problem Quantified Boolean functions or and is a Boolean CNF formula. is true if exists some value of is true. is true if for all values of is true. Example
TQBF TQBF is the set of all true fully quantified Boolean formulas. The TQBF problem is to determine whether a fully quantified Boolean formula is true or false.
TQBF is PSPACE-complete. Proof. We can view the evaluation process of a given fully quantified formula as a tree, performing depth-first search of the tree gives a poly-space algorithm. So, TQBF is in PSPACE. To prove TQBF is PSPACE-hard, we need to construct a fully quantified Boolean formula to simulate the computation of a given space TM M so that
The Classes L and NL Sublinear space TM: A TM M with one read-only input tape and read/write work tape. The read head remains in the portion of the input tape containing the input. The space used on the work tape contributes to the space complexity. Definition Example
The PATH problem
PATH is in P Easy PATH is in NL Starting a node s, the machine records only the current node and nondeterministically guesses the next node among those adjacent to the current node. Repeat until t is found, or all m guesses have been done, where m is the number of nodes. This is done in NL.
New Configurations If M is a TM that has a separate read-only input tape and w is an input, a configuration of M on w is the setting the state, the work tape, and the positions of the two tape heads. The input w is not part of the configuration of M on w. q
NL-Completeness Log space transducer: A TM with a r-only input tape, and r/w work tape and a w-only output tape. A log space transducer computes a function using log space of work tape, the result of the function is written on the output tape. Log space reduction:
A language B is NL-complete if However, L=?NL is also open.
PATH is NL-Complete Proof. PATH is in NL is known Need to show every A in NL is log space reducible to PATH. Let the log space NTM M computing A. Simulate the computation of M on w, find all possible configurations of M on w to express nodes for a directed graph. Let s be and t be the start and accept configurations of M on w. Have an edge from one node to another node is the first yields the second. M accepts w iff there is a directed path from the start node to the accept node.
NL=Co-NL Proof. Since PATH is in NL, it suffices to show
Suppose we know that the number of nodes in G that are reachable from s is c. Nondeterministically select exactly c nodes reachable from s, not including t, and prove that each is reachable from s by guessing the path. If this is true, then the remaining nodes, including t, is not reachable from s, so accept. Otherwise, reject.
How to compute the number of nodes reachable from s?