CS103 Handout 22 Fall 2012 November 30, 2012 Problem Set 9

Similar documents
CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3

Checkpoint Questions Due Monday, October 1 at 2:15 PM Remaining Questions Due Friday, October 5 at 2:15 PM

CS103 Handout 09 Fall 2012 October 19, 2012 Problem Set 4

A Note on Turing Machine Design

NP-Completeness Part II

Topics in Complexity Theory

Recap from Last Time

Topics in Complexity

NP-Completeness Part II

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

NP-Completeness Part II

Quiz 3. Please write your name in the upper corner of each page. Problem Points Grade. Total 100 Q3-1

NP-Completeness Part One

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

Announcements. Problem Set 1 out. Checkpoint due Monday, September 30. Remaining problems due Friday, October 4.

1 / 9. Due Friday, May 11 th at 2:30PM. There is no checkpoint problem. CS103 Handout 30 Spring 2018 May 4, 2018 Problem Set 5

(Note that these points are to give a relative sense of the weights on the final exam and have no bearing on extra credit points)

Announcements. Using a 72-hour extension, due Monday at 11:30AM.

CS103 Handout 12 Winter February 4, 2013 Practice Midterm Exam

NP-Completeness. Until now we have been designing algorithms for specific problems

Friday Four Square! Today at 4:15PM, Outside Gates

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

Turing Machines Part III

Recap from Last Time

Approximation Algorithms

Complexity Theory Part Two

NP-Completeness Part One

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

Complexity Theory Part I

NP-Complete problems

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

1 Reductions and Expressiveness

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010

CS 170 Algorithms Spring 2009 David Wagner Final

Announcements. Final exam review session tomorrow in Gates 104 from 2:15PM 4:15PM Final Friday Four Square of the quarter!

Computer Sciences Department

Intro to Theory of Computation

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170

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

CS173 Lecture B, November 3, 2015

CS 241 Analysis of Algorithms

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

NP-Completeness Part One

Decidability and Undecidability

Congratulations you're done with CS103 problem sets! Please evaluate this course on Axess!

CS103 Handout 21 Winter 2016 February 3, 2016 Practice Midterm Exam

COP 4531 Complexity & Analysis of Data Structures & Algorithms

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

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

Essential facts about NP-completeness:

Practice Second Midterm Exam I

NP-Completeness Part I

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

Algorithms Exam TIN093 /DIT602

Complexity Theory Part One

Lecture Notes Each circuit agrees with M on inputs of length equal to its index, i.e. n, x {0, 1} n, C n (x) = M(x).

CMSC 441: Algorithms. NP Completeness

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

Computability Theory

1 Computational Problems

9.1 HW (3+3+8 points) (Knapsack decision problem NP-complete)

Complexity Theory Part I

Complexity Theory Part Two

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

Lecture 15 - NP Completeness 1

Notes for Lecture Notes 2

BBM402-Lecture 11: The Class NP

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

ECS 120 Lesson 24 The Class N P, N P-complete Problems

Lecture 14 - P v.s. NP 1

Practice Second Midterm Exam III

Complexity Theory Part II

Mathematical Induction Part Two

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 6: NP & Reductions Due: One week after shown in slides

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

Design and Analysis of Algorithms

Congratulations you're done with CS103 problem sets! Please evaluate this course on Axess!

Complexity Theory Part Two

Review for Final Exam, MATH , Fall 2010

1 Computational problems

Lecture 20: conp and Friends, Oracles in Complexity Theory

Outline for Today. What is an Implication? Negations and their Applications. Proof by Contrapositive. Proof by Contradiction

Week 2: Defining Computation

ECS 120: Automata Theory and Formal Languages. UC Davis Phillip Rogaway December 13, ECS 120 Final { Fall 1995

Complexity Theory Part Two

CSCI3390-Second Test with Solutions

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

Math 51 Midterm 1 July 6, 2016

Mathematical Logic Part Three

NP and Computational Intractability

JASS 06 Report Summary. Circuit Complexity. Konstantin S. Ushakov. May 14, 2006

2.4 Graphing Inequalities

Lecture 13, Fall 04/05

Chapter 1A -- Real Numbers. iff. Math Symbols: Sets of Numbers

Mathematical Logic Part Three

Math 1: Calculus with Algebra Midterm 2 Thursday, October 29. Circle your section number: 1 Freund 2 DeFord

Transcription:

CS103 Handout 22 Fall 2012 November 30, 2012 Problem Set 9 In this final problem set of the quarter, you will explore the limits of what can be computed efficiently. What problems do we believe are computationally intractable? What do they look like? And are they purely theoretical, or might you might bump into one some day? As always, please feel free to drop by office hours or send us emails if you have any questions. We'd be happy to help out. This problem set has 125 possible points. It is weighted at 5% of your total grade (note that this is slightly less than usual). Good luck, and have fun! Due Friday, December 7 th at 2:15 PM

Problem One: The Long Path Problem (20 Points) Given an undirected graph G = (V, E), a simple path in a G is a path between two nodes u, v V such that no node is repeated on the path. For example, given this graph: 2 B C A D F E A C E is a simple path from A to E, but A B E C A D is not a simple path because node A is visited twice. * Consider the following language: ULONGPATH = { G, u, v, k G is an undirected graph, u and v are nodes in the graph, and there exists a simple path from u to v containing k nodes. } For example, if G is the above graph, then G, D, F, 6 ULONGPATH because there is a simple path of six nodes from D to F (namely, D A C E B F), but G, A, C, 5 ULONGPATH because there is no simple path of 5 nodes from A to C. i. Prove that ULONGPATH NP by designing a polynomial-time verifier for it. Prove your verifier is correct by proving there is some x such that G, u, v, k ULONGPATH iff your verifier accepts G, u, v, k, x. However, you can just give an informal justification as to why your verifier runs in polynomial time. In an undirected graph G = (V, E), a Hamiltonian path is a simple path between two nodes u and v that visits every node in the graph exactly once. For example, in this graph: B C A D F E The path F B E C A D is a Hamiltonian path from F to D, but F B E D is not (because it doesn't visit every node), nor is F B E D A C E D (because it is not a simple path). * Although we have defined a path in a graph as a series of edges, it is often easier to reason about the path as the series of nodes that it passes through. Throughout this problem set, we will adopt this convention.

The language UHAMPATH is defined as follows: UHAMPATH = { G, u, v G is an undirected graph and there is a Hamiltonian path from u to v.} UHAMPATH is known to be NP-complete by a fairly clever series of reductions from SAT; see Sipser, page 291 (second edition) or page 319 (third edition) for more details. ii. Prove that ULONGPATH NPC by showing that UHAMPATH P ULONGPATH. Prove your reduction is correct (i.e., G, u, v UHAMPATH iff f( G, u, v, ) ULONGPATH), but feel free to justify informally why your reduction works in polynomial time. 3 Problem Two: 4-Colorability (35 Points) If you'll recall, an undirected graph G is called 3-colorable iff there exists a way to color each the nodes in G one of three colors such that no two nodes of the same color are connected by an edge. We formalized the 3-coloring problem as a language as follows: 3COLOR = { G G is an undirected, 3-colorable graph } As we saw in lecture, 3COLOR is NP-complete. An undirected graph is called 4-colorable iff there is a way to color each of the nodes in G one of four colors so that no two nodes of the same color are connected by an edge. We can formalize the 4-coloring problem as a language as follows: 4COLOR = { G G is an undirected, 4-colorable graph } Note that every 3-colorable graph is also 4-colorable, but not all 4-colorable graphs are 3-colorable. In other words, 3-colorability is a stricter requirement than 4-colorability. However, it is still the case that 4COLOR is NP-complete, and in this problem you will prove this result. i. Prove that 4COLOR NP by designing a polynomial-time NTM for it. Prove that your NTM is correct, then justify informally why it runs in polynomial time. ii. Prove that 4COLOR is NP-hard by proving 3COLOR P 4COLOR. That is, show how to take an arbitrary graph G and construct (in polynomial time) a graph G' such that graph G is 3-colorable iff graph G' is 4-colorable. For simplicity, you do not need to formally prove that your reduction is correct and runs in polynomial time. Instead, briefly answer each of the following questions about your reduction (two or three sentences apiece should be sufficient): 1. If the original graph G is 3-colorable, why is your new graph G' 4-colorable? 2. If your new graph G' is 4-colorable, why is the original graph G 3-colorable? 3. Why can your reduction be computed in polynomial time?

Problem Three: Resolving P NP (30 Points) This problem explores the question What would it take to prove whether or not P = NP? For each statement below, decide whether the statement would definitely prove P = NP, definitely prove P NP, or would do neither. Write P = NP, P NP, or neither as your answer to each question. Please don't just write true or false. No justification is necessary. 1. There is a P language that can be decided in polynomial time. 2. There is an NP language that can be decided in polynomial time. 3. There is an NP-complete language that can be decided in polynomial time. 4. There is an NP-hard language that can be decided in polynomial time. 5. There is an NP language that cannot be decided in polynomial time. 6. There is an NP-complete language that cannot be decided in polynomial time. 7. There is an NP-hard language that cannot be decided in polynomial time. 8. There is some NP-complete language that can be decided in O(2 n ) time. 9. There is no NP-complete language that can be decided in O(2 n ) time. 10. There is a polynomial-time verifier for every language in NP. 11. There is a polynomial-time decider for every language in NP. 12. There is a language L P where L P 3SAT. 13. There is a language L NP where L P 3SAT. 14. There is a language L NPC where L P 3SAT. 15. There is a language L P where 3SAT P L. 16. There is a language L P where 3SAT M L. 17. All languages in P are decidable. 18. All languages in NP are decidable. 19. There is a polynomial-time algorithm that correctly decides SAT for all strings of length at most 10 100, but that might give incorrect answers for longer strings. 20. There is a polynomial-time algorithm that correctly decides SAT for all strings of length at least 10 100, but that might give incorrect answers for shorter strings. 4

Problem Four: The Big Picture (35 Points) We have covered a lot of ground in this course throughout our whirlwind tour of computability and complexity theory. This last question surveys what we have covered so far by asking you to see how everything we have covered relates. Take a minute to review the hierarchy of languages we explored: REG DCFL CFL P NP R RE ALL The following questions ask you to provide examples of languages at different spots within this hierarchy. In each case, you should provide an example of a language, but you don't need to formally prove that it has the properties required. Instead, describe a proof technique you could use to show that the language has the required properties. There are many correct answers to these problems, and we'll accept any of them. i. Give an example of a regular language. How might you prove that it is regular? ii. Give an example of a context-free language is not regular. How might you prove that it is context-free? How might you prove that it is not regular? iii. Give an example of a language in P that is not context-free. How might you prove that it is in P? How might you prove that it is not context-free? iv. Give an example of a language in NP suspected not to be in P. How might you prove that it is in NP? Why do we think that it is not contained in P? v. Give an example of a language in RE not contained in R. How might you prove that it is RE? How might you prove that it is not contained in R? vi. Give an example of a language in co-re not contained in R. How might you prove that it is co-re? How might you prove that it is not contained in R? vii. Give an example of a language that is neither RE nor co-re. How might you prove it is not contained in RE? How might you prove it is not contained in co-re? 5 Problem Five: Course Feedback (5 Points) We want this course to be as good as it can be, and we'd really appreciate your feedback on how we're doing. For a free five points, please answer the following questions. We'll give you full credit no matter what you write (as long as you write something!), but we'd appreciate it if you're honest about how we're doing. i. If we should keep any one thing about this course the same in future offerings, what would it be? ii. If you could change any one thing about this course, what would it be? iii. What topic did you think was the most interesting? What topic did you think was the least interesting?

6 Submission instructions There are three ways to submit this assignment: 1. Hand in a physical copy of your answers at the start of class. This is probably the easiest way to submit if you are on campus. 2. Submit a physical copy of your answers in the filing cabinet in the open space near the handout hangout in the Gates building. If you haven't been there before, it's right inside the entrance labeled Stanford Engineering Venture Fund Laboratories. There will be a clearly-labeled filing cabinet where you can submit your solutions. 3. Send an email with an electronic copy of your answers to the submission mailing list (cs103-aut1213-submissions@lists.stanford.edu) with the string [PS9] somewhere in the subject line. If you do submit electronically, please submit your assignment as a single PDF if at all possible. Sending multiple files makes it harder to print out and grade your submission. Extra Credit Problem: P NP (Worth an A+, $1,000,000, and a Stanford Ph.D) Prove or disprove: P = NP.