The Classes P and NP

Save this PDF as:

Size: px
Start display at page:

Transcription

1 The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the bulk of our practical computational problems and have been central to the theory of computation for years. The first is a class which contains all of the problems we actually solve using computers. If we think about the problems we normally present to the computer, we note that not too many computations require more than O(n 3 ) or O(n4 ) time. In fact, most of the important algorithms are somewhere in the linear to O(n 3 ) range. With this in mind, we state that practical computation resides within polynomial time bounds. There is a name for this class of problems. Definition. The class of polynomially solvable problems: P, contains all sets in which membership may be decided by an algorithm whose running time is bounded by a polynomial. Besides containing all of what we have decided to consider practical computational tasks, the class P has another attractive attribute. Its use allows us to not worry about our machine model since all reasonable models of computation (including programs and Turing machines) have time complexities (running times) which are polynomially related. That was the class of problems we actually compute. There is another important class. This one is the class of problems that we would love to solve but are unable to do so exactly. Since that sounds strange, let's look at an example: final examination scheduling. A school has n courses and five days in which to schedule examinations. The optimal schedule would be one where no student has to take two examinations on the same day. This seems like an easy problem. But, there are O(5 n ) possible different schedules. If we looked at them all with a computer which could check a million schedules every second, the time spent checking for a value of n = 50 would be more than 200,000,000,000,000,000,000 years! Yes, that's a long time. Obviously this will not be done between registration and the end of the semester.

2 P and NP 2 One might wonder if the above analysis was needed, because after all, who would look at all of the schedules? You should only need to check a few of the obvious ones. Or do you? Think back over all of the examination schedules you have seen. Were there any which were optimal? No! This indicates that there must be a problem somewhere. Let us think a little more about examination schedules. While it might be very difficult to find a good one, it is easy to check a schedule to see how near perfect it is. This process is called verification and allows us to know almost immediately if we stumble upon a good schedule. Consider another problem, that of finding a minimal length tour of n cities where we begin and end at the same place. (We call this the closed city tour problem.) Again, there are many solutions, in fact, there are n-1 factorial different tours. But, once more, if we have a tour, we can easily check to see how long it is. Thus if we want a tour of less than some fixed length, we can quickly check candidates to see if they qualify. It is very interesting to have some problems that seem to require exponential time to solve, but candidates for solution can be checked or verified rather quickly. This provides some hope of solving problems of this kind. If we can determine the worth of an answer, then maybe we can investigate promising solutions and keep the best one. Let us consider a class of problems which all seem very complex, but have solutions which are easily checked. Here is a class which contains the problems for which solutions can be verified in polynomial time. Definition. The class of nondeterministic polynomially acceptable problems: NP, contains all sets in which membership can be verified in polynomial time. This may seem to be quite a bizarre collection of problems. But think for a moment. The examination scheduling problem does fit here. If we were to find a solution, it could be checked out very quickly. Lots of other problems fall into this category. Closed tours of groups of cities for instance. Plus, many graph problems used in CAD algorithms for computer chip design. Also, most scheduling problems. This turns out to be a very interesting and useful collection of problems. One might wonder about the time actually involved in solving membership in this class. The only known relationship between NP and deterministic time is the following result.

3 P and NP 3 Theorem 1. For every set A in NP there is a polynomial p(n) such the problem of whether a data item of size n is a member of A can be solved in 2 p(n) time. A useful tool in studying the relationships between members of a class is to translate or map one into another. If we can translate one set into another, we can often deduce properties of one by the properties that we know the other possesses. This is called reducibility, is pictured in Figure 1, and defined below. Definition. The set A is many-one polynomial-time reducible to the set B (to be written as A p B) if and only if there is a recursive function g(x) which can be computed in polynomial time such that for all x: x A if and only if g(x) B. A A B B Figure 1 - A many to one mapping between sets Note that all of the members of A map into a portion of B and all elements not in A map into a part of B s complement. This gives us a way to solve membership in A if we know how to solve membership in B. If A is reducible to B via the function g(x), then all we need do to determine if x is in A is to check to see if g(x) is in B. One of the properties preserved by reducibility is complexity. Recall that to decide whether x was in A, we had to: a) Compute g(x), and b) Check to see if g(x) was in B. Thus the complexity of deciding membership in A is the sum of the complexities of computing g(x) and deciding membership in B. If computing g(x) does not take very long then we can say that A is no more complex than A. From this discussion we can state the following theorem. Theorem 2. If A p B and B is in P, then A is in P also.

