CMPSCI 401: Theory of Computation

Solutions to Second Midterm Exam, Spring 2011

David Mix Barrington

2 April 2011

Directions:

  Q1: 10 points
  Q2: 10 points
  Q3: 10 points
  Q4: 10 points
  Q5: 10 points
  Q6: 10 points
  Q7: 40 points
  Q8: 25 points

  Total: 125 points

Question text is in black, solutions in blue.

Some questions refer to two particular kinds of one-tape deterministic Turing machines. A Double=move Turing machine (DMTM) always moves exactly two squares left or right on a move. A Double-right Turing machine (DRTM) moves two squares when it moves right, but one square when it moves left. Recall that our Turing machines start on the leftmost square of the tape, on the first letter of the input (if any), and do not move if they are ordered to move left from leftmost square. We define ADMTM to be the set of pairs (M, w) where M is a DMTM, w is a string over the correct alphabet, and w ∈ L(M). We define ADRTM similarly.

The language REGCFG is the set of context-free grammars G such that L(G) is regular.

The language REGTM is the set of Turing machines M such that L(M) is regular.

The language CFLDFA is the set of DFA's M such that L(M) is a context-free language.

Recall that for two languages A and B, A ≤m B means that there is a function f, computed by a Turing machine that always halts, such that for any string w, w ∈ A if and only if f(w) ∈ B.

Last modified 2 April 2011