The Australian National University Semester 1, 2020 Research School of Computer Science Tutorial 12 Dirk Pattinson

Theory of Computation

Get into groups of two, grab a whiteboard marker each, and write your names on top of your side of the board. Exercises with a ! denote harder ones, !! denotes very difficult, and !!! denotes challenge exercises beyond the scope of the course.

Exercise 1 Definitions PSPACE, or polynomially bounded space , is the class of languages recognized by a deterministic , with the condition that the tape head never visits more than p(n) cells on the tape, where n is the length of the input, and p is some polynomial. BPP, or bounded-error probabilistic polynomial time, is the class of languages recognized by a randomized Turing machine, with the condition that

• The probability of the machine making a error (accepting strings not in the language, or rejecting 1 strings in the language) is bounded above by 3 . • The worst case run time is bounded above by some polynomial p(n), where n is the length of input.

2 p(n) More formally, for an input string of length n, at least 3 of binary strings of length 2 placed on 1 the random tape cause the machine to accept (if x ∈ ), and at most 3 of all binary strings of length 2p(n) placed on the random tape cause the machine to accept (if x 6∈ L). EXPTIME, or exponential time, is the class of languages recognized by a deterministic Turing machine, where the worst case run time is bounded above by 2p(n), where p is a polynomial, and n is the length of the input.

Exercise 2 Comparing classes Prove the following inclusions.

1.P ⊆ PSPACE 2.P ⊆ EXPTIME

3. ! NP ⊆ PSPACE 4. ! BPP ⊆ PSPACE 5. !! PSPACE ⊆ EXPTIME

Exercise 3 PSPACE-Complete A language L is PSPACE-Hard if there exists a polytime from L0 to L, where L0 is any problem in PSPACE. A language is PSPACE-Complete if it is both PSPACE and PSPACE-Hard. A quantified boolean formula is a boolean formula permitting quantifiers for variables. For example,

∀x.∃y.x ∨ y (1) and

(∃y.y ∧ z) ∨ ¬(∀x.x) (2) A fully quantified boolean formula, or sentence, is a quantified boolean formula with no free variables, that is, every variable appears within the scope of a quantifier that refers to it. For example, (1) is a sentence, but (2) is not (as z is free). Note that every sentence must be either true or false, as there are no free variables. The quantified Boolean formula problem, or QBF, is the problem that, given a fully quantified boolean formula, is it equivalent to true? By an analogous proof to Cook’s theorem, it can be shown that QBF is PSPACE-Complete.

1. Let an (alternating quantified boolean formula) denote a quantified boolean formula of the form

∃x1.∀x2.∃x3 ... ∃xn.φ

where each of the xi’s represents any variable, and φ is a boolean expression. The alternating quantified Boolean formula problem, or AQBF, is the problem that, given a fully quantified alternating boolean formula, is it equivalent to true? Show that AQBF is PSPACE-Complete. The Geography game is a game played between two players. Given a finite directed graph with one vertex designated as a starting node, the players take turns listing nodes that form a simple path (no repeated verticies allowed.) The first person that cannot extend the path loses. Consider the following directed graph.

4

2 7

1 5 9

3 8

6

2. Player 1 goes first. Show that there is a winning strategy for Player 2. Formally, we define a geography graph G as a 3-tuple G = (V, , s) where (V,E) forms a directed graph, |V | < ∞, and s ∈ V denotes the starting node. The geography problem (GEO) is as follows: Given a geography graph G, is there a strategy for Player 1 such that they can force a win? 3. ! Define the DAG-GEO problem to be the same as the GEO problem, but the graphs are restricted to be directed acyclic graphs. Prove that DAG-GEO is in P. 4. !! Show that GEO is PSPACE-complete. You may assume that 3-AQBF (an AQBF formula where the boolean expression inside is 3-CNF) is PSPACE-Complete. (Hint: Think about how you can convert a 3-AQBF formula with alternating quantifiers to having players alternating guessing assignments to those variables. Have player 1 handle the existential quantifiers, and player 2 handle the universal quantifiers. Consider the following gadget as a starting point.) s

x1 ¬x1

x2 ¬x2

...

Figure 1: Geography game gadget