4 P and NP 4 And of course if A p B and B is in NP, then A is in NP for exactly the same reasons. This brings up another concept. Definition. The set A is hard for a class of sets if and only if every set in the class is many-one polynomial time reducible to A. Note that if some members of the class require at least polynomial time to decide, then the set A is more complex than any of the members of the class it is hard for. Thus an NP-hard set would be more difficult to decide membership in than any set in NP. If it were also in NP, then it would be the most complex set in the class. We have a name for this. Definition. A set is complete for a class if and only if it is a member of the class and hard for the class. The corollary to the following theorem is a very important observation about NP-complete sets and polynomial reducibilities. It will be our major tool in proving sets NP-complete. It follows from the fact that polynomial time reducibility is transitive. (That is, if A p B and B p C then A p C.) Theorem 3. If A p B and A is NP-hard, then B is NP-hard also. Corollary. If A p B for a set B in NP, and A is NP-complete, then B is NPcomplete also. Polynomial reducibilities also may be used to place upper bounds upon sets in P. For example, the following result is based on this. Theorem 4. If A is NP-complete then A is a member of P if and only if P is the same class as NP. Proof. Almost obvious. If A is a member of P then every set polynomially reducible to A is also in P. Thus the NP-completeness of A forces every single one of the sets in NP to be members of P. On the other hand, if P = NP then of course A is a member of P as well.. This is very interesting. If we know that one NP-complete set can be decided in polynomial time then we know that every set in NP can be decided using some polynomial algorithm! Since we know of no sub-exponential algorithms for membership in any of these sets this means that we can get them all for the price of one. But, it is felt that this is highly unlikely since nobody has done it yet and the problem has been around for a while.

5 P and NP 5 Of course for any of the above discussion to be worthwhile we need to see an NP-complete set. Or at least prove that there is one. The following definitions from the propositional calculus lead to our first NP-complete problem. Definition. A clause is a finite collection of literals, which in turn are Boolean variables or their complements. Definition. A clause is satisfiable if and only if at least one literal in the clause is true. Suppose we examine the clause ( v 1, v 3, v7 ) which comes from the set of Boolean variables { v 1,, v n }. This clause is satisfiable if either v 1 or v 3 are true or v 7 is false. Now let us look at the collection of clauses: (v 1, v 2, v 3), ( v 2), ( v 1, v 3) All three are true (at once) when all three variables are true. Thus we shall say that a collection of clauses is satisfiable if and only if there is some assignment of truth values to the variables which makes all of the clauses true simultaneously. The collection: (v 1, v2, v3), ( v2), (v 2,v 3), ( v1, v3) is not satisfiable because at least one of the three clauses will be false no matter how the truth values are assigned to the variables. Now for the first decision problem which is NP-complete. It is central to theorem proving procedures and the propositional calculus. The Satisfiability Problem (SAT). Given a set of clauses, is there an assignment of truth values to the variables such that the collection of clauses is satisfiable? Since some collections are satisfiable and some are not, this is obviously a nontrivial decision problem. And it just happens to be NP-complete! By the way, it is not the general satisfiability problem for propositional calculus, but the conjunctive normal form satisfiability problem. Here is the theorem and its proof. Theorem 5. The satisfiability problem is NP-complete. Proof Sketch. The first part of the proof is to show that the satisfiability problem is in NP. This is simple. A machine which checks this merely

