

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A sample final exam for the course Introduction to the Theory of Computation. The exam is closed book and closed notes, with a time limit of 1 hour and 50 minutes. The exam consists of multiple choice questions and problems related to Turing machines, language properties, undecidability, polynomial-time mapping reducibility, and NP-completeness. The exam is designed to test the student's understanding of the course material and their ability to apply it to solve problems.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!


DIRECTIONS: Closed book, closed notes. Time limit 1 hour 50 minutes. Answer the problems on the exam paper.
T-rec: The language is Turing-recognizable. Dec: The language is decidable. N P : The language is in N P. N P -c: The language is N P -complete. P: The language is in P. Circle all the properties that you are certain are true. × out all the properties that you are certain are false. Note: You may not be able to do either for some properties.
(a) {〈M, w〉 | Turing machine M accepts w}............................. T-rec Dec N P -c N P P (b) {〈M, w〉 | Turing machine M accepts w in at most |w| steps}......... T-rec Dec N P -c N P P (c) {〈M, w〉 | Turing machine M accepts w in at most 2|w|^ steps}........ T-rec Dec N P -c N P P (d) {〈M, w〉 | Turing machine M does not accept w}..................... T-rec Dec N P -c N P P (e) L(α) for some regular expression α................................... T-rec Dec N P -c N P P (f) {〈F 〉 | F is a 3-CNF formula which evaluates to true on some truth assignment}................................... T-rec Dec N P -c N P P (g) {〈F, x〉 | F is a 3-CNF formula which evaluates to true on truth assignment x}....................................... T-rec Dec N P -c N P P (h) {〈F 〉 | F is a propositional logic tautology}........................... T-rec Dec N P -c N P P (i) {〈G, H〉 | G and H are isomorphic graphs}........................... T-rec Dec N P -c N P P
L 2 = {〈M 〉 | Turing machine M accepts the input string “2”}.
SET-PARTITION = {〈x 1 ,... , xn〉 | there is a set S ⊆ { 1 ,... , n} so that
∑
i∈S
xi =
∑
i /∈S
xi}
Prove that SET-PARTITION is NP-complete. Hint: Use the NP-completeness of
SUBSET-SUM = {〈x 1 ,... , xm, t〉 | there is a set S ⊆ { 1 ,... , m} so that
∑
i∈S
xi = t}
Hint: Try including two large numbers whose size differs by exactly ∑m i=1 xi^ −^2 t.
T SP = {〈C, K〉 | with cost matrix C there is a salesperson’s tour of total cost ≤ K}.
Use the fact that the directed Hamiltonian cycle problem, DHAM CY CLE, is N P -complete to prove that T SP is N P -complete. Hint: choose the cost cij to depend on whether or not the edge (i, j) is in the graph G.
L = {〈M, a, b〉 | there is some x ∈ { 0 , 1 }∗^ such that M runs for > a · |x|^2 + b steps on input x}
is Turing-recognizable.