CMPSCI 401: Theory of Computation

First Midterm Exam, Spring 2010

David Mix Barrington

22 February 2010

Directions:

  Q1: 10 points
  Q2: 10 points
  Q3: 10 points
  Q4: 10 points
  Q5: 35+10 points
  Q6: 20 points (note the exam paper said "30" here)
  Q7: 30 points

  Total: 125+10 points

Several questions refer to the following PDA called P. P has state set {q0, q, f}, start state q0, final state set {f}, input alphabet {a, b}, and stack alphabet {$, c}. It has six transitions: (q0, ε, ε; q, $), (q, a, ε; q, c), (q, b, ε; q, c), (q, a, c; q, ε), (q, b, c; q, ε), and (q, ε, $; f, ε). (Remember that a transition (p, a, b; q, c) means that the machine may go from state p to state q reading a from the input, popping b, and then pushing c.)

The grammar G is defined to have rules S --> SS, S --> aSa, S --> aSb, S --> bSa, S --> bSb, and S --> ε. It was on the test paper but I only noticed in February 2011 that is was not defined here. (DAMB)

Last modified 13 February 2011