6 P and NP 6 jots down a truth value for each Boolean variable in a nondeterministic manner, plugs these into each clause, and then checks to see if one literal per clause is true. A Turing machine can do this as quickly as it can read the clauses. The hard part is showing that every set in NP is reducible to the satisfiability problem. Let's start. First of all, if a set is in NP then there is some one tape Turing machine M i with alphabet = {0, 1, b} which recognizes members (i.e., verifies membership) of the set within time p(n) for a polynomial p(n). What we wish is to design a polynomial time computable recursive function g i (x) such that: M i recognizes x iff g i (x) SAT. For g i (x) to be a member of SAT, it must be some collection of clauses which contain at least one true literal per clause under some assignment of truth values. This means that g i must produce a logical expression which states that M i accepts x. Let us recall what we know about computations and arithmetization. Now examine the following collections of assertions. a) When M i begins computation: #x is on the tape, the tape head is on square one, and instruction I1 is about to be executed. b) At each step of M i 's computation: only one instruction is about to be executed, only one tape square is being scanned, and every tape square contains exactly one symbol. c) At each computational step, the instruction being executed and the symbol on the square being scanned completely determine: the symbol written on the square being read, the next position of the head, and the next instruction to be executed. d) Before p(n) steps, M i is in a halting configuration. These assertions tell us about the computation of M i (x). So, if we can determine how to transform x into a collection of clauses which mean exactly the same things as the assertions written above, we have indeed found our g i (x). And, if g i (x) is polynomially computable we are done.

