Theory of Computation
Closed Book Exam
Bernard Manderick
Friday 28th of August 2009 at 9 am in room 4F103
Important!!
• Use a separate page to answer each question.
• Write your name and study program on each page.
Questions
1. Examine the formal definition of a Turing machine to answer the following questions and explain your reasoning.
a. Can a Turing machine ever write the blank symbol t on its tape? b. Can the tape alphabet be the same as the input alphabet?
c. Can a Turing machine’s head ever be in the same location in two successive steps?
d. Can a Turing machine contain just a single state?
2. Give a high-level description of a multitape deterministic Turing machine M that simulates a non-deterministic Turing machine N . Also, give the definitions of the Turing machines involved.
3. Construct a Turing machine M0 that solves the element distinctness problem. It is given a list of strings over {0, 1} separated by #’s and its job is to accept if all the strings are different. The language L(M0) is
E = {#x1#x2# . . . #xl| each xi ∈ {0, 1}∗ and xi 6= xj for each i 6= j}
.
4. Show that the language
AT M = {hM, wi|M is an T M and M accepts w}
is undecidable using the diagonalization method. Also explain the notion of (un)decidability and the basic idea behind the diagonalization method.
5. Define the classes P and N P . Which variants of Turing machines are used in their definitions and why? What is the relation between these 2 classes? Give examples of languages belonging to each these classes and explain briefly why. Does every language belong to either P or N P ? Explain your answer.
6. What is the proof idea of the Cook-Levin theorem, i.e. SAT is N P -complete. Also define the language SAT and the notion of N P -completeness.