

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


U.C. Berkeley — CS172: Automata, Computability and Complexity Solutions to Midterm 2 Professor Luca Trevisan 4/18/
(a) Let M be a deterministic Turing machine that, on inputs of length n, uses space O(n^2 ). Then for every input x, and every configuration C of the computation of M on input x, K(C) ≤ O(|x|) there K is Kolmogorov complexity and |x| is the length of x. (b) Let M be a deterministic Turing machine that, on inputs of length n, uses space O(n^2 ) and time O(n^3 ). Then for every input x, and every configuration C of the computation of M on input x, K(C) ≤ O(|x|) where K is Kolmogorov complexity and |x| is the length of x.
[30 points] Solution Outline:
(a) The statement is false. Consider a machine M which simply looks at the length n of the input and then enumerates all possible strings of length n^2 on its tape. Since there is a string C of length n^2 such that K(C) ≥ O(n), we get a contradiction. (b) This statement is true. Any configuration C of the machine can be describes by spec- ifying the code of the machine, the input and the time at which the configuration occurs. Since the code of the machine is a constant, the time can be specified in O(log |x|^3 ) = O(log x) bits and the input is |x| bits, this gives K(C) ≤ O(|x|).
#SAT = {〈ϕ, k〉 | ϕ has exactly k satisfying assignments}
Show that:
(a) #SAT is coNP hard (recall that coNP = {L | L ∈ NP}). (b) #SAT ∈ PSPACE.
[40 points] Solution Outline:
(a) To show #SAT is coNP hard, note that ϕ ∈ SAT ⇔ 〈ϕ, 0 〉 ∈ #SAT as SAT is the set of all the formulas which are unsatisfiable i.e. have exactly 0 satisfying assignments. This shows that SAT ≤p #SAT which proves the claim. (b) We enumerate all possible assignments to the variables and for each assignment, we can check if it satisfies the formula. We also keep a count of the satisfying assignments. Since it takes n bits to store an assignment, n bits to store the counter (as there can be at most 2n^ satisfying assignments), polynomial space to check if a given assignment satisfies the formula, the algorithm uses polynomial space overall.