7 P and NP 7 First let us review our parameters for the Turing machine M i. It uses the alphabet {0, 1, b, #} (where # is used only as an endmarker) and has m instructions. Since the computation time is bounded by the polynomial p(n) we know that only p(n) squares of tape may be written upon. Now let us examine the variables used in the clauses we are about to generate. There are three families of them. For all tape squares from 1 to p(n) and computational steps from time 0 to time p(n), we have the collection of Boolean variables of the form HEAD[s, t] which is true if M i has its tape head positioned on tape square s at time t. (Note that there are p(n) 2 of these variables.) For the same time bounds and all instructions, we have the variables of the form INSTR[i, t] which is true if M i is about to execute instruction number i at time t. There are only m p(n) of these variables. The last family contains variables of the form CHAR[c, s, t] which is true if character c in {0, 1, b, #} is found upon tape square s at time t. So, we have O(p(n) 2 ) variables in all. This is still a polynomial. Now let's build the clauses which mean the same as the above assertions. First, the machine must begin properly. At time 0 we have #x on the tape. If x = 0110 then the clauses which state this are: (CHAR[#,1,0]), (CHAR[0,2,0]), (CHAR[1,3,0]), (CHAR[1,4,0]), (CHAR[0,5,0]) and blanks are placed upon the remainder of the tape with: (CHAR[b,6,0]),..., (CHAR[b,p(n),0]). Since the machine begins on square one with instruction 1, we also include: (HEAD[1,0]), (INSTR[1,0]). That finishes our first assertion. Note that all of the variables in these clauses must be true for g i (x) to be satisfiable since each clause contains

8 P and NP 8 exactly one literal. This starts M i (x) off properly. Also note that there are p(n)+2 of these particular one variable clauses. (NB. We shall keep count of the total number of literals used so far as we go so that we will know g i (x).) During computation one instruction may be executed at each step. But, if the computation has halted then no more instructions can be executed. To remedy this we introduce a bogus instruction numbered 0 and make M i switch to it whenever a halt instruction is encountered. Since M i remains on instruction 0 from then on, at each step exactly one instruction is executed. The family of clauses (one for each time t p(n)) of the form: (INSTR[0,t], INSTR[1,t],..., INSTR[m,t]) maintain that M i is executing at least one instruction during each computational step. There are (m+1) p(n) literals in these. We can outlaw pairs of instructions (or more) at each step by including a clause of the form: (INSTR[i, t], INSTR[j, t] ) for each instruction pair i and j (where i < j) and each time t. These clauses state that no pair of instructions can be executed at once and there are about p(n) m 2 literals in them. Clauses which mandate the tape head to be on one and only one square at each step are very much the same. So are the clauses which state that exactly one symbol is written upon each tape square at each step of the computation. The number of literals in these clauses is on the order of p(n) 2. (So, we still have a polynomial number of literals in our clauses to date.) Now we must describe the action of M i when it changes from configuration to configuration during computation. Consider the Turing machine instruction: I27: 0 1 right I halt Thus if M i is to execute instruction 27 at step 239 and is reading a 0 on square 45 we would state the following implication:

10 P and NP 10 (INSTR[0, t], INSTR[0,t+1]) (HEAD[0, t], HEAD[0,t+1) (this was another if-then statement) and note that there are O(p(n)) literals here. One more assertion and we are done. Before p(n) steps, M i must halt if it is going to accept. This is an easy one since the machine goes to instruction 0 only if it halts. This is merely the clause (INSTR[0,p(n)]). Of course this one must be true if the entire collection of clauses is to be satisfiable. That is the construction of g i (x). We need to show that it can be done in polynomial time. So, think about it. Given the machine and the time bound p(n), it is easy (long and tedious, but easy) to read the description of the Turing machine and generate the above clauses. In fact we could write them down in a steady stream as we counted to p(n) in loops such as the following. for time = 1 to p(n) for tape square = 1 to p(n) for scratch parameter = 1 to p(n) jot down the necessary clauses So, computing g i (x) takes about as much time to compute as it does to write it down. Thus its complexity is O( g i (x) ). The same as the length of all of the literals in the clauses. Since there are O(p(n) 2 ) of these and the length of a literal will not exceed log 2 (p(n)) we arrive at polynomial time complexity for the computation of g i (x). The remainder of the proof is to show that M i accepts x iff g i (x) SAT. While not completely trivial it does follow from an examination of the definitions of how Turing machines operate compared to the satisfiability of the clauses in the above construction. The first part of the proof is to argue that if M i accepts x, then there is a sequence of configurations which M i progresses through. Setting the HEAD, CHAR, and INSTR variables so that they describe these configurations makes the set of clauses computed by g i (x) satisfiable. The remainder of the proof is to

11 P and NP 11 argue that if g i (x) can be satisfied then there is an accepting computation for M i (x). That was our first NP-complete problem. It may not be quite everyone's favorite, but at least we have shown that one does indeed exist. And now we are able to state a result having to do with the P = NP question in very explicit terms. In fact the satisfiability problem has become central to that question. And by the second corollary, an aid to proving NP-completeness. Corollary. SAT is in P if and only if P = NP. Corollary. If A Υ NP and SAT p A then A is NP-complete. So, all we need to do is determine the complexity of the satisfiability problem and we have discovered whether P and NP are the same. Unfortunately this seems much easier said than done!

CAD Algorithms The Classes P and NP Mohammad Tehranipoor ECE Department 6 September 2010 1 P and NP P and NP are two families of problems. P is a class which contains all of the problems we solve using

On the Relationship between Classes P and NP

Journal of Computer Science 8 (7): 1036-1040, 2012 ISSN 1549-3636 2012 Science Publications On the Relationship between Classes P and NP Anatoly D. Plotnikov Department of Computer Systems and Networks,

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

NP-complete? NP-hard? Some Foundations of Complexity Prof. Sven Hartmann Clausthal University of Technology Department of Informatics Tractability of Problems Some problems are undecidable: no computer

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard goddard@cse.unl.edu CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes

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

Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

Lecture 7: NP-Complete Problems

IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24

Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24 The final exam will cover seven topics. 1. greedy algorithms 2. divide-and-conquer algorithms

Tutorial 8. NP-Complete Problems

Tutorial 8 NP-Complete Problems Decision Problem Statement of a decision problem Part 1: instance description defining the input Part 2: question stating the actual yesor-no question A decision problem

OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012

276 The P vs. NP problem is a major unsolved problem in computer science It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute to carry a \$ 1,000,000 prize for the

Theoretical Computer Science (Bridging Course) Complexity

Theoretical Computer Science (Bridging Course) Complexity Gian Diego Tipaldi A scenario You are a programmer working for a logistics company Your boss asks you to implement a program that optimizes the

Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP.

Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP. Explication: In his paper, The Singularity: A philosophical analysis, David Chalmers defines an extendible

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

Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office hour: Tuesday 10:30 11:30 slides: http://www.ist.tugraz.at/pact.html

Turing Machines: An Introduction

CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

CSC 373: Algorithm Design and Analysis Lecture 16

CSC 373: Algorithm Design and Analysis Lecture 16 Allan Borodin February 25, 2013 Some materials are from Stephen Cook s IIT talk and Keven Wayne s slides. 1 / 17 Announcements and Outline Announcements

A Working Knowledge of Computational Complexity for an Optimizer

A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi TAs: Y. Chen, G. Hall, J. Ye Fall 2014 1 Why computational complexity? What is computational

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

LOGIC AND COMPUTER SCIENCE Phokion G. Kolaitis Computer Science Department, University of California, Santa Cruz, CA 95064, USA Keywords: algorithm, Armstrong s axioms, complete problem, complexity class,

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

91.502 Foundations of Comuter Science 1 Introduction to Written and coyright c by Jie Wang 1 We use time-bounded (deterministic and nondeterministic) Turing machines to study comutational comlexity of

Lecture 2: Universality

CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

SOLVING NARROW-INTERVAL LINEAR EQUATION SYSTEMS IS NP-HARD PATRICK THOR KAHL. Department of Computer Science

SOLVING NARROW-INTERVAL LINEAR EQUATION SYSTEMS IS NP-HARD PATRICK THOR KAHL Department of Computer Science APPROVED: Vladik Kreinovich, Chair, Ph.D. Luc Longpré, Ph.D. Mohamed Amine Khamsi, Ph.D. Pablo

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY 11794 4400

Lecture 19: Introduction to NP-Completeness Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Reporting to the Boss Suppose

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

University of Virginia - cs3102: Theory of Computation Spring 2010 Final Exam - Comments Problem 1: Definitions. (Average 7.2 / 10) For each term, provide a clear, concise, and precise definition from

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

SIMS 255 Foundations of Software Design Complexity and NP-completeness Matt Welsh November 29, 2001 mdw@cs.berkeley.edu 1 Outline Complexity of algorithms Space and time complexity ``Big O'' notation Complexity

P versus NP, and More

1 P versus NP, and More Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 If you have tried to solve a crossword puzzle, you know that it is much harder to solve it than to verify

Chapter 1. NP Completeness I. 1.1. Introduction. By Sariel Har-Peled, December 30, 2014 1 Version: 1.05

Chapter 1 NP Completeness I By Sariel Har-Peled, December 30, 2014 1 Version: 1.05 "Then you must begin a reading program immediately so that you man understand the crises of our age," Ignatius said solemnly.

Notes on NP Completeness

Notes on NP Completeness Rich Schwartz November 10, 2013 1 Overview Here are some notes which I wrote to try to understand what NP completeness means. Most of these notes are taken from Appendix B in Douglas

Computing basics. Ruurd Kuiper

Computing basics Ruurd Kuiper October 29, 2009 Overview (cf Schaum Chapter 1) Basic computing science is about using computers to do things for us. These things amount to processing data. The way a computer

Introduction to Algorithms. Part 3: P, NP Hard Problems

Introduction to Algorithms Part 3: P, NP Hard Problems 1) Polynomial Time: P and NP 2) NP-Completeness 3) Dealing with Hard Problems 4) Lower Bounds 5) Books c Wayne Goddard, Clemson University, 2004 Chapter

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding

