CMPSCI 501: Theory of Computation

Solutions to Second Midterm Exam, Spring 2015

David Mix Barrington

26 March 2015


  Q1: 10 points
  Q2: 10 points
  Q3: 10 points
  Q4: 10 points
  Q5: 10 points
  Q6: 10 points
  Q7: 35 points
  Q8: 30+10 points
 Total: 125+10 points

Question text is in black, solutions in blue.

Correction in red added 20 March 2016.

The set N of natural numbers is {0, 1, 2, 3,...}, not quite as defined in Sipser.

If C is any class of computers, such as DFA's, CFG's, LBA's, TM's, strange variant TM's, etc.:

A language is Turing recognizable (TR) if it is equal to L(M) for some Turing machine M.

A language is Turing decidable (TD) if it is equal to L(M) for some Turing machine M that halts on every input.

A language X is co-TR if and only if its complement is TR.

A function f from strings to strings is Turing computable if there exists a TM M such that for any string w, M when started on w halts with f(w) on its tape.

Recall that if A and B are two languages, A is mapping reducible to B, written A ≤m B, if there exists a Turing computable function f from Σ* to Σ* such that for any string w, w ∈ A ⇔ f(w) ∈ B.

A Deterministic Infinite Automaton (DIA) has a state set Q = {qi: i∈ N} = {q0, q1, q2,...}, a start state q0, a nonempty alphabet Σ, a final state set F ⊆ Q, and a transition function δ from Q × Σ to Q. It computes like a DFA, beginning at the left end of its finite input string, moving right one letter and updating its input string on every computation step, and finally accepting the input if and only if it finishes in a final state.

A Turing Computable DIA (TCDIA) is a DIA where the set F is Turing decidable and the function δ is Turing computable.

An All-String Turing Machine (ASTM) is a deterministic three-tape Turing machine with the following restrictions. The input alphabet Σ is {0, 1}, and the tape alphabet Γ contains Σ, a blank symbol, and perhaps other letters.

Tape 1 is read-only and gets the input string w on it, with a marker symbol at each end.

Tape 2, at any time during the computation, contains a string x ∈ Σ* between two marker symbols. At the beginning of the computation x is the empty string. The computation is divided into phases, during each of which Tape 2 remains unchanged. After the first phase x is changed to 0, after the second phase it is changed to 1, after the third to 00, and so on through all the possible strings of Σ* until or unless the machine accepts or rejects. No other computation takes place while Tape 2 is being updated at the end of each phase.

Tape 3 is read-write, and after every phase it is erased and reset to be blank, with two end markers that restrict the size of the useful portion of the tape to the current length of x.

As with the language of an ordinary TM, the language of an ASTM is the set of input strings w that cause it to eventually accept.

Last modified 20 March 2016