Docsity

Cook-Levin Theorem -Computability and Complexity - Exams, Exams of Advanced Algorithms

Toggle sidebar
bg1
CS 172: Computability and Complexity, Spring 2010 S. A. Seshia & O. Etesami
Final Exam
May 11, 2010
YOUR NAME:
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!
Problem 1 Problem 5
Problem 2 Problem 6
Problem 3
Problem 4 Total
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Cook-Levin Theorem -Computability and Complexity - Exams and more Exams Advanced Algorithms in PDF only on Docsity!

CS 172: Computability and Complexity, Spring 2010 S. A. Seshia & O. Etesami

Final Exam

May 11, 2010

YOUR NAME:

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!

Problem 1 Problem 5

Problem 2 Problem 6

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 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)∗.

Problem 2: [Buggy Proofs] (15 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) 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.

Problem 3: (25 points)

(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 }

Problem 4: (25 points)

(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)

Problem 6: (25 points)

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!