An example of a computable

An example of a computable absolutely normal number Verónica Becher Santiago Figueira Abstract The first example of an absolutely normal number was given by Sierpinski in 96, twenty years before the concept

Fixed-Point Logics and Computation

1 Fixed-Point Logics and Computation Symposium on the Unusual Effectiveness of Logic in Computer Science University of Cambridge 2 Mathematical Logic Mathematical logic seeks to formalise the process of

Chapter. NP-Completeness. Contents

Chapter 13 NP-Completeness Contents 13.1 P and NP......................... 593 13.1.1 Defining the Complexity Classes P and NP...594 13.1.2 Some Interesting Problems in NP.......... 597 13.2 NP-Completeness....................

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER JASPER DEANTONIO Abstract. This paper is a study of the Turing Degrees, which are levels of incomputability naturally arising from sets of natural numbers.

Computational complexity theory

Computational complexity theory Goal: A general theory of the resources needed to solve computational problems What types of resources? Time What types of computational problems? decision problem Decision

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 008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Quantum and Non-deterministic computers facing NP-completeness

Quantum and Non-deterministic computers facing NP-completeness Thibaut University of Vienna Dept. of Business Administration Austria Vienna January 29th, 2013 Some pictures come from Wikipedia Introduction

Introduction to computer science

Introduction to computer science Michael A. Nielsen University of Queensland Goals: 1. Introduce the notion of the computational complexity of a problem, and define the major computational complexity classes.

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along

Chapter 7 Uncomputability

Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 17 Shannon-Fano-Elias Coding and Introduction to Arithmetic Coding

The Halting Problem is Undecidable

185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine

Complexity Classes P and NP

