Sample Final Exam for Introduction to the Theory of Computation, Exams of Theory of Computation

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

2021/2022

Uploaded on 05/11/2023

anum
anum 🇺🇸

4.6

(8)

243 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 431
Introduction to the Theory of Computation
Sample Final Exam
DIRECTIONS: Closed book, closed notes. Time limit 1 hour 50 minutes. Answer the problems on
the exam paper.
1. Consider the following list of properties that might apply to the stated language.
T-rec: The language is Turing-recognizable.
Dec: The language is decidable.
N P : The language is in NP .
N P -c: The language is NP -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) {hM, wi | Turing machine Maccepts w}............................. T-rec Dec N P -c NP P
(b) {hM, wi | Turing machine Maccepts win at most |w|steps}. . . . . . . . . T-rec Dec N P -c NP P
(c) {hM, wi | Turing machine Maccepts win at most 2|w|steps}. . . . . . . . T-rec Dec N P -c NP P
(d) {hM, wi | Turing machine Mdoes not accept w}.....................T-rec Dec NP -c N P P
(e) L(α) for some regular expression α...................................T-rec Dec N P -c N P P
(f) {hFi | Fis a 3-CNF formula which evaluates
to true on some truth assignment}...................................T-rec Dec N P -c N P P
(g) {hF, xi | Fis a 3-CNF formula which evaluates
to true on truth assignment x}.......................................T-rec Dec N P -c N P P
(h) {hFi | Fis a propositional logic tautology}...........................T-rec Dec N P -c N P P
(i) {hG, Hi | Gand Hare isomorphic graphs}........................... T-rec Dec N P -c N P P
2. Use the fact that AT M is undecidable to show that the following language is undecidable.
L2={hMi | Turing machine Maccepts the input string “2”}.
3. (a) Give a full formal definition of what it means for Ato be polynomial-time mapping
reducible to B.
(b) Show that if ApBand Bis in PSPACE, (i.e. Bcan be decided by a TM using only
a polynomial number of tape cells), then Ais also in PSPACE.
4. (a) What is N P -completeness and why is it an interesting/useful notion?
(b) Describe the error in the following incorrect “proof that P6=NP :
Consider an algorithm for SAT:
“On input hFi, try all possible assignments to the variables. Accept if any
satisfy F
This algorithm clearly requires exponential time. Thus SAT has exponential
time complexity. Therefore SAT is not in P. Because SAT is in NP , it must
be true that Pis not equal to N P .
1
pf2

Partial preview of the text

Download Sample Final Exam for Introduction to the Theory of Computation and more Exams Theory of Computation in PDF only on Docsity!

CSE 431

Introduction to the Theory of Computation

Sample Final Exam

DIRECTIONS: Closed book, closed notes. Time limit 1 hour 50 minutes. Answer the problems on the exam paper.

  1. Consider the following list of properties that might apply to the stated language.

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

  1. Use the fact that AT M is undecidable to show that the following language is undecidable.

L 2 = {〈M 〉 | Turing machine M accepts the input string “2”}.

  1. (a) Give a full formal definition of what it means for A to be polynomial-time mapping reducible to B. (b) Show that if A ≤p B and B is in PSPACE, (i.e. B can be decided by a TM using only a polynomial number of tape cells), then A is also in PSPACE.
  2. (a) What is N P -completeness and why is it an interesting/useful notion? (b) Describe the error in the following incorrect “proof” that P 6 = N P : Consider an algorithm for SAT: “On input 〈F 〉, try all possible assignments to the variables. Accept if any satisfy F ” This algorithm clearly requires exponential time. Thus SAT has exponential time complexity. Therefore SAT is not in P. Because SAT is in N P , it must be true that P is not equal to N P.
  1. The SET-PARTITION problem asks, given a collection of decimal numbers x 1 ,... , xn whether or not it is possible to partition these numbers into two groups so that the sum in each group is the same. More formally, if 〈.. .〉 means a decimal encoding,

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.

  1. The Travelling Salesperson Problem, T SP , asks, given an n × n matrix C containing for each pair i, j ∈ { 1 ,... , n}, the integer cost cij for travelling from city i to city j, representing, say, the cost of gasoline to drive directly from city i to city j, as well as an integer K, representing a total fuel budget, whether or not there is an order (for a travelling salesperson) to visit each of the n cities exactly once, starting and ending in the same city, so that the total cost of the gasoline used is at most K? In set notation,

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.

  1. Prove that the language

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.