University of Toronto Scarborough. Aids allowed: None... Duration: 3 hours.

Similar documents
CSCE 551 Final Exam, April 28, 2016 Answer Key

Answers to the CSCE 551 Final Exam, April 30, 2008

Exam Computability and Complexity

Midterm II : Formal Languages, Automata, and Computability

SOLUTION: SOLUTION: SOLUTION:

Essential facts about NP-completeness:

CSCI3390-Second Test with Solutions

CS21 Decidability and Tractability

University of Toronto Scarborough. Aids allowed: None... Duration: 3 hours.

NP-completeness. Chapter 34. Sergey Bereg

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Intro to Theory of Computation

Time and space classes

CSI 4105 MIDTERM SOLUTION

6.045J/18.400J: Automata, Computability and Complexity Final Exam. There are two sheets of scratch paper at the end of this exam.

Lecture 23: More PSPACE-Complete, Randomized Complexity

Show that the following problems are NP-complete

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

CSCI 1590 Intro to Computational Complexity

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Chapter 2 : Time complexity

Week 3: Reductions and Completeness

CS154, Lecture 13: P vs NP

Theory of Computation Time Complexity

Theory of Computation Chapter 9

3130CIT Theory of Computation

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

6.045 Final Exam Solutions

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

NP-Complete Problems. More reductions

CSCE 551 Final Exam, Spring 2004 Answer Key

CS154, Lecture 13: P vs NP

CSE 105 Theory of Computation

Introduction to Computational Complexity

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Design and Analysis of Algorithms

CISC 4090 Theory of Computation

Lecture 16: Time Complexity and P vs NP

ECS 20: Discrete Mathematics for Computer Science UC Davis Phillip Rogaway June 12, Final Exam

Chapter 7: Time Complexity

NP-complete Problems

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

Topics in Complexity Theory

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

NP Complete Problems. COMP 215 Lecture 20

CS/ECE 374 Final Exam Study Problems Fall 2016

Automata Theory CS S-FR2 Final Review

Notes for Lecture Notes 2

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3

CSE 105 THEORY OF COMPUTATION

CSCC63 Worksheet Turing Machines

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

1 More finite deterministic automata

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

1 Non-deterministic Turing Machine

1.1 P, NP, and NP-complete

NP-Completeness Part II

CSE 105 THEORY OF COMPUTATION

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Introduction to Advanced Results

Complexity (Pre Lecture)

1 Computational Problems

NP-Complete Reductions 3

6.840 Language Membership

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

q FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) Spring L. Blum. REVIEW for Midterm 2 TURING MACHINE

NP-Completeness and Boolean Satisfiability

Branching. Teppo Niinimäki. Helsinki October 14, 2011 Seminar: Exact Exponential Algorithms UNIVERSITY OF HELSINKI Department of Computer Science

Undecidability and Rice s Theorem. Lecture 26, December 3 CS 374, Fall 2015

NP-Completeness. A language B is NP-complete iff B NP. This property means B is NP hard

CSE 105 THEORY OF COMPUTATION

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

NP-problems continued

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

Finish K-Complexity, Start Time Complexity

Class Note #20. In today s class, the following four concepts were introduced: decision

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

NP-Completeness. Sections 28.5, 28.6

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

Formal definition of P

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Polynomial-time Reductions

NP-Completeness Part II

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

Introduction to Complexity Theory

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

CSE 105 THEORY OF COMPUTATION

SAT, NP, NP-Completeness

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Transcription:

University of Toronto Scarborough CSC C63 Final Examination 20 August 2015 NAME: STUDENT NUMBER: Do not begin until you are told to do so. In the meantime, put your name and student number on this cover page and read the rest of this page. Aids allowed: None.... Duration: 3 hours. There are 11 pages and each is numbered at the bottom. Make sure you have all of them. Write legibly in the space provided. Use the backs of pages for rough work; they will not be graded. The last page of this exam contains some facts that you may use without proof, including a list of problems which you may assume to be NP-complete. 1. / 30 2. / 10 3. / 5 4. / 30 5. / 10 6. / 30 7. / 10 8. / 5 Total / 130 Summer 2015 cscc63 Final Exam Page 1 of 11