Complexity Classes P and NP MATH 3220 Supplemental Presentation by John Aleshunas The cure for boredom is curiosity. There is no cure for curiosity Dorothy Parker Computational Complexity Theory In computer

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313]

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313] File Structures A file is a collection of data stored on mass storage (e.g., disk or tape) Why on mass storage? too big to fit

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

Discuss the size of the instance for the minimum spanning tree problem.

3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

Factoring & Primality

Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

Prime Numbers. Chapter Primes and Composites

Chapter 2 Prime Numbers The term factoring or factorization refers to the process of expressing an integer as the product of two or more integers in a nontrivial way, e.g., 42 = 6 7. Prime numbers are

Computability Theory

CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

The Trip Scheduling Problem

The Trip Scheduling Problem Claudia Archetti Department of Quantitative Methods, University of Brescia Contrada Santa Chiara 50, 25122 Brescia, Italy Martin Savelsbergh School of Industrial and Systems

The P versus NP Solution

The P versus NP Solution Frank Vega To cite this version: Frank Vega. The P versus NP Solution. 2015. HAL Id: hal-01143424 https://hal.archives-ouvertes.fr/hal-01143424 Submitted on 17 Apr

COMP 250 Fall Mathematical induction Sept. 26, (n 1) + n = n + (n 1)

COMP 50 Fall 016 9 - Mathematical induction Sept 6, 016 You will see many examples in this course and upcoming courses of algorithms for solving various problems It many cases, it will be obvious that

The finite field with 2 elements The simplest finite field is

The finite field with 2 elements The simplest finite field is GF (2) = F 2 = {0, 1} = Z/2 It has addition and multiplication + and defined to be 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 0 0 = 0 0 1 = 0

