







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!








CS 172: Computability and Complexity, Spring 2010 S. A. Seshia & O. Etesami
May 11, 2010
Instructions:
This exam is open-book, open-notes. Please turn off electronic devices: cell phones, lap- tops, PDAs, etc.
You have a total of 180 minutes. There are 6 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!
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 following language L is decidable:
L = {ăMă | M is a TM and, for all inputs w, M accepts w within 10000 steps }
(b) If some regular language is NP-complete, then P = NP.
(c) If r and s are any two regular expressions, then (r âȘ s)â^ = râ^ âȘ sâ^ âȘ (rs)â.
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) Statement: Let L be regular. Then LâČ^ = {ww : w â L} is regular. Proof: We recall first that the concatenation of two regular languages is regular. Since LâČ^ = L · L, it follows that LâČ^ must also be regular.
(b) Statement: For every computable function f : N â N, there exists a computable function g : N â N such that for every n we have f (n) †g(n). Proof: Assume, for the sake of arriving at a contradiction, that for some computable function f , for every computable function g, there exists an n such that f (n) > g(n). For each computable function g, let n(g) be the smallest n such that f (n) > g(n). Let n 0 be the maximum of n(g) over all computable functions g, and assume this maximum is achieved for g 0 , that is, n(g 0 ) = n 0. Define a function g 1 that is equal to g 0 for all values except for n 0 , and for n 0 we have g 1 (n 0 ) = f (n 0 ). This function g 1 is computable because 1) g 0 is computable and 2) g 1 differs from g 0 in only one point. By definition, n(g 1 ) â„ n(g 0 ) + 1, and this contradicts the fact that n(g) was maximized at g 0.
(a) (10 points) Describe how the following classes are related to each other using subsets and equal- ity: (give the most precise relationship possible â i.e. give equality or strict contain- ment where it holds; no justification needed) NL, L, NPSPACE, PSPACE, EXPSPACE, P, NP, EXPTIME
(b) (15 points) Prove or disprove that the following language is in PSPACE: N = {ăMă|M is an NFA with L(M) 6 = ÎŁâ^ where ÎŁ is the alphabet of M }
(a) (15 points) Let A be a language that is neither empty nor ÎŁâ. Consider the following two sets of languages: L = {B | B â€P A} and U = {B | A â€P B}. Prove that one of these sets is countable and the other one is uncountable.
(b) (10 points)
Let L be any language that is not Turing-recognizable. Define the language LâČ^ = {x| (x has odd length and x â L) or (x has even length and x 6 â L)}. Show that LâČ^ and its complement LâČ^ cannot both be Turing-recognizable.
(extra page)
Consider the language ODD-CYCLE defined below:
ODD-CYCLE = {ăGă | G is a directed graph with a simple directed cycle of odd length }
A cycle is simple if no vertex appears on the cycle twice. A cycle is directed if the cycle preserves the direction of the edges (i.e., all edges in the cycle are oriented in the same direction).
Show that ODD-CYCLE is NL-complete.
[Hint: Use a reduction from PATH. Donât forget to show that ODD-CYCLE is in NL.
Assume the following definition of PATH:
PATH = {ăG, s, tă | G is a directed graph with a path from s to t }
]
Thank you, and have a good summer!