Docsity

CS 172: Computability and Complexity Midterm 1, Spring 2008, Exams of Advanced Algorithms

Toggle sidebar
bg1
CS 172: Computability and Complexity, Spring 2008 S. A. Seshia and A. Kulkarni
Midterm 1
February 26, 2008
YOUR NAME :
Instructions:
This exam is closed-book, open-notes. Please turn off and put away electronic devices such
as cell phones, laptops, etc.
You have a total of 60 minutes. There are 4 questions worth a total of 100 points. The
questions vary in difficulty, so if you get stuck on any question, it might help to leave it 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 can use without proof any result proved in
class, in Sipser’s book, or during discussion sections, but clearly state the result you are
using.
Do not turn this page until the instructor tells you to do so!
Problem 1
Problem 2
Problem 3
Problem 4
Total
1
pf3
pf4
pf5

Partial preview of the text

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

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

Midterm 1

February 26, 2008

YOUR NAME:

Instructions:

This exam is closed-book, open-notes. Please turn off and put away electronic devices such as cell phones, laptops, etc.

You have a total of 60 minutes. There are 4 questions worth a total of 100 points. The questions vary in difficulty, so if you get stuck on any question, it might help to leave it 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 can use without proof any result proved in class, in Sipser’s book, or during discussion sections, but clearly state the result you are using.

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

Problem 1

Problem 2

Problem 3

Problem 4

Total

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

For each of the following questions, state TRUE or FALSE. Justify your answer in brief, indicating only the “proof idea” or counterexample, drawing an annotated picture if needed.

(a) If the language L is context-free, then LR^ is also context-free. (Recall that LR^ is the language comprising reversals of all strings in L.)

(b) The class of regular languages is closed under the symmetric difference operator ⊕. (Definition: For any two sets A and B, A ⊕ B is the set of all items which are in either A or B but not both.)

(c) Let Σ = { 0 , 1 }. Every language recognizable by a 1 -state NFA is recognizable by a DFA with 1 state.

Problem 3: (25 points)

Let Σ = { 0 , 1 , +, =}. Consider the language L where

L = {a=b+c | a, b, c ∈ { 0 , 1 }∗^ where a = b + c if a, b, c are interpreted as

unsigned binary integers and + and = are interpreted as addition + and equality =}

For example, the string 10=01+01 is in L (2 = 1 + 1). But the string 10=11+01 is not in L ( 2 6 = 3 + 1).

Show L is not regular.

Problem 4: (25 points)

An N -constrained pushdown automaton (N-CPA) is exactly like a pushdown automaton except that it can only perform at most N push, pop, or swap operations. (A swap is a simultaneous push and pop.) The acceptance condition and unbounded stack are just as in the PDA.

Consider a 1000 -CPA. Define the language class C 1000 −CPA as the set {L | L is a language recognized by a 1000-CPA}.

Similarly, the set of all regular languages is Creg, and the set of all CFLs is Ccf.

One of the following relationships is TRUE. State which one, and provide a complete proof for the truth of this statement. You don’t need to justify falsity of the other statements.

  1. Creg ⊂ C 1000 −CPA ⊂ Ccf. (Note: ⊂ means “strict subset”)
  2. Creg = C 1000 −CPA.
  3. C 1000 −CPA = Ccf.

If you convert a DFA/PDA to a CPA or vice-versa, specify your construction precisely using the 5 -tuple/ 6 -tuple notation.