ON THE COMPLEXITY OF THE GAME OF SET. {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu

ON THE COMPLEXITY OF THE GAME OF SET KAMALIKA CHAUDHURI, BRIGHTEN GODFREY, DAVID RATAJCZAK, AND HOETECK WEE {kamalika,pbg,dratajcz,hoeteck}@cs.berkeley.edu ABSTRACT. Set R is a card game played with a

6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try.

2. METHODS OF PROOF 69 2. Methods of Proof 2.1. Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. Trivial Proof: If we know q is true then

COMS4236: Introduction to Computational Complexity. Summer 2014

COMS4236: Introduction to Computational Complexity Summer 2014 Mihalis Yannakakis Lecture 17 Outline conp NP conp Factoring Total NP Search Problems Class conp Definition of NP is nonsymmetric with respect

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION REDUCIBILITY ( LECTURE 16) SLIDES FOR 15-453 SPRING 2011 1 / 20 THE LANDSCAPE OF THE CHOMSKY HIERARCHY ( LECTURE 16) SLIDES FOR 15-453 SPRING 2011 2 / 20 REDUCIBILITY

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

Universality in the theory of algorithms and computer science

Universality in the theory of algorithms and computer science Alexander Shen Computational models The notion of computable function was introduced in 1930ies. Simplifying (a rather interesting and puzzling)

Structural properties of oracle classes

Structural properties of oracle classes Stanislav Živný Computing Laboratory, University of Oxford, Wolfson Building, Parks Road, Oxford, OX1 3QD, UK Abstract Denote by C the class of oracles relative

Chapter 1. Computation theory

Chapter 1. Computation theory In this chapter we will describe computation logic for the machines. This topic is a wide interdisciplinary field, so that the students can work in an interdisciplinary context.

Lectures 5-6: Taylor Series

Math 1d Instructor: Padraic Bartlett Lectures 5-: Taylor Series Weeks 5- Caltech 213 1 Taylor Polynomials and Series As we saw in week 4, power series are remarkably nice objects to work with. In particular,

A TM. Recall the A TM language: A TM = { M, w M is a TM and M accepts w.} is undecidable. Theorem: The language. p.2/?

p.1/? Reducibility We say that a problem Q reduces to problem P if we can use P to solve Q. In the context of decidability we have the following templates : If A reduces to B and B is decidable, then so

Complexity and Completeness of Finding Another Solution and Its Application to Puzzles

yato@is.s.u-tokyo.ac.jp seta@is.s.u-tokyo.ac.jp Π (ASP) Π x s x s ASP Ueda Nagao n n-asp parsimonious ASP ASP NP Complexity and Completeness of Finding Another Solution and Its Application to Puzzles Takayuki

Classical Information and Bits

p. 1/24 Classical Information and Bits The simplest variable that can carry information is the bit, which can take only two values, 0 or 1. Any ensemble, description, or set of discrete values can be quantified

It is time to prove some theorems. There are various strategies for doing

CHAPTER 4 Direct Proof It is time to prove some theorems. There are various strategies for doing this; we now examine the most straightforward approach, a technique called direct proof. As we begin, it

9.2 Summation Notation

9. Summation Notation 66 9. Summation Notation In the previous section, we introduced sequences and now we shall present notation and theorems concerning the sum of terms of a sequence. We begin with a

3. Computational Complexity.

3. Computational Complexity. (A) Introduction. As we will see, most cryptographic systems derive their supposed security from the presumed inability of any adversary to crack certain (number theoretic)

CoNP and Function Problems

CoNP and Function Problems conp By definition, conp is the class of problems whose complement is in NP. NP is the class of problems that have succinct certificates. conp is therefore the class of problems

Algorithmic Software Verification

Algorithmic Software Verification (LTL Model Checking) Azadeh Farzan What is Verification Anyway? Proving (in a formal way) that program satisfies a specification written in a logical language. Formal

Subsets of Euclidean domains possessing a unique division algorithm

Subsets of Euclidean domains possessing a unique division algorithm Andrew D. Lewis 2009/03/16 Abstract Subsets of a Euclidean domain are characterised with the following objectives: (1) ensuring uniqueness

Lecture 1: Time Complexity

Computational Complexity Theory, Fall 2010 August 25 Lecture 1: Time Complexity Lecturer: Peter Bro Miltersen Scribe: Søren Valentin Haagerup 1 Introduction to the course The field of Computational Complexity

An Innocent Investigation

An Innocent Investigation D. Joyce, Clark University January 2006 The beginning. Have you ever wondered why every number is either even or odd? I don t mean to ask if you ever wondered whether every number

You know from calculus that functions play a fundamental role in mathematics.

CHPTER 12 Functions You know from calculus that functions play a fundamental role in mathematics. You likely view a function as a kind of formula that describes a relationship between two (or more) quantities.

CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

Exponential time algorithms for graph coloring

Exponential time algorithms for graph coloring Uriel Feige Lecture notes, March 14, 2011 1 Introduction Let [n] denote the set {1,..., k}. A k-labeling of vertices of a graph G(V, E) is a function V [k].

Theoretical Computer Science Bridging Course - Introduction / General Info. Summer Term 2016 Fabian Kuhn

Theoretical Computer Science Bridging Course - Introduction / General Info Summer Term 2016 Fabian Kuhn About the Course Topics Foundations of theoretical computer science Introduction to logic No lectures

1 Definition of a Turing machine

Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2012 April 2-16, 2012 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write

Practice Problems for Final Exam: Solutions CS 341: Foundations of Computer Science II Prof. Marvin K. Nakayama

Practice Problems for Final Exam: Solutions CS 341: Foundations of Computer Science II Prof. Marvin K. Nakayama 1. Short answers: (a) Define the following terms and concepts: i. Union, intersection, set

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

A Formalization of the Turing Test Evgeny Chutchev

A Formalization of the Turing Test Evgeny Chutchev 1. Introduction The Turing test was described by A. Turing in his paper [4] as follows: An interrogator questions both Turing machine and second participant

Complexity Theory. Jörg Kreiker. Summer term 2010. Chair for Theoretical Computer Science Prof. Esparza TU München

Complexity Theory Jörg Kreiker Chair for Theoretical Computer Science Prof. Esparza TU München Summer term 2010 Lecture 8 PSPACE 3 Intro Agenda Wrap-up Ladner proof and time vs. space succinctness QBF

NP-completeness and the real world. NP completeness. NP-completeness and the real world (2) NP-completeness and the real world

-completeness and the real world completeness Course Discrete Biological Models (Modelli Biologici Discreti) Zsuzsanna Lipták Imagine you are working for a biotech company. One day your boss calls you

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

Lecture 3: Finding integer solutions to systems of linear equations

Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture

Perfect Code is W[1]-complete

Information Processing Letters 81 (2002) 163 168 Perfect Code is W[1]-complete Marco Cesati Department of Computer Science, Systems, and Industrial Engineering, University of Rome Tor Vergata, via di Tor