CMPSCI 401: Theory of Computation
Final Exam, Spring 2009
David Mix Barrington
18 May 2009
Directions:
- Answer the problems on the exam pages.
- There are eight problems
for 120 total points plus 15 extra credit.
Actual scale is A = 100, C = 65.
- If you need extra space use the back of a page.
- No books, notes, calculators, or collaboration.
- The first five questions are true/false, with five points for the correct
boolean answer and up to five for a correct justification of your answer --
a proof, counterexample, quotation from the book or from lecture, etc. -- note
that there is no reason not to guess if you don't know.
Q1: 10 points
Q2: 10 points
Q3: 10 points
Q4: 10 points
Q5: 10 points
Q6: 10+15 points
Q7: 30 points
Q8: 30 points
Total: 120+15 points
The following formal languages are each used in one or more problems:
- Recall from Sipser that an LBA is a deterministic one-tape Turing machine
that is restricted to the portion of the tape that originally contains the
input, and that ALBA is the set of pairs (M, w) such that M is an
LBA and w ∈ L(M). Similarly, we define an NLBA to be a
nondeterministic one-tape Turing machine that is restricted to the portion
of the tape that originally contains its input, and define ANLBA to
be the set of pairs (M, w) such that M is an NLBA and w ∈ L(M).
- Sipser defines the language SUBSET-SUM to be {(s1, ...,
sk; t): Each si is a positive integer written in binary,
t is a positive integer written in binary, and there exists a subset of the
si's that adds up to exactly t}. Although we did not present the
proof in lecture, Sipser proves that SUBSET-SUM is an NP-complete language.
- We define the language 3WS (for "three-way split") to be the set
{(si, ..., sk): Each si is a positive integer
written in binary and there exists a partition of the multiset
S of si's
into three pairwise disjoint submultisets
A, B, and C, where A ∪ B ∪ C = S
and the sums of the numbers in each of A, B, and C is the same.
- The language SD (for "same direction") is the set of strings over the
alphabet {A, F, L, R} such that if a marching band begins facing north and
executes the sequence of commands given by the string, they will end up again
facing north. The command A ("about face") means to turn 180 degrees, F
("forward march") means not to turn at all, L ("left face") means to turn 90
degrees to the left, and R ("right face") means to turn 90 degrees to the
right.
- The language RS (for "return to start") is the set of strings over the
alphabet {N, E, S, W} such that if a marching band executes the sequence of
commands given by the string, on an arbitrarily large flat field, they will
return to their original position. The command N means to march one unit to the
north, and similarly the commands E, S, and W mean to march one unit east,
south, or west respectively.
- The language CCFL ("contains a CFL") is the set {M: M is a Turing machine
and there exists a context-free grammar G such that L(G) ⊆ L(M)}.