# CMPSCI 601: Theory of Computation

### Directions:

• Answer the problems on the exam pages.
• There are 7 problems on pages 3-6, for 100 total points. Probable scale is A=90, AB=75, B=60, BC = 45, C = 30. Make sure you leave time to look at each problem, and do the easiest (lower point-value) problems first.
• If you need extra space use the back of a page or the overflow page.
• No books, notes, calculators, or collaboration.
• Each question is a statement which is to be proved true or false. FIRST STATE WHETHER YOU THINK IT IS TRUE OR FALSE. You will get five points for a correct boolean answer, and there is no penalty for guessing. Then JUSTIFY YOUR ANSWER -- the remaining points will be awarded based on the degree to which your justification is correct and convincing.
• Problems with higher point values will tend to require longer justifications, but this is not guaranteed to be the case.
• A list of useful facts and definitions is provided on page 7. You may assume facts proved in lecture if you state them carefully and correctly. Make sure that if a fact from lecture requires hypotheses, you show that those hypotheses hold in this case.
• Types of variables: Unless otherwise indicated, a variable A or B denotes a language, D denotes a DFA, G denotes a context-free grammar, M denotes a Turing machine, n denotes a (non-negative) number, and w denotes a string. Remember that N is the set of all numbers, which we may also think of as the set Σ* of all strings.

Directions: Each of the first two questions is a statement that may be true or false. Please state whether it is true or false -- you will get five points for a correct boolean answer and there is no penalty for a wrong guess. Then justify your answer -- the remaining points will depend on the quality and validity of your justification.

• Question 1 (10): (true/false with justification) If A and B are both r.e. sets, then A intersect B must be r.e. as well.

• Question 2 (10): (true/false with justification) The set {M: L(M) = overline(L(M))} is r.e.-complete. (Recall that if X is any language, overline(X) is the complement of X.)

• Question 3 (15): (true/false with justification) The set {(N1,N2): N1 and N2 are NFA's and L(N1) = L(N2)} is primitive recursive.

• Question 4 (10): (true/false with justification) If A is r.e.-complete and B ≤ overline{A}, then B is not r.e.-complete.

• Question 5 (15): (true/false with justification) The set EASY-THEOREM = {φ: φ has length n and φ has a proof of length at most n2} is recursive.

• Question 6 (20): (true/false with justification) The language {G: L(G) ≠ ∅} is in the class P.

• Question 7 (20): (true/false with justification) The formula

[∃x:∀y: Sphere(x) implies Small(y)]

implies

[(∃x: Sphere(x)) implies (∀y: Small(y))]

is valid for Tarski's World.

### Crib Sheet:

• L(M) is the set of numbers n such that M halts on input n with output 1. Note that the set {Mn: n is in N} contains all possible Turing machines in some standard encoding and that each Mn is a valid Turing machine.
• L(D) is the set of strings w such that D running on w finishes in an accepting state.
• L(G) is the set of strings w such that w can be generated from G's start symbol according to G's rules.
• A language is r.e. if it is equal to L(M) for some Turing machine M.
• A language is recursive if it is equal to L(M) for some Turing machine M that always halts.
• A function f is total recursive if there exists a Turing machine that always halts and gives output f(n) on any input n.
• The language A is reducible to B, written ``A ≤ B'', if there exists a total recursive function f such that for any n, n is in A iff f(n) is in B.
• The language A is r.e.-complete iff A is r.e. and for any language B, if B is r.e. then B ≤ A.
• The language K = {n: n is in L(Mn)} is r.e.-complete.
• The Bloop programming language is defined in terms of basic operations and bounded loops. The Floop programming language also has free loops.
• The class P is the set of all languages whose decision problem can be solved by a Turing machine that runs in a time polynomial in the input size.
• The language FO-THEOREM is the set of statements of first-order logic theory that are provable from the first-order axioms.
• As a first-order structure, N is the set N of numbers together with the standard definitions of equality, order, addition, multiplication, and exponentiation of numbers.
• In Tarski's World, an object is never larger than itself. ``Larger(a,b)'' means ``a is larger than b''.