1. [30 marks total; 10 for each part] For each of the following assertions, state whether it is true or false, and briefly justify your answer. (a) If M is a TM such that L(M) = SAT, then M is a decider. (Here we interpret SAT as a language.) (b) Every PSPACE-complete language is mapping reducible to its complement. (c) If TQBF P, then TQBF p HALT. Summer 2015 cscc63 Final Exam Page 2 of 11

2. [10 marks] Let f be the polytime reduction from FORMULA-GAME to GG (generalized geography) as described in class. ( ) ] Let φ be the formula x 1 x 2 x 3 [ (x 1 x 2 ) (x 1 x 3 ) (x 2 x 3 ). Draw f(φ). Label your graph appropriately and indicate the starting node. 3. [5 marks] Suppose A is a co-recognizable language, and x is a string in A (the complement of A). Prove that there is an enumerator E such that L(E) = A and x is the first string printed by E. Summer 2015 cscc63 Final Exam Page 3 of 11

4. [30 marks total; 15 for each part] In the following definition of a language, M 1 and M 2 are TMs, both with some common input alphabet Σ. L = { M 1,M 2 (M 1 loops on w whenever M 2 rejects w) or (M 2 loops on w whenever M 1 rejects w)}. Read the footnote 1 below if you are unsure about the definition of L. (a) Prove that L is co-recognizable by giving an appropriate deterministic TM. Briefly explain how your TM works. Advice: Carefully determine L (the complement of L). 1 M 1 loops on w whenever M 2 rejects w means for any string, if M 2 rejects it, then M 1 loops on it. The or in the definition is an inclusive OR, not exlusive OR. Summer 2015 cscc63 Final Exam Page 4 of 11

(b) Use a mapping reduction to prove that L is not recognizable. For your convenience, the language L is given again here. L = { M 1,M 2 (M 1 loops on w whenever M 2 rejects w) or (M 2 loops on w whenever M 1 rejects w)}. Summer 2015 cscc63 Final Exam Page 5 of 11

5. [10 marks] Let L 1,L 2 be arbitrary languages. Let L 3 = {w L 1 every string in L 2 is longer than w, and some string in L 2 is shorter than www}. Prove that L 3 is decidable. 6. [30 marks total] Third Jewel The year is 2017. It is summer. Upon her graduation a year ago with a degree in computer science, Vicky returned to San Francisco, and was employed at the same place where she worked as a student. At first things went well. The work was challenging, but not overwhelming. The city had so much to offer. She rode the streetcars, crossed the iconic bridge, and went whale watching. But as time passed, Vicky started to feel a certain malaise, a persistent melancholy. Perhaps she yearned for her friends in Toronto. Or maybe the daily morning fog was getting her down. A famous quote, the coldest winter I ever spent was a summer in San Francisco, started to haunt her. Who said that? Was it Samuel Langhorne Clemens? Most of all she longed for an opportunity to use the complexity theory she learned in a most enjoyable course at university! In her disillusionment, Vicky began roaming the streets at night, and this is where she met that strange couple, Tia and Max. They lived in some sort of commune, yet they seemed very well off. They always wore fantastic, and seemingly expensive, jewelry. Rings, bracelets, necklaces, you name it, they had it. Vicky felt herself inexplicably drawn to Tia and Max. She went out of her way to get to know them better. In time she found out that they were jewel thieves. Vicky s discovery only made her want to be more like Tia and Max. She joined them on their adventurous heists. Since there were two of them and just one of Vicky, they decided that each haul should be divided so that Vicky gets one third of the total value, and Tia and Max the remaining two thirds. It makes no sense to divide individual pieces of jewelry, hence it may not be possible for Vicky to get exactly one third. So they agreed to the procedure where Vicky may choose as many jewelry pieces from each heist as she wants, as long as her portion does not exceed one third of the total value. Vicky was thrilled. She finally found a crunchy NP-complete problem! Summer 2015 cscc63 Final Exam Page 6 of 11

Here is Vicky s crunchy problem along with a related non-decision problem. THIRD-JEWEL Input: Numbers d 1,,d n (dollar values of jewelry pieces from a heist), and a number k. Question: Is there a subset V of {1,,n} such that d i k 3 d i d i? 1 i n i V 1 i n I.e., can 3 times Vicky s share be within k dollars of the total value without exceeding it? MAX-THIRD-JEWEL Input: Numbers d 1,,d n (dollar values of jewelry pieces from a heist). Question: Find the maximum value of d i subject to 3 d i d i. i V i V 1 i n I.e., how big (in dollars) can Vicky s share be without exceeding one third of the total value? (a) [5 marks] Assuming MAX-THIRD-JEWEL can be solved in polytime, give a polytime algorithm to solve THIRD-JEWEL. Briefly explain how your algorithm works. (b) [10 marks] Assuming THIRD-JEWEL can be solved in polytime, give a polytime algorithm to solve MAX-THIRD-JEWEL. Briefly explain how your algorithm works. Summer 2015 cscc63 Final Exam Page 7 of 11

(c) [15 marks] Prove that THIRD-JEWEL is NP-complete. Reminder: Remember the full definition of NP-complete. Summer 2015 cscc63 Final Exam Page 8 of 11

7. [10 marks total; 5 for each part] For each of the following problems, (i) prove that it is in P, or (ii) prove that it is NP-hard. Do not prove both. (a) DOUBLE-FALSIFIABLE Input: A boolean formula F. Question: Does F have two (or more) falsifying truth assignments? (b) TRIPLE-DISJOINT-VERTEX-COVER Input: A graph G and a number k. Question: Does G contain three (or more) mutually disjoint vertex covers of size k? (By mutually disjoint, we mean the intersection of any two such vertex covers is empty.) Summer 2015 cscc63 Final Exam Page 9 of 11

8. [5 marks] Write an interesting story about a UofT student and a York student, then define an NP-complete problem that is based on your story. No proof is required. Summer 2015 cscc63 Final Exam Page 10 of 11

You may assume these problems are NP-complete. SAT Input: A boolean formula F. Question: Is F satisfiable? What you may assume 3SAT Input: A CNF formula F where each clause has exactly 3 literals. Question: Is F satisfiable? CLIQUE Input: A graph G and a number k. Question: Does G contain a clique of size k? (A clique is a set of pairwise adjacent nodes, or a complete subgraph.) VERTEX-COVER Input: A graph G and a number k. Question: Does G contain a vertex cover of size k? (A vertex cover is a set of nodes such that every edge is covered by some node in the set.) HAMPATH Input: A directed graph G and 2 nodes s,t. Question: Does G contain a Hamilton path from s to t? (A Hamilton path is a path that visits every node in the graph exactly once.) UHAMPATH Input: A (undirected) graph G and 2 nodes s,t. Question: Does G contain a Hamilton path from s to t? (A Hamilton path is a path that visits every node in the graph exactly once.) SUBSET-SUM Input: A multiset S of numbers and a number t. Question: Does S contain a subset A such that x A x = t? 3-COL Input: A graph G. Question: Is G 3-colourable? (I.e., does G have a 3-colouring? Or put another way, is there a way to colour the nodes of G with at most 3 colours so that no adjacent nodes have the same colour?) You may assume these facts. HALT = { M,w M is a TM that halts on input string w} is recognizable but not co-recognizable. E TM = { M M is a TM and L(M) = } is co-recognizable but not recognizable. EQ TM = { M 1,M 2 M 1,M 2 aretmsandl(m 1 ) = L(M 2 )}isneitherrecognizablenorco-recognizable. TQBF, FORMULA-GAME and GG (generalized geography) are PSPACE-complete. Summer 2015 cscc63 Final Exam Page 11 of 11