
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

ECS 120: Theory of Computation Handout PS # UC Davis — Phil Rogaway May 15, 2007
Problem 1.
Part A. Suppose that L is r.e. Show that L∗^ is r.e.
Part B. Suppose that L is recursive. Show that L∗^ is recursive.
Problem 2. Classify each of the following problems as either decidable—I see how to decide this language; r.e.—I don’t see how to decide this language, but I can see a procedure to accept this language; co-r.e.—I don’t see how to decide this language, but I can see a procedure to accept the complement of the language; neither: I don’t see how to accept this language nor its complement.
Part A. {〈M 〉 : M is a TM that accepts some string of prime length}.
Part B. {〈M 〉 : M is a C-program that halts on 〈M 〉}.
Part C. {〈G〉 : G is a CFG and G accepts an odd-length string}.
Part D. {〈M 〉 : M is a TM and M has 150 states}.
Part E. {〈M 〉 : M is a TM and L(M ) = L(M )∗}.
Part F. {〈M 〉 : M is a TM and L(M ) = ∅}.
Part G. {〈M 〉 : M is a TM and L(M ) is r.e. }.
Part H. {〈G 1 , G 2 〉 : G 1 and G 2 are CFGs and L(G 1 ) = L(G 2 )}.
Part I. {〈M 〉 : M is a TM and M will visit state q 25 when run on some input x}.
Part J. {〈M 〉 : M is a TM and M makes use of at most 50 tape cells when run on blank tape}.
Problem 3. Recall that L = {ww : w ∈ {a, b}∗} is not context free. Exhibit an unrestricted grammar for it. An unrestricted grammar is like a CFG except that rules can look like aBCb → accbDe, for example: left-hand sides can contain any string of terminal and nonterminals with at least one nonterminal.