Docsity

CS 172: Computability and Complexity Final Exam, Spring 2008, Exams of Advanced Algorithms

Toggle sidebar
bg1
CS 172: Computability and Complexity, Spring 2008 S. A. Seshia & A. Kulkarni
Final Exam
May 20, 2008
YOUR NAME :
Instructions:
This exam is closed-book, open-notes. Please turn off electronic devices: cell phones,
laptops, PDAs, etc.
You have a total of 180 minutes. There are 5 questions worth a total of 150 points. The
questions vary in difficulty, so if you get stuck on any question, it might help to leave it for
a while and try another one.
Answer each question in the space provided below the question. If you need more space,
you can use the reverse side of that page. You may assume without proof any result that
was proved in class or on a homework, but state your assumptions clearly. Descriptions of
Turing machines can be in the form of Sipser’s “high-level descriptions”. Show your work
in all proofs.
Do not turn this page until the instructor tells you to do so!
Problem 1 Problem 5
Problem 2
Problem 3
Problem 4 Total
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download CS 172: Computability and Complexity Final Exam, Spring 2008 and more Exams Advanced Algorithms in PDF only on Docsity!

CS 172: Computability and Complexity, Spring 2008 S. A. Seshia & A. Kulkarni

Final Exam

May 20, 2008

YOUR NAME:

Instructions:

This exam is closed-book, open-notes. Please turn off electronic devices: cell phones, laptops, PDAs, etc.

You have a total of 180 minutes. There are 5 questions worth a total of 150 points. The questions vary in difficulty, so if you get stuck on any question, it might help to leave it for a while and try another one.

Answer each question in the space provided below the question. If you need more space, you can use the reverse side of that page. You may assume without proof any result that was proved in class or on a homework, but state your assumptions clearly. Descriptions of Turing machines can be in the form of Sipser’s “high-level descriptions”. Show your work in all proofs.

Do not turn this page until the instructor tells you to do so!

Problem 1 Problem 5

Problem 2

Problem 3

Problem 4 Total

Problem 1: [True or False, with justification] (40 points)

For each of the following 5 questions, state TRUE or FALSE. If TRUE, give a short proof. If FALSE, give a simple counterexample.

(a) The language PALIN of all palindromes over { 0 , 1 } is in NP.

(b) Every countable language is decidable and every decidable language is countable. (Or, equivalently, a language L is decidable if and only if L is countable.)

(c) The following language is Turing-recognizable: {〈G, w〉 | G is a context-free grammar , w ∈ L(G)}.

Problem 2: [Short Answers] (30 points)

(a) (12 points) Describe how the following classes are related to each other using subsets and equal- ity: (i) PSPACE, NL, NP, L, NPSPACE, P (no justification needed)

(ii) PSPACE, RP, BPP, P (no justification needed)

(iii) What is the most precise relationship you can state between L and PSPACE? Justify your answer.

(b) (18 points) Recall that language L is in the complexity class co-NP iff L is in NP.

(i) Give an example of a language that is in co-NP ∩ NP. Justify briefly.

(ii) prove that if any language in co-NP ∩ NP is NP-complete, then co-NP = NP.

Problem 3: [Buggy Proofs] (20 points)

Each question below contains a false “proof” of some statement with exactly one mistake. For each part, identify the mistake in the reasoning and explain briefly why it is wrong. [NOTE: Answers that identify more than one mistake will be penalized! Note also that the statement itself may or may not be true.]

(a) Claim: 3SAT ≤P 2SAT Proof : Consider an algorithm that carries out the reduction as follows. Input: A 3-CNF Boolean formula φ Output: A 2-CNF Boolean formula γ Find a satisfying assignment to φ (if none exists, output γ = 0). For every clause Ci of φ that has 3 literals, there two cases. If all the literals are set to 1, then we simply drop one literal arbitrarily. If some literal is set to 0, we drop that literal, resolving choices arbitrarily. After processing all such 3-literal clauses, the resulting problem is the desired 2-CNF formula γ. The reduction runs in polynomial time because we make a single pass over the for- mula φ. The reduction is correct because if φ ∈ 3SAT, then by construction, the same satisfying assignment satisfies γ. If φ /∈ 3SAT, then γ = 0 is not satisfiable. Thus, 3SAT ≤p 2SAT.

(b) Statement: The following language L is not context-free: L = { 0 m 1 n 2 l^ | m, n, l ≥ 0 }. Proof: Suppose for a contradiction that L is context-free. Let p be the minimum pumping length as in the pumping lemma and pick s = 0p 1 p 2 p. Clearly, s ∈ L. By the pumping lemma, s can be split into five pieces, s = uvxyz, where for any i ≥ 0 , uvixyiz ∈ L. u is of the form 0 j^1 k^ for some non-negative j, k not both equal to zero

such that j + k ≤ p. Pick i ≥ 2. Then s′^ = uvixyiz will have some ones before zeros, so s′^ ∈/ L. Thus, L is not context-free by the pumping lemma.

(extra page)

Problem 5: (30 points)

Two groups from Berkeley are putting together teams for the next Robotics Grand Chal- lenge (RGC): building a robot that aces exams!

Each team is comprised of n students led by a professor. k topic areas of EECS are critical to the competition. For each topic area, a student is either an expert in that area or not.

It is guaranteed that Team1 led by Prof1 will succeed if it includes at least one student expert from each of the k topic areas (irrespective of what Team2 does). Otherwise, Team (led by Prof2) will win.

The professors select their teams from 2 n students as follows. First, the students are arbi- trarily organized into an ordered sequence of pairs P 1 , P 2 ,... , Pn. Prof1 starts by picking one student from P 1 (the other goes to Team2), then Prof2 picks a student from P 2 (with the other going to Team1) and so on, until each student has been allocated to some team.

Consider the problem RGC1 defined below:

RGC1 = {〈P 1 , P 2 ,... , Pn〉 | Team1 has a winning strategy for the ordered sequence of student pairs P 1 , P 2 ,... , Pn}

Here each Pi denotes a student pair with their associated topics (subject areas).

Show that RGC1 is PSPACE-complete.

[Hint: Use a reduction from TQBF. Don’t forget to show that RGC1 is in PSPACE.

You can assume the following definition of TQBF:

TQBF = {〈φ〉 | φ is a true fully quantified Boolean formula of the form ∃x 1 ∀x 2 ∃x 3... Qnxnψ(x 1 , x 2 ,... , xn) with ψ in CNF }

]

Thank you, and have a good summer!