CSCI 6610 Automata and Formal Languages Spring 2004 News about the midterm test --------------------------- SCORES AND GRADE SCALE ----------------------------- Class average raw score was 91 out of 120 points possible. Class averages on questions 1, 2, 3, 4, and 5 as % of the possible were: 97%, 67%, 62%, 94%, and 76%, respectively. Highest score in class was 111 points. Grade scale: A >= 85%, B >= 72.5%, C >= 60%, D >= 50%. This will be the percentage-to-grade conversion mapping for all scaled scores in the course. Scaling: the raw scores will be treated as being out of 100 (instead of out of 120), so the class average is 91% scaled. ---------------------------------- ANSWERS ------------------------------------- Question 1 -- 2 points per part. 1(a) Y 1(b) Y 1(c) Y 1(d) N 1(e) Y 1(f) Y 1(g) N 1(h) N 1(i) Y 1(j) N 1(k) Y 1(l) N 1(m) Y 1(n) Y 1(o) N Question 2 -- 7, 10, and 13 points for (a), (b), and (c) respectively. 2(a) There is a recursive function f such that (for all w in Sigma*)(w in A iff f(w) in B). 2(b) Disprove, by counterexample. Let A be empty (recursive) and B be A_{TM} (not recursive), for instance. Then A is mapping reducible to B by the function which always returns the value , where M_0 is some fixed TM with input alphabet {0,1} which does not accept 1. 2(c) Disprove, by contradiction. First, C is RE; we can recognize C by a NTM N which rejects any input x which is not of the form where M is a TM with input alphabet {0,1}. For any input of this form, N guesses a string w over {0,1} nondeterministically. N rejects w if it has an even number of 1's. Otherwize N simulates M on the input w and accepts iff M accepts w. Now from class we know that E_{TM} is not RE and that any set mapping reducible to an RE set is RE, so E_{TM} can't be mapping reducible to C. Question 3 -- 5, 5, and 20 points for (a), (b), and (c) respectively. 3(a) A DTM with special oracle input and output tapes, and a special query state. Operation depends on an oracle set in the query state, as follows; 1 or 0 is written on the oracle output tape in one step, depending on whether or not the string written on the oracle input tape belongs to the oracle set. 3(b) A is decided by some oracle TM M when M is operated according to B as the oracle set. 3(c) We can show directly that E_{TM} is mapping reducible to complement(C); Turing reducibility to C then follows from the class facts that mapping reducibility implies Turing reducibility, C is Turing equivalent to its complement, and Turing reducibility is transitive. For the mapping reduction, let f(x) = whenever x which is not of the form where M is a TM with input alphabet {0,1}, where M_1 is a fixed TM with L(M_1) = {1} (so is not in C). In case x = where M is a TM with input alphabet {0,1}, let f(x) = where D(N) is a DTM equivalent to N and N(M) is an NTM with input alphabet {0,1} which rejects every input except 1, and on input 1 it guesses a string over M's input alphabet and accepts 1 iff M accepts the guessed string (by simulating M on it). A complete answer goes on to verify that x is in E_{TM} iff f(x) is not in C, and that f is recursive. Question 4 -- 5 points. L is in NP iff there is some NTM decider for L which has polynomial time complexity. Or equivalently, iff there is a polynomial time verifier for L. Question 5 -- 5, 10, and 10 points for (a), (b), and (c) respectively. 5(a) k + Sum (i from 1 to k) log_2(x_i). 5(b) A certificate is a string ptn in {0,1}^k, which gives a partition of the input sequence into X = { x_i : ptn[i] = 1} and Y = { x_i : ptn[i] = 0}. If n is the input length as given in part (a) then evaluating SUM(X) and SUM(Y) and checking that they are equal can be done in time O(n^3), O(n^2) or even O(n) with due care. In any case this gives a polynomial time verifier for PARTITION, so it is in the class P. 5(c) PARTITION is very like SUBSET-SUM. It is not hard to see that SUBSET-SUM is polynomial time reducible to PARTITION, which is therefore NP-complete. So it is unlikely to be in the class P, as that would imply that P = NP. Note that for part (a), Sum (i from 1 to k) x_i is NOT reasonable as a measure of the length of the input. That would correspond to UNARY-PARTITION, which is in P for the same reason as UNARY-SUBSET_SUM (just let the target for the subset sum be one half of the sum of all the input numbers).