CSE 6321 - Solutions to Problem Set 5

Total Page:16

File Type:pdf, Size:1020Kb

CSE 6321 - Solutions to Problem Set 5 CSE 6321 - Solutions to Problem Set 5 1. 2. Solution: n 1 T T 1 T T D-Q = fhA; P0;P1;:::;Pm; b; q0; q1; : : : ; qm; r1; : : : ; rm; ti j (9x 2 R ) 2 x P0x + q0 x ≤ t; 2 x Pix + qi x + ri ≤ 0; Ax = bg. We can show that the decision version of binary integer programming reduces to D-Q in polynomial time as follows: The constraint xi 2 f0; 1g of binary integer programming is equivalent to the quadratic constrain (possible in D-Q) xi(xi − 1) = 0. The rest of the constraints in binary integer programming are linear and can be represented directly in D-Q. More specifically, let hA; b; c; k0i be an instance of D-0-1-IP = fhA; b; c; k0i j (9x 2 f0; 1gn)Ax ≤ b; cT x ≥ 0 kg. We map it to the following instance of D-Q: P0 = 0, q0 = −b, t = −k , k = 0 (no linear equality 1 T T constraint Ax = b), and then use constraints of the form 2 x Pix + qi x + ri ≤ 0 to represent the constraints xi(xi − 1) ≥ 0 and xi(xi − 1) ≤ 0 for i = 1; : : : ; n and more constraints of the same form to represent the 0 constraint Ax ≤ b (using Pi = 0). Then hA; b; c; k i 2 D-0-1-IP iff the constructed instance of D-Q is in D-Q. The mapping is clearly polynomial time computable. (In an earlier statement of ps6, problem 1, I forgot to say that r1; : : : ; rm 2 Q are also part of the input.) 3. Show that if every NP-hard language is also PSPACE-hard, then PSPACE=NP. Solution: If every NP-hard language is PSPACE-hard, then SAT is PSPACE-hard, and consequently every PSPACE language is polynomial-time reducible to SAT. Then PSPACE ⊆ NP because SAT 2 NP and therefore PSPACE=NP because we know NP ⊆ PSPACE. 4. Show that TQBF restricted to formulas where the part following the quantifiers is in conjunctive normal form is still PSPACE-complete. Solution: Let TQCNF be the language of the restricted version. TQCNF is clearly in PSPACE. To show that it is PSPACE-complete we exhibit a polynomial time reduction from TQBF to TQCNF. Let be a t.q.b.f. Applying a straightforward polynomial time transformation, we can assume all the quantifiers are at the beginning and their scope is everything that follows (prenex normal form). Let Q be the string of quantifiers in , let φ be the unquantified part of the formula so that = Qφ. The obvious approach of putting φ in c.n.f. by using rules such as distributivity and de Morgan's laws does not work as it generates a formula of exponential size in the worst case. More specifically, a formula A _ (x ^ y) with a subformula A becomes (A _ x) ^ (A _ y), where A appears twice. We can avoid this by using auxiliary variables, equivalence and quantifiers, replacing A _ (x ^ y) with the equivalent formula (9z)(z ≡ A) ^ (z _ x) ^ (z _ y), where A appears only once. Here A ≡ B is a shortcut for logical equivalence, namely the formula (A¯ _ B) ^ (B¯ _ A). To complete the argument, we need to find a CNF formula that is equivalent to x ≡ A. More specifically, given a boolean formula A without quantifiers, construct a (possibly 1 quatified) CNF formula CA;x with an extra free variable x that is equivalent to x ≡ A. We see how to do this recursively: • If A is a variable y, then CA;x is (¯x _ y) ^ (¯y _ x). (expanded CNF of x ≡ y) • If A is B¯, then CA;x is (9z)CB;z ^ (z _ y) ^ (¯y _ z¯). (expanded CNF of (9z)(z ≡ B) ^ (¯z ≡ x)) • If A is B _ D, then CA;x is (9z; w)CB;z ^ CD;w ^ (w ¯ _ x) ^ (¯z _ x) ^ (¯x _ z _ w). (expanded CNF of (9z; w)(z ≡ B) ^ (w ≡ D) ^ ((z _ w) ≡ x)) • If A is B ^ D, then CA;x is (9z; w)CB;z ^ CD;w ^ (¯x _ w) ^ (¯x _ z) ^ (x _ z¯ _ w¯). (expanded CNF of (9z; w)(z ≡ B) ^ (w ≡ D) ^ ((z ^ w) ≡ x)) In view of the previous discussion, the reduction maps in polynomial time formula , equal to Qφ, to the equivalent t.q.b.f. with c.n.f. unquantified part Q(9x)x ^ Cφ,x. 2.
Recommended publications
  • Complexity Theory Lecture 9 Co-NP Co-NP-Complete
    Complexity Theory 1 Complexity Theory 2 co-NP Complexity Theory Lecture 9 As co-NP is the collection of complements of languages in NP, and P is closed under complementation, co-NP can also be characterised as the collection of languages of the form: ′ L = x y y <p( x ) R (x, y) { |∀ | | | | → } Anuj Dawar University of Cambridge Computer Laboratory NP – the collection of languages with succinct certificates of Easter Term 2010 membership. co-NP – the collection of languages with succinct certificates of http://www.cl.cam.ac.uk/teaching/0910/Complexity/ disqualification. Anuj Dawar May 14, 2010 Anuj Dawar May 14, 2010 Complexity Theory 3 Complexity Theory 4 NP co-NP co-NP-complete P VAL – the collection of Boolean expressions that are valid is co-NP-complete. Any language L that is the complement of an NP-complete language is co-NP-complete. Any of the situations is consistent with our present state of ¯ knowledge: Any reduction of a language L1 to L2 is also a reduction of L1–the complement of L1–to L¯2–the complement of L2. P = NP = co-NP • There is an easy reduction from the complement of SAT to VAL, P = NP co-NP = NP = co-NP • ∩ namely the map that takes an expression to its negation. P = NP co-NP = NP = co-NP • ∩ VAL P P = NP = co-NP ∈ ⇒ P = NP co-NP = NP = co-NP • ∩ VAL NP NP = co-NP ∈ ⇒ Anuj Dawar May 14, 2010 Anuj Dawar May 14, 2010 Complexity Theory 5 Complexity Theory 6 Prime Numbers Primality Consider the decision problem PRIME: Another way of putting this is that Composite is in NP.
    [Show full text]
  • If Np Languages Are Hard on the Worst-Case, Then It Is Easy to Find Their Hard Instances
    IF NP LANGUAGES ARE HARD ON THE WORST-CASE, THEN IT IS EASY TO FIND THEIR HARD INSTANCES Dan Gutfreund, Ronen Shaltiel, and Amnon Ta-Shma Abstract. We prove that if NP 6⊆ BPP, i.e., if SAT is worst-case hard, then for every probabilistic polynomial-time algorithm trying to decide SAT, there exists some polynomially samplable distribution that is hard for it. That is, the algorithm often errs on inputs from this distribution. This is the ¯rst worst-case to average-case reduction for NP of any kind. We stress however, that this does not mean that there exists one ¯xed samplable distribution that is hard for all probabilistic polynomial-time algorithms, which is a pre-requisite assumption needed for one-way func- tions and cryptography (even if not a su±cient assumption). Neverthe- less, we do show that there is a ¯xed distribution on instances of NP- complete languages, that is samplable in quasi-polynomial time and is hard for all probabilistic polynomial-time algorithms (unless NP is easy in the worst case). Our results are based on the following lemma that may be of independent interest: Given the description of an e±cient (probabilistic) algorithm that fails to solve SAT in the worst case, we can e±ciently generate at most three Boolean formulae (of increasing lengths) such that the algorithm errs on at least one of them. Keywords. Average-case complexity, Worst-case to average-case re- ductions, Foundations of cryptography, Pseudo classes Subject classi¯cation. 68Q10 (Modes of computation (nondetermin- istic, parallel, interactive, probabilistic, etc.) 68Q15 Complexity classes (hierarchies, relations among complexity classes, etc.) 68Q17 Compu- tational di±culty of problems (lower bounds, completeness, di±culty of approximation, etc.) 94A60 Cryptography 2 Gutfreund, Shaltiel & Ta-Shma 1.
    [Show full text]
  • Computational Complexity and Intractability: an Introduction to the Theory of NP Chapter 9 2 Objectives
    1 Computational Complexity and Intractability: An Introduction to the Theory of NP Chapter 9 2 Objectives . Classify problems as tractable or intractable . Define decision problems . Define the class P . Define nondeterministic algorithms . Define the class NP . Define polynomial transformations . Define the class of NP-Complete 3 Input Size and Time Complexity . Time complexity of algorithms: . Polynomial time (efficient) vs. Exponential time (inefficient) f(n) n = 10 30 50 n 0.00001 sec 0.00003 sec 0.00005 sec n5 0.1 sec 24.3 sec 5.2 mins 2n 0.001 sec 17.9 mins 35.7 yrs 4 “Hard” and “Easy” Problems . “Easy” problems can be solved by polynomial time algorithms . Searching problem, sorting, Dijkstra’s algorithm, matrix multiplication, all pairs shortest path . “Hard” problems cannot be solved by polynomial time algorithms . 0/1 knapsack, traveling salesman . Sometimes the dividing line between “easy” and “hard” problems is a fine one. For example, . Find the shortest path in a graph from X to Y (easy) . Find the longest path (with no cycles) in a graph from X to Y (hard) 5 “Hard” and “Easy” Problems . Motivation: is it possible to efficiently solve “hard” problems? Efficiently solve means polynomial time solutions. Some problems have been proved that no efficient algorithms for them. For example, print all permutation of a number n. However, many problems we cannot prove there exists no efficient algorithms, and at the same time, we cannot find one either. 6 Traveling Salesperson Problem . No algorithm has ever been developed with a Worst-case time complexity better than exponential .
    [Show full text]
  • NP-Completeness Part I
    NP-Completeness Part I Outline for Today ● Recap from Last Time ● Welcome back from break! Let's make sure we're all on the same page here. ● Polynomial-Time Reducibility ● Connecting problems together. ● NP-Completeness ● What are the hardest problems in NP? ● The Cook-Levin Theorem ● A concrete NP-complete problem. Recap from Last Time The Limits of Computability EQTM EQTM co-RE R RE LD LD ADD HALT ATM HALT ATM 0*1* The Limits of Efficient Computation P NP R P and NP Refresher ● The class P consists of all problems solvable in deterministic polynomial time. ● The class NP consists of all problems solvable in nondeterministic polynomial time. ● Equivalently, NP consists of all problems for which there is a deterministic, polynomial-time verifier for the problem. Reducibility Maximum Matching ● Given an undirected graph G, a matching in G is a set of edges such that no two edges share an endpoint. ● A maximum matching is a matching with the largest number of edges. AA maximummaximum matching.matching. Maximum Matching ● Jack Edmonds' paper “Paths, Trees, and Flowers” gives a polynomial-time algorithm for finding maximum matchings. ● (This is the same Edmonds as in “Cobham- Edmonds Thesis.) ● Using this fact, what other problems can we solve? Domino Tiling Domino Tiling Solving Domino Tiling Solving Domino Tiling Solving Domino Tiling Solving Domino Tiling Solving Domino Tiling Solving Domino Tiling Solving Domino Tiling Solving Domino Tiling The Setup ● To determine whether you can place at least k dominoes on a crossword grid, do the following: ● Convert the grid into a graph: each empty cell is a node, and any two adjacent empty cells have an edge between them.
    [Show full text]
  • NP-Completeness
    CMSC 451: Reductions & NP-completeness Slides By: Carl Kingsford Department of Computer Science University of Maryland, College Park Based on Section 8.1 of Algorithm Design by Kleinberg & Tardos. Reductions as tool for hardness We want prove some problems are computationally difficult. As a first step, we settle for relative judgements: Problem X is at least as hard as problem Y To prove such a statement, we reduce problem Y to problem X : If you had a black box that can solve instances of problem X , how can you solve any instance of Y using polynomial number of steps, plus a polynomial number of calls to the black box that solves X ? Polynomial Reductions • If problem Y can be reduced to problem X , we denote this by Y ≤P X . • This means \Y is polynomal-time reducible to X ." • It also means that X is at least as hard as Y because if you can solve X , you can solve Y . • Note: We reduce to the problem we want to show is the harder problem. Call X Because polynomials Call X compose. Polynomial Problems Suppose: • Y ≤P X , and • there is an polynomial time algorithm for X . Then, there is a polynomial time algorithm for Y . Why? Call X Call X Polynomial Problems Suppose: • Y ≤P X , and • there is an polynomial time algorithm for X . Then, there is a polynomial time algorithm for Y . Why? Because polynomials compose. We’ve Seen Reductions Before Examples of Reductions: • Max Bipartite Matching ≤P Max Network Flow. • Image Segmentation ≤P Min-Cut. • Survey Design ≤P Max Network Flow.
    [Show full text]
  • NP-Completeness General Problems, Input Size and Time Complexity
    NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. Young CS 331 NP-Completeness 1 D&A of Algo. General Problems, Input Size and Time Complexity • Time complexity of algorithms : polynomial time algorithm ("efficient algorithm") v.s. exponential time algorithm ("inefficient algorithm") f(n) \ n 10 30 50 n 0.00001 sec 0.00003 sec 0.00005 sec n5 0.1 sec 24.3 sec 5.2 mins 2n 0.001 sec 17.9 mins 35.7 yrs Young CS 331 NP-Completeness 2 D&A of Algo. 1 “Hard” and “easy’ Problems • Sometimes the dividing line between “easy” and “hard” problems is a fine one. For example – Find the shortest path in a graph from X to Y. (easy) – Find the longest path in a graph from X to Y. (with no cycles) (hard) • View another way – as “yes/no” problems – Is there a simple path from X to Y with weight <= M? (easy) – Is there a simple path from X to Y with weight >= M? (hard) – First problem can be solved in polynomial time. – All known algorithms for the second problem (could) take exponential time . Young CS 331 NP-Completeness 3 D&A of Algo. • Decision problem: The solution to the problem is "yes" or "no". Most optimization problems can be phrased as decision problems (still have the same time complexity). Example : Assume we have a decision algorithm X for 0/1 Knapsack problem with capacity M, i.e. Algorithm X returns “Yes” or “No” to the question “Is there a solution with profit P subject to knapsack capacity M?” Young CS 331 NP-Completeness 4 D&A of Algo.
    [Show full text]
  • NL Versus NP Frank Vega Joysonic, Uzun Mirkova 5, Belgrade, 11000, Serbia [email protected]
    NL versus NP Frank Vega Joysonic, Uzun Mirkova 5, Belgrade, 11000, Serbia [email protected] Abstract P versus NP is considered as one of the most important open problems in computer science. This consists in knowing the answer of the following question: Is P equal to NP? It was essentially mentioned in 1955 from a letter written by John Nash to the United States National Security Agency. However, a precise statement of the P versus NP problem was introduced independently by Stephen Cook and Leonid Levin. Since that date, all efforts to find a proof for this problem have failed. Another major complexity classes are L and NL. Whether L = NL is another fundamental question that it is as important as it is unresolved. We demonstrate if L is not equal to NL, then P = NP. In addition, we show if L is equal to NL, then P = NP. In this way, we prove the complexity class P is equal to NP. Furthermore, we demonstrate the complexity class NL is equal to NP. 2012 ACM Subject Classification Theory of computation → Complexity classes; Theory of compu- tation → Problems, reductions and completeness Keywords and phrases complexity classes, completeness, polynomial time, reduction, logarithmic space 1 Introduction In previous years there has been great interest in the verification or checking of computations [16]. Interactive proofs introduced by Goldwasser, Micali and Rackoff and Babi can be viewed as a model of the verification process [16]. Dwork and Stockmeyer and Condon have studied interactive proofs where the verifier is a space bounded computation instead of the original model where the verifier is a time bounded computation [16].
    [Show full text]
  • 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008
    MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.080/6.089 GITCS DATE Lecture 12 Lecturer: Scott Aaronson Scribe: Mergen Nachin 1 Review of last lecture • NP-completeness in practice. We discussed many of the approaches people use to cope with NP-complete problems in real life. These include brute-force search (for small instance sizes), cleverly-optimized backtrack search, fixed-parameter algorithms, approximation algorithms, and heuristic algorithms like simulated annealing (which don’t always work but often do pretty well in practice). • Factoring, as an intermediate problem between P and NP-complete. We saw how factoring, though believed to be hard for classical computers, has a special structure that makes it different from any known NP-complete problem. • coNP. 2 Space complexity Now we will categorize problems in terms of how much memory they use. Definition 1 L is in PSPACE if there exists a poly-space Turing machine M such that for all x, x is in L if and only if M(x) accepts. Just like with NP, we can define PSPACE-hard and PSPACE-complete problems. An interesting example of a PSPACE-complete problem is n-by-n chess: Given an arrangement of pieces on an n-by-n chessboard, and assuming a polynomial upper bound on the number of moves, decide whether White has a winning strategy. (Note that we need to generalize chess to an n-by-n board, since standard 8-by-8 chess is a finite game that’s completely solvable in O(1) time.) Let’s now define another complexity class called EXP, which is apparently even bigger than PSPACE.
    [Show full text]
  • The Complexity Classes P and NP Andreas Klappenecker [Partially Based on Slides by Professor Welch] P Polynomial Time Algorithms
    The Complexity Classes P and NP Andreas Klappenecker [partially based on slides by Professor Welch] P Polynomial Time Algorithms Most of the algorithms we have seen so far run in time that is upper bounded by a polynomial in the input size • sorting: O(n2), O(n log n), … 3 log 7 • matrix multiplication: O(n ), O(n 2 ) • graph algorithms: O(V+E), O(E log V), … In fact, the running time of these algorithms are bounded by small polynomials. Categorization of Problems We will consider a computational problem tractable if and only if it can be solved in polynomial time. Decision Problems and the class P A computational problem with yes/no answer is called a decision problem. We shall denote by P the class of all decision problems that are solvable in polynomial time. Why Polynomial Time? It is convenient to define decision problems to be tractable if they belong to the class P, since - the class P is closed under composition. - the class P is nearly independent of the computational model. [Of course, no one will consider a problem requiring an Ω(n100) algorithm as efficiently solvable. However, it seems that most problems in P that are interesting in practice can be solved fairly efficiently. ] NP Efficient Certification An efficient certifier for a decision problem X is a polynomial time algorithm that takes two inputs, an putative instance i of X and a certificate c and returns either yes or no. there is a polynomial such that for every string i, the string i is an instance of X if and only if there exists a string c such that c <= p(|i|) and B(d,c) = yes.
    [Show full text]
  • Projects. Probabilistically Checkable Proofs... Probabilistically Checkable Proofs PCP Example
    Projects. Probabilistically Checkable Proofs... Probabilistically Checkable Proofs What’s a proof? Statement: A formula φ is satisfiable. Proof: assignment, a. Property: 5 minute presentations. Can check proof in polynomial time. A real theory. Polytime Verifier: V (π) Class times over RRR week. A tiny introduction... There is π for satisfiable φ where V(π) says yes. For unsatisfiable φ, V (π) always says no. Will post schedule. ...and one idea Can prove any statement in NP. Tests submitted by Monday (mostly) graded. ...using random walks. Rest will be done this afternoon. Probabilistically Checkable Proof System:(r(n),q(n)) n is size of φ. Proof: π. Polytime V(π) Using r(n) random bits, look at q(n) places in π If φ is satisfiable, there is a π, where Verifier says yes. If φ is not satisfiable, for all π, Pr[V(π) says yes] 1/2. ≤ PCP Example. Probabilistically Checkable Proof System:(r(n),q(n)) Probabilistically Checkable Proof System:(r(n),q(n)) Graph Not Isomorphism: (G ,G ). n is size of φ. 1 2 n is size of φ. There is no way to permute the vertices of G1 to get G2. Proof: π. Proof: π. Polytime V(π) Give a PCP(poly(n), 1). (Weaker than PCP(O(logn), 3). Polytime V(π) Using r(n) random bits, look at q(n) places in π Exponential sized proof is allowed. Using r(n) random bits, look at q(n) places in π If φ is satisfiable, there is a π, Can only look at 1 place, though.
    [Show full text]
  • A Gentle Introduction to Computational Complexity Theory, and a Little Bit More
    A GENTLE INTRODUCTION TO COMPUTATIONAL COMPLEXITY THEORY, AND A LITTLE BIT MORE SEAN HOGAN Abstract. We give the interested reader a gentle introduction to computa- tional complexity theory, by providing and looking at the background leading up to a discussion of the complexity classes P and NP. We also introduce NP-complete problems, and prove the Cook-Levin theorem, which shows such problems exist. We hope to show that study of NP-complete problems is vi- tal to countless algorithms that help form a bridge between theoretical and applied areas of computer science and mathematics. Contents 1. Introduction 1 2. Some basic notions of algorithmic analysis 2 3. The boolean satisfiability problem, SAT 4 4. The complexity classes P and NP, and reductions 8 5. The Cook-Levin Theorem (NP-completeness) 10 6. Valiant's Algebraic Complexity Classes 13 Appendix A. Propositional logic 17 Appendix B. Graph theory 17 Acknowledgments 18 References 18 1. Introduction In \computational complexity theory", intuitively the \computational" part means problems that can be modeled and solved by a computer. The \complexity" part means that this area studies how much of some resource (time, space, etc.) a problem takes up when being solved. We will focus on the resource of time for the majority of the paper. The motivation of this paper comes from the author noticing that concepts from computational complexity theory seem to be thrown around often in casual discus- sions, though poorly understood. We set out to clearly explain the fundamental concepts in the field, hoping to both enlighten the audience and spark interest in further study in the subject.
    [Show full text]
  • Complexity Classes
    CHAPTER Complexity Classes In an ideal world, each computational problem would be classified at least approximately by its use of computational resources. Unfortunately, our ability to so classify some important prob- lems is limited. We must be content to show that such problems fall into general complexity classes, such as the polynomial-time problems P, problems whose running time on a determin- istic Turing machine is a polynomial in the length of its input, or NP, the polynomial-time problems on nondeterministic Turing machines. Many complexity classes contain “complete problems,” problems that are hardest in the class. If the complexity of one complete problem is known, that of all complete problems is known. Thus, it is very useful to know that a problem is complete for a particular complexity class. For example, the class of NP-complete problems, the hardest problems in NP, contains many hundreds of important combinatorial problems such as the Traveling Salesperson Prob- lem. It is known that each NP-complete problem can be solved in time exponential in the size of the problem, but it is not known whether they can be solved in polynomial time. Whether ? P and NP are equal or not is known as the P = NP question. Decades of research have been devoted to this question without success. As a consequence, knowing that a problem is NP- complete is good evidence that it is an exponential-time problem. On the other hand, if one such problem were shown to be in P, all such problems would be been shown to be in P,a result that would be most important.
    [Show full text]