CMPSCI 401: Theory of Computation

Solutions to Second Midterm Exam, Spring 2012

David Mix Barrington

29 March 2012


Question text is in black, solutions in blue.

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

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

A queue machine (QM) is a deterministic machine with a finite state set and one additional memory organized as a queue. At any time step the QM sees the next input character and the character at the front of the queue. Its move is to dequeue that character, move to the next input character (if any), enqueue zero or more characters, and change its state. It has and accepting and a rejecting final state, and it may continue computing after finishing its input.

A right-end Turing machine (RETM) has one or more tapes, each of which has a $ as its leftmost character. The first tape has the input after the $, and the others (if any) have blanks. The head of each tape starts on the leftmost blank on its tape. The RETM must satisfy the following rule -- on each tape the head must always be either on the rightmost nonblank character of its tape or on the leftmost blank character of 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 function f: Σ* → Σ* such that for any string w, w ∈ A ↔ f(w) ∈ B. The languages A and B are mapping equivalent, written A ≡m B, if both A ≤m B and B ≤m A are true.

A language A is Turing recognizable (TR) if it equals L(M) for some Turing machine M. A is Turing decidable if A = L(M) for some Turing machine M that always halts. A function f is Turing computable if there exists a Turing machine M such that for any string w, M when started on w halts with f(w) on its tape.

Last modified 4 April 2012