Tuesday, March 11, 2008 * Alternating Turing Machines * Alternating Space and Time * The Polynomial Hierarchy ALTERNATING TURING MACHINES Last class we saw that QBF -- satisfiable formulas with alternating quantifiers -- is PSPACE-complete. Recall that SAT is simply the set of QBF formulas with only one "level" of existential quantifiers. This captures the class NP. One "level" of universal quantifiers captures co-NP (all branches lead to rejection). Longer sequences of alternating quantifiers lead to new complexity classes within PSPACE. Alternation is a generalization of nondeterminism. A nondeterministic TM accepts a string when at least one branch accepts. We can view this as an OR-computation (spawning a set of processes, any one of which accepts). We could also consider a TM that accepts a string when all of its branches accept. We can view this as an AND-computation. An alternating TM is a TM that uses both AND- and OR-computations. Definition: An alternating TM is like a nondeterministic TM with two kinds of states: AND- and OR-states. A configuration is an AND- (resp., OR-configuration) if its state is an AND- (resp., OR-state). An OR-configuration (resp., AND-) in a computation tree is labeled accepting, if any one (resp., all) of its child configurations is (resp., are) accepting. The q_accept state is as an AND-state with no successors. The q_reject state is an OR-state with no successors. The time or space taken by an ATM during a computation is the maximum time or space used during a computation branch. ATIME(T(n)) = {L: L is accepted by an ATM in time O(T(n))} ASPACE(T(n)) = {L: L is accepted by an ATM in space O(T(n))} AP = U_k ATIME(n^k) APSPACE = U_k ASPACE(n^k) AL = ASPACE(log(n)) ALTERNATING SPACE AND TIME There is a strong correspondence between space and alternating time. To within a polynomial factor, alternating time is the same as deterministic space, and alternating space is the same as exponentially more deterministic time. THEOREM: Let T(n) >= n and S(n) >= log(n). Then (1) ATIME(T(n)) is subset of SPACE(T(n)) (2) SPACE(S(n)) is subset of ATIME(S(n)^2) (3) ASPACE(S(n)) is subset of TIME(2^{O(S(n))}) (4) TIME(T(n)) is subset of ASPACE(log(T(n))) Proof: (1) This is similar to the proof that QBF is in PSPACE. Let L be a language in ATIME(T(n)) and let M be the ATM for L. Given a string w, we will recursively determine, for each node in the computation tree of M on w, whether it is accepting. For an AND-node, we will check whether each of its children node is accepting; for an OR-node, we will check whether any one of its children nodes is accepting. At any instant, the stack holds only one branch-worth of information. Since the length of any branch is O(T(n)), so is the space used in any branch; hence, L is decided by a deterministic O(T(n)) space TM. (2) We can, in fact, prove the stronger statement that NSPACE(S(n)) is subset of ATIME(S(n)^2). Let L be a language in NSPACE(S(n)) and let M be a NDTM for deciding L. Consider the computation tree of M on a given string w. This could be quite long -- 2^{Theta(S(n))}. We need to be able to do the same work in much less (alternating) time. Alternation allows us to use a combination of AND- and OR-quantifiers. The proof is similar to the PSPACE-completeness of QBF (which bears similarity to Savitch's theorem). We define PARSAV(A, B, k), which returns true if A yields B in <= k steps. To compute PARSAV(A, B, k): if k = 0 or 1, can do so in one step. Otherwise, check whether there exists C such that PARSAV(A, C, k/2) AND PARSAV(C, B, k/2). The ATM for L finally returns PARSAV(Q_0, Q_f, 2^{O(S(n))}). Note that the length of a branch is O(S(n)), and each configuration takes space O(S(n)) and hence O(S(n)) time to write down. So time taken on any branch is O(S(n)^2). (3) Let L be a language in ASPACE(S(n)). Let M be an ATM deciding L. Consider the computation tree of M on w. Let d denote the maximum degree of any node. The total number of possible configurations of M with space S(n) is |w|2^{S(n)}S(n) = 2^{O(S(n))}, if S(n) >= log(n). So we can do a traversal of the computation tree in 2^{O(S(n))} deterministic time, evaluating an AND-node to be accepting if each of its children are accepting and an OR-node to be accepting if at least one of its children is accepting to arrive at an accept/reject decision. (4) Let L be a language in TIME(T(n)). We know that there exists a circuit of size O(T(n)^2) that decides L. Each gate of the circuit can be indexed using space O(log(T(n))). Given an input w, the value of an OR-gate can be computed using an OR-node in the computation tree, and the value of an AND-gate using an AND-node in the tree. The only space needed is to for the index of the current gate being evaluated. Note that PSPACE = AP. POLYNOMIAL-TIME HIERARCHY A Sigma_i machine is an ATM such that the computation tree consists of at most i alternating intervals of OR and AND-nodes, and the first interval consists of OR-nodes. A PI_i machine is an ATM such that the computation tree consists of at most i alternating intervals of OR and AND-nodes, and the first interval consists of AND-nodes. A Sigma_1 machine is an NDTM. Sigma_0 machines are DTMs. Sigma_i TIME(T(n)) = {L: L is decided by a Sigma_i machine in time O(T(n))} Sigma_1 P = NP Pi_1 P = co-NP PH = U_k Sigma_k P = U_k Pi_k P Note that Sigma_i P and Pi_i P are both subset of Sigma_{i+1} P and Pi_{i+1} P. Note that PH is subset of PSPACE.