CS 321 Fall 2015 HW9 (PDA, deterministic parsing, Turing machine) Due on Canvas Thu Dec 3 at 5pm. Recitation on Thu Dec 3 at 8pm. Quiz 8 (optional) on Dec 4 -- we'll count the best 7 out of your 8 quizzes. 1. Design a PDA for (a) twice as many b's as a's (b) 2 x number of a's == 3 x number of b's (c) { a^m b^n | m <= n <= 2m } 2. Define \delta* for PDA. Define \delta* for DPDA. 3. Show that the following three accepting conditions are equivalent. Note that in any case, input string should be fully consumed. First write the formal definition for each case, using \delta* (the case of (b) is done for you as an example). (a) accepting by final state only (doesn't care about stack) (b) accepting by empty stack only (doesn't care about state) L(M) = { w \in \Sigma* | \delta*(q_0, w, \epsilon) = (q, \epsilon, \epsilon) } (c) accepting by both final state and empty stack TURING MACHINES 4. Design a TM for a^n b^n, and (a) simulate aaabbb on it. (b) simulate aaaabb on it. explain which state makes sure there are no extra a's. (c) simulate aabbbb on it. explain which state makes sure there are no extra b's. 5. Design a TM for a^n b^n c^n. 6. Design a TM for w#w, and (a) simulate aab#aab on it. (b) explain how this TM makes sure every bit pair on the two w's match. (c) explain how this TM makes sure the two halves are equally long. 7. Design a TM for ww (copy language). 8. Design a NTM (non-deterministic TM) for ww. Is it much simpler? 9. Design a TM for ww^R. 10. Design a TM for bitstrings with equal #s of 0s and 1s. 11. Describe high-level ideas: (a) TM for L = {a^i b^j c^k | i*j = k, and i,j,k >= 1 } (b) TM for L = {w_1 w_2 | |w_1| = |w_2|, w_1 != w_2 } (c) TM for L = {a^n b^m | m = n^2, n >= 1} (d) TM for L = {a^n | n is prime} 12. Design TMs as transducers: (a) f(x) = x+1 in unary (i.e., x in 1+) (b) f(x0y) = x+y in unary (c) f(x) = x+1 in binary (i.e., x in {0,1}+) (d) f(w) = ww in binary (e) f(w) = ww^R in binary