Practice Final Exam for Computability and Complexity | COMPSCI 172, Exams of Computer Science

Material Type: Exam; Class: Computability and Complexity; Subject: Computer Science; University: University of California - Berkeley; Term: Fall 2009;

Typology: Exams

2010/2011

Uploaded on 05/23/2011

koofers-user-5yc
koofers-user-5yc 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
U.C. Berkeley CS172: Automata, Computability and Complexity Practice Final Exam
Professor Luca Trevisan December 13, 2009
Practice Final Exam
1. Let L={wtw :w, t Σ}. Show that Lis not regular.
2. Let L={hri:ris a regular expression that accepts at least 2 strings}. Show that Lis de-
cidable.
3. Let L={hx, y, ni: max(K(x), K (y)) n}. Show that Lis not recognizable.
4. Let L={hM1, M2i:L(M1) = L(M2)}. Show that Lis not recognizable.
5. We define the NEIGHBOR problem as follows. An instance consists of an undirected graph
G= (V, E ) and an integer k. We must decide if there is a subset of nodes V0where every
node in Vis a distance of at most 1 from some node in V0. Additionally, we require |V0| k.
As an example, let V={a, b, c}and E={{a, b},{b, c}} and k= 1. Then V0={b}satisfies
the NEIGHBOR problem since aand care adjacent to b.
Show that NEIGHBOR is NP-complete.
6. Define U CY CLE ={hGi:Gis an undirected graph that contains a simple cycle}. Show
that UCY C LE L. (Note: Gmay not be connected.)
Hint. We can search through Gby traversing the edges incident on a vertex in lexicographic
order. That is, if we come in through the ith edge, we go out through the (i+ 1)th edge or
the first if the degree is i. How does this algorithm behave on a tree? On a graph with a
cycle?
7. Show that TIME(O(n2)) (the set of languages accepted by quadratic-time Turing machines)
is distinct from P.
1

Partial preview of the text

Download Practice Final Exam for Computability and Complexity | COMPSCI 172 and more Exams Computer Science in PDF only on Docsity!

U.C. Berkeley — CS172: Automata, Computability and Complexity Practice Final Exam Professor Luca Trevisan December 13, 2009

Practice Final Exam

  1. Let L = {wtw : w, t ∈ Σ∗}. Show that L is not regular.
  2. Let L = {〈r〉 : r is a regular expression that accepts at least 2 strings}. Show that L is de- cidable.
  3. Let L = {〈x, y, n〉 : max(K(x), K(y)) ≥ n}. Show that L is not recognizable.
  4. Let L = {〈M 1 , M 2 〉 : L(M 1 ) = L(M 2 )}. Show that L is not recognizable.
  5. We define the NEIGHBOR problem as follows. An instance consists of an undirected graph G = (V, E) and an integer k. We must decide if there is a subset of nodes V ′^ where every node in V is a distance of at most 1 from some node in V ′. Additionally, we require |V ′| ≤ k. As an example, let V = {a, b, c} and E = {{a, b}, {b, c}} and k = 1. Then V ′^ = {b} satisfies the NEIGHBOR problem since a and c are adjacent to b. Show that NEIGHBOR is NP-complete.
  6. Define U CY CLE = {〈G〉 : G is an undirected graph that contains a simple cycle}. Show that U CY CLE ∈ L. (Note: G may not be connected.) Hint. We can search through G by traversing the edges incident on a vertex in lexicographic order. That is, if we come in through the ith edge, we go out through the (i + 1)th edge or the first if the degree is i. How does this algorithm behave on a tree? On a graph with a cycle?
  7. Show that TIME(O(n^2 )) (the set of languages accepted by quadratic-time Turing machines) is distinct from P.