Notes on Complexity Theory Last updated: December, Lecture 2

Size: px
Start display at page:

Download "Notes on Complexity Theory Last updated: December, Lecture 2"

Transcription

1 Notes on Complexity Theory Last updated: December, 2011 Jonathan Katz Lecture 2 1 Review The running time of a Turing machine M on input x is the number of steps M takes before it halts. Machine M is said to run in time T ( ) if for every input x the running time of M(x) is at most T ( x ). (In particular, this means it halts on all inputs.) The space used by M on input x is the number of cells written to by M on all its work tapes 1 (a cell that is written to multiple times is only counted once); M is said to use space T ( ) if for every input x the space used during the computation of M(x) is at most T ( x ). We remark that these time and space measures are worst-case notions; i.e., even if M runs in time T (n) for only a fraction of the inputs of length n (and uses less time for all other inputs of length n), the running time of M is still T. (Average-case notions of complexity have also been considered, but are somewhat more difficult to reason about. We may cover this later in the semester; or see [1, Chap. 18].) Recall that a Turing machine M computes a function f : {0, 1} {0, 1} if M(x) = f(x) for all x. We will focus most of our attention on boolean functions, a context in which it is more convenient to phrase computation in terms of languages. A language is simply a subset of {0, 1}. There is a natural correspondence between languages and boolean functions: for any boolean function f we may define the corresponding language L = {x f(x) = 1}. Conversely, for any language L we can define the boolean function f by f(x) = 1 iff x L. A Turing machine M decides a language L if x L M(x) = 1 x L M(x) = 0 (we sometimes also say that M accepts L, though we will try to be careful); this is the same as computing the boolean function f that corresponds to L. Note in particular that we require M to halt on all inputs. What is complexity theory about? The fundamental question of complexity theory is to understand the inherent complexity of various languages/problems/functions; i.e., what is the most efficient algorithm (Turing machine) deciding some language? A convenient terminology for discussing this is given by introducing the notion of a class, which is simply a set of languages. Two basic classes are: time(f(n)) is the set of languages decidable in time O(f(n)). (Formally, L time(f(n)) if there is a Turing machine M and a constant c such that (1) M decides L, and (2) M runs in time c f; i.e., for all x (of length at least 1) M(x) halts in at most c f( x ) steps.) space(f(n)) is the set of languages that can be decided using space O(f(n)). 1 Note that we do not count the space used on the input or output tapes; this allows us to meaningfully speak of sub-linear space machines (with linear- or superlinear-length output). 2-1

2 Note that we ignore constant factors in the above definitions. This is convenient, and lets us ignore low-level details about the model of computation. 2 Given some language L, then, we may be interested in determining the smallest f for which L time(f(n)). Or, perhaps we want to show that space(f(n)) is strictly larger than space(f (n)) for some functions f, f ; that is, that there is some language in the former that is not in the latter. Alternately, we may show that one class contains another. As an example, we start with the following easy result: Lemma 1 For any f(n) we have time(f(n)) space(f(n)). Proof This follows from the observation that a machine cannot write on more than a constant number of cells per move. 2 P, N P, and N P-Completeness 2.1 The Class P We now introduce one of the most important classes, which we equate (roughly) with problems that can be solved efficiently. This is the class P, which stands for polynomial time: P def = c 1 time(n c ). That is, a language L is in P if there exists a Turing machine M L and a polynomial p such that M L (x) runs in time p( x ), and M L decides L. Does P really capture efficient computation? There are debates both ways: For many problems nowadays that operate on extremely large inputs (think of Google s search algorithms), only linear-time are really desirable. (In fact, one might even want sublinear-time algorithms, which are only possible by relaxing the notion of correctness.) This is related to the (less extreme) complaint that an n 100 algorithm is not really efficient in any sense. The usual response here is that n 100 -time algorithms rarely occur. Moreover, when algorithms with high running times (e.g., n 8 ) do get designed, they tend to be quickly improved to be more efficient. From the other side, one might object that P does not capture all efficiently solvable problems. In particular, a randomized polynomial-time algorithm (that is correct with high probability) seems to also offer an efficient way of solving a problem. Most people today would agree with this objection, and would classify problems solvable by randomized polynomial-time algorithms as efficiently solvable. Nevertheless, it may turn out that such problems all lie in P anyway; this is currently an unresolved conjecture. (We will discuss the power of randomization, and the possibility of derandomization, later in the semester.) As mentioned previously, quantum polynomial-time algorithms may also be considered efficient. It is fair to say that until general-purpose quantum computers are implemented, this is still debatable. 2 This decision is also motivated by speedup theorems which state that if a language can be decided in time (resp., space) f(n) then it can be decided in time (resp., space) f(n)/c for any constant c. (This assumes that f(n) is a reasonable function, but the details need not concern us here.) 2-2

3 Another important feature of P is that it is closed under composition. That is, if an algorithm A (that otherwise runs in polynomial time) makes polynomially many calls to an algorithm B, and if B runs in polynomial time, then A runs in polynomial time. See [1] for further discussion. 2.2 The Classes N P and con P Another important class of problems are those whose solutions can be verified efficiently. This is the class N P. (Note: N P does not stand for non-polynomial time. Rather, it stands for non-deterministic polynomial-time for reasons that will become clear later.) Formally, L N P if there exists a Turing machine M L and a polynomial p such that (1) M L (x, w) runs in time 3 p( x ), and (2) x L iff there exists a w such that M L (x, w) = 1; such a w is called a witness (or, sometimes, a proof ) that x L. Compare this to the definition of P: a language L P if there exists a Turing machine M L and a polynomial p such that (1) M L (x) runs in time p( x ), and (2) x L iff M L (x) = 1. Stated informally, a language L is in P if membership in L can be decided efficiently. A language L is in N P if membership in L can be efficiently verified (given a correct proof). A classic example is given by the following language: { } G is a graph that has IndSet = (G, k) :. an independent set of size k We do not know an efficient algorithm for determining the size of the largest independent set in an arbitrary graph; hence we do not have any efficient algorithm deciding IndSet. However, if we know (e.g., through brute force, or because we constructed G with this property) that an independent set of size k exists in some graph G, it is easy to prove that (G, k) IndSet by simply listing the nodes in the independent set: verification just involves checking that every pair of nodes in the given set is not connected by an edge in G, which is easy to do in polynomial time. Note further than if G does not have an independent set of size k then there is no proof that could convince us otherwise (assuming we are using the stated verification algorithm). It is also useful to keep in mind an analogy with mathematical statements and proofs (though the correspondence is not rigorously accurate). In this view, P would correspond to the set of mathematical statements (e.g., 1+1=2 ) whose truth can be easily determined. N P, on the other hand, would correspond to the set of (true) mathematical statements that have short proofs (whether or not such proofs are easy to find). We have the following simple result, which is the best known as far as relating N P to the time complexity classes we have introduced thus far: Theorem 2 P N P c 1 time(2nc ). Proof The containment P N P is trivial. As for the second containment, say L N P. Then there exists a Turing machine M L and a polynomial p such that (1) M L (x, w) runs in time p( x ), and (2) x L iff there exists a w such that M L (x, w) = 1. Since M L (x, w) runs in time p( x ), it can read at most the first p( x ) bits of w and so we may assume that w in condition (2) has length at most p( x ). The following is then a deterministic algorithm for deciding L: 3 It is essential that the running time of M L be measured in terms of the length of x alone. An alternate approach is to require the length of w to be at most p( x ) in condition (2). 2-3

4 On input x, run M L (x, w) for all strings w {0, 1} p( x ). If any of these results in M L (x, w) = 1 then output 1; else output 0. The algorithm clearly decides L. Its running time on input x is O ( p( x ) 2 p( x )), and therefore L time ( 2 nc ) for some constant c. The classical definition of N P is in terms of non-deterministic Turing machines. Briefly, the model here is the same as that of the Turing machines we defined earlier, except that now there are two transition functions δ 0, δ 1, and at each step we imagine that the machine makes an arbitrary ( non-deterministic ) choice between using δ 0 or δ 1. (Thus, after n steps the machine can be in up to 2 n possible configurations.) Machine M is said to output 1 on input x if there exists at least one sequence of choices that would lead to output 1 on that input. (We continue to write M(x) = 1 in this case, though we stress again that M(x) = 1 when M is a non-deterministic machine just means that M(x) outputs 1 for some set of non-deterministic choices.) M decides L if x L M(x) = 1. A non-deterministic machine M runs in time T (n) if for every input x and every sequence of choices it makes, it halts in time at most T ( x ). The class ntime(f(n)) is then defined in the natural way: L ntime(f(n)) if there is a non-deterministic Turing machine M L such that M L (x) runs in time O(f( x )), and M L decides L. Non-deterministic space complexity is defined similarly: non-deterministic machine M uses space T (n) if for every input x and every sequence of choices it makes, it halts after writing on at most T ( x ) cells of its work tapes. The class nspace(f(n)) is then the set of languages L for which there exists a non-deterministic Turing machine M L such that M L (x) uses space O(f( x )), and M L decides L. The above leads to an equivalent definition of N P paralleling the definition of P: Claim 3 N P = c 1 ntime(nc ). This is a good exercise; a proof can be found in [1]. The major open question of complexity theory is whether P? = N P; in fact, this is one of the outstanding questions in mathematics today. The general belief is that P = N P, since it seems quite obvious that non-determinism is stronger than determinism (i.e., verifying should be easier than solving, in general), and there would be many surprising consequences if P were equal to N P. (See [1] for a discussion.) But we have had no real progress toward proving this belief. Conjecture 4 P N P. A (possibly feasible) open question is to prove that non-determinism is even somewhat stronger than determinism. It is known that ntime(n) is strictly stronger than time(n) (see [2, 3, 4] and references therein), but we do not know, e.g., whether time(n 3 ) ntime(n 2 ) The Class con P For any class C, we define the class coc as coc def = { L L C }, where = {0, 1} \ L is the complement of L. Applied to the class N P, we get the class con P of languages where nonmembership can be efficiently verified. In other words, L con P if there exists a Turing machine M L and a polynomial p such that (1) M L (x, w) runs in time 4 p( x ), and (2) x L iff for all w we have M L (x, w) = 1. Note why this (only) implies efficiently verifiable proofs of non-membership: 4 See footnote 3. L def 2-4

5 a single w where M L (x, w) = 0 is enough to convince someone that x L, but a single w where M L (x, w) = 1 means nothing. A con P language is easily obtained by taking the complement of any language in N P. So, for example, the complement of IndSet is the language NoIndSet = { (G, k) : G does not have an independent set of size k Let us double-check that this is in con P: we can prove that (G, k) NoIndSet by giving a set of k vertices that do form an independent set in G (this assumes the obvious verification algorithm); note that (assuming we use the obvious verification algorithm) we can never be fooled into believing that (G, k) is not in NoIndSet when it actually is. As another example of languages in N P and con P, consider the satisfiability problem which asks whether a boolean formula in conjunctive normal form is satisfiable (see [1] for a formal definition if you have not encountered these terms before). That is, SAT = {φ φ has a satisfying assignment}. Then SAT consists of boolean formulae with no satisfying assignment. We have SAT N P and SAT con P. As another example, consider the language TAUT of tautologies: TAUT = {φ : φ is satisfied by every assignment}. TAUT is also in con P. The class con P can also be defined in terms of non-deterministic Turing machines. This is left as an exercise. Note that P N P con P. (Why?) Could it be that N P = con P? Once again, we don t know the answer but it would be surprising if this were the case. In particular, there does not seem to be any way to give an efficiently verifiable proof that, e.g., a boolean formula does not have any satisfying assignment (which is what would be implied by SAT N P). Conjecture 5 N P con P. 2.3 N P-Completeness Defining N P-Completeness What does it mean for one language L to be harder 5 to decide than another language L? There are many possible answers to this question, but one way to start is by capturing the intuition that if L is harder than L, then an algorithm for deciding L should be useful for deciding L. We can formalize this idea using the concept of a reduction. Various types of reductions can be defined; we start with one of the most central: Definition 1 A language L is Karp reducible (or many-to-one reducible) to a language L if there exists a polynomial-time computable function f such that x L iff f(x) L. We express this by writing L p L. 5 Technically speaking, I mean at least as hard as. }. 2-5

6 The existence of a Karp reduction from L to L gives us exactly what we were looking for. Say there is a polynomial-time Turing machine (i.e., algorithm) M deciding L. Then we get a polynomial-time algorithm M deciding L by setting M(x) def = M (f(x)). (Verify that M does, indeed, run in polynomial time.) This explains the choice of notation L p L. We state some basic properties, all of which are straightforward to prove. Claim 6 We have: 1. (Transitivity) If A p B and B p C then A p C. 2. If A p B and B P then A P. 3. If A p B and B N P then A N P. A problem is N P-hard if it is at least as hard to solve as any problem in N P. It is N P- complete if it is N P-hard and also in N P. Formally: Definition 2 Language L is N P-hard if for every L N P it holds that L p L. Language L is N P-complete if L N P and L is N P-hard. Note that if L is N P-hard and L p L, then L is N P-hard as well. con P-completeness is defined analogously: a language L is con P-hard if for every L con P it holds that L p L ; language L is con P-complete if L is con P-hard and L con P Existence of N P-Complete Problems A priori, it is not clear that there should be any N P-complete problems. One of the surprising results from the early 1970s is that N P-complete problems exist. Soon after, it was shown that many important problems are, in fact, N P-complete. Somewhat amazingly, we now know thousands of N P-complete problems arising from various disciplines. Here is a trivial N P-complete language: L = { (M, x, 1 t ) : w {0, 1} t s.t. M(x, w) halts within t steps with output 1. }. Next time we will show more natural N P-complete languages References [1] S. Arora and B. Barak. Computational Complexity: A Modern Approach. Cambridge University Press, [2] R. Kannan. Towards separating nondeterminisn from determinisn. Math. Systems Theory 17(1): 29 45, [3] W. Paul, N. Pippenger, E. Szemeredi, and W. Trotter. On determinism versus non-determinisn and related problems. FOCS [4] R. Santhanam. On separators, segregators, and time versus space. IEEE Conf. Computational Complexity

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005 Jonathan Katz Lecture 3 1 Terminology For any complexity class C, we define the class coc as follows: coc def = { L L C }. One class

More information

Notes on Computer Theory Last updated: November, Circuits

Notes on Computer Theory Last updated: November, Circuits Notes on Computer Theory Last updated: November, 2015 Circuits Notes by Jonathan Katz, lightly edited by Dov Gordon. 1 Circuits Boolean circuits offer an alternate model of computation: a non-uniform one

More information

Turing Machines, diagonalization, the halting problem, reducibility

Turing Machines, diagonalization, the halting problem, reducibility Notes on Computer Theory Last updated: September, 015 Turing Machines, diagonalization, the halting problem, reducibility 1 Turing Machines A Turing machine is a state machine, similar to the ones we have

More information

Notes on Complexity Theory Last updated: November, Lecture 10

Notes on Complexity Theory Last updated: November, Lecture 10 Notes on Complexity Theory Last updated: November, 2015 Lecture 10 Notes by Jonathan Katz, lightly edited by Dov Gordon. 1 Randomized Time Complexity 1.1 How Large is BPP? We know that P ZPP = RP corp

More information

1 Computational problems

1 Computational problems 80240233: Computational Complexity Lecture 1 ITCS, Tsinghua Univesity, Fall 2007 9 October 2007 Instructor: Andrej Bogdanov Notes by: Andrej Bogdanov The aim of computational complexity theory is to study

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes Complexity Theory 1 Complexity Theory 2 Complexity Theory Lecture 3 Complexity For any function f : IN IN, we say that a language L is in TIME(f(n)) if there is a machine M = (Q, Σ, s, δ), such that: L

More information

Lecture 4 : Quest for Structure in Counting Problems

Lecture 4 : Quest for Structure in Counting Problems CS6840: Advanced Complexity Theory Jan 10, 2012 Lecture 4 : Quest for Structure in Counting Problems Lecturer: Jayalal Sarma M.N. Scribe: Dinesh K. Theme: Between P and PSPACE. Lecture Plan:Counting problems

More information

The Polynomial Hierarchy

The Polynomial Hierarchy The Polynomial Hierarchy Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Motivation..synthesizing circuits is exceedingly difficulty. It is even

More information

Computability and Complexity CISC462, Fall 2018, Space complexity 1

Computability and Complexity CISC462, Fall 2018, Space complexity 1 Computability and Complexity CISC462, Fall 2018, Space complexity 1 SPACE COMPLEXITY This material is covered in Chapter 8 of the textbook. For simplicity, we define the space used by a Turing machine

More information

Lecture 2. 1 More N P-Compete Languages. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

Lecture 2. 1 More N P-Compete Languages. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz Notes on Complexity Theory: Fall 2005 Last updated: September, 2005 Jonathan Katz Lecture 2 1 More N P-Compete Languages It will be nice to find more natural N P-complete languages. To that end, we ine

More information

CS151 Complexity Theory. Lecture 1 April 3, 2017

CS151 Complexity Theory. Lecture 1 April 3, 2017 CS151 Complexity Theory Lecture 1 April 3, 2017 Complexity Theory Classify problems according to the computational resources required running time storage space parallelism randomness rounds of interaction,

More information

Computability Crib Sheet

Computability Crib Sheet Computer Science and Engineering, UCSD Winter 10 CSE 200: Computability and Complexity Instructor: Mihir Bellare Computability Crib Sheet January 3, 2010 Computability Crib Sheet This is a quick reference

More information

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs Any Expression φ Can Be Converted into CNFs and DNFs φ = x j : This is trivially true. φ = φ 1 and a CNF is sought: Turn φ 1 into a DNF and apply de Morgan s laws to make a CNF for φ. φ = φ 1 and a DNF

More information

ITCS:CCT09 : Computational Complexity Theory Apr 8, Lecture 7

ITCS:CCT09 : Computational Complexity Theory Apr 8, Lecture 7 ITCS:CCT09 : Computational Complexity Theory Apr 8, 2009 Lecturer: Jayalal Sarma M.N. Lecture 7 Scribe: Shiteng Chen In this lecture, we will discuss one of the basic concepts in complexity theory; namely

More information

Complexity Theory 112. Space Complexity

Complexity Theory 112. Space Complexity Complexity Theory 112 Space Complexity We ve already seen the definition SPACE(f(n)): the languages accepted by a machine which uses O(f(n)) tape cells on inputs of length n. Counting only work space NSPACE(f(n))

More information

Handout 5. α a1 a n. }, where. xi if a i = 1 1 if a i = 0.

Handout 5. α a1 a n. }, where. xi if a i = 1 1 if a i = 0. Notes on Complexity Theory Last updated: October, 2005 Jonathan Katz Handout 5 1 An Improved Upper-Bound on Circuit Size Here we show the result promised in the previous lecture regarding an upper-bound

More information

Computational complexity

Computational complexity COMS11700 Computational complexity Department of Computer Science, University of Bristol Bristol, UK 2 May 2014 COMS11700: Computational complexity Slide 1/23 Introduction If we can prove that a language

More information

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

NP-Completeness. Until now we have been designing algorithms for specific problems NP-Completeness 1 Introduction Until now we have been designing algorithms for specific problems We have seen running times O(log n), O(n), O(n log n), O(n 2 ), O(n 3 )... We have also discussed lower

More information

Lecture 16: Time Complexity and P vs NP

Lecture 16: Time Complexity and P vs NP 6.045 Lecture 16: Time Complexity and P vs NP 1 Time-Bounded Complexity Classes Definition: TIME(t(n)) = { L there is a Turing machine M with time complexity O(t(n)) so that L = L(M) } = { L L is a language

More information

Notes on Complexity Theory Last updated: October, Lecture 6

Notes on Complexity Theory Last updated: October, Lecture 6 Notes on Complexity Theory Last updated: October, 2015 Lecture 6 Notes by Jonathan Katz, lightly edited by Dov Gordon 1 PSPACE and PSPACE-Completeness As in our previous study of N P, it is useful to identify

More information

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2. De Morgan s a Laws De Morgan s laws say that (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2. Here is a proof for the first law: φ 1 φ 2 (φ 1 φ 2 ) φ 1 φ 2 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 0 a Augustus DeMorgan

More information

Lecture 22: Quantum computational complexity

Lecture 22: Quantum computational complexity CPSC 519/619: Quantum Computation John Watrous, University of Calgary Lecture 22: Quantum computational complexity April 11, 2006 This will be the last lecture of the course I hope you have enjoyed the

More information

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

Class Note #20. In today s class, the following four concepts were introduced: decision Class Note #20 Date: 03/29/2006 [Overall Information] In today s class, the following four concepts were introduced: decision version of a problem, formal language, P and NP. We also discussed the relationship

More information

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?

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? N P NP Completeness Announcements Friday Four Square! Today at 4:15PM, outside Gates. Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Explore P, NP, and their connection. Did

More information

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

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! N P NP Announcements Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! Now in cabinets in the Gates open area near the drop-off box. The Complexity Class

More information

NP-Completeness Review

NP-Completeness Review CS124 NP-Completeness Review Where We Are Headed Up to this point, we have generally assumed that if we were given a problem, we could find a way to solve it. Unfortunately, as most of you know, there

More information

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

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010 CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010 We now embark on a study of computational classes that are more general than NP. As these classes

More information

Umans Complexity Theory Lectures

Umans Complexity Theory Lectures Complexity Theory Umans Complexity Theory Lectures Lecture 1a: Problems and Languages Classify problems according to the computational resources required running time storage space parallelism randomness

More information

Review of Basic Computational Complexity

Review of Basic Computational Complexity Lecture 1 Review of Basic Computational Complexity March 30, 2004 Lecturer: Paul Beame Notes: Daniel Lowd 1.1 Preliminaries 1.1.1 Texts There is no one textbook that covers everything in this course. Some

More information

1 Reductions and Expressiveness

1 Reductions and Expressiveness 15-451/651: Design & Analysis of Algorithms November 3, 2015 Lecture #17 last changed: October 30, 2015 In the past few lectures we have looked at increasingly more expressive problems solvable using efficient

More information

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak; Topics in Theoretical Computer Science February 29, 2016 Lecturer: Ola Svensson Lecture 2 (Notes) Scribes: Ola Svensson Disclaimer: These notes were written for the lecturer only and may contain inconsistent

More information

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

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18 20.1 Introduction Definition 20.1.1 We say that an algorithm runs in polynomial time if its running

More information

On the Computational Hardness of Graph Coloring

On the Computational Hardness of Graph Coloring On the Computational Hardness of Graph Coloring Steven Rutherford June 3, 2011 Contents 1 Introduction 2 2 Turing Machine 2 3 Complexity Classes 3 4 Polynomial Time (P) 4 4.1 COLORED-GRAPH...........................

More information

Lecture 4. 1 Circuit Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

Lecture 4. 1 Circuit Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz Notes on Complexity Theory: Fall 2005 Last updated: September, 2005 Jonathan Katz Lecture 4 1 Circuit Complexity Circuits are directed, acyclic graphs where nodes are called gates and edges are called

More information

A An Overview of Complexity Theory for the Algorithm Designer

A An Overview of Complexity Theory for the Algorithm Designer A An Overview of Complexity Theory for the Algorithm Designer A.1 Certificates and the class NP A decision problem is one whose answer is either yes or no. Two examples are: SAT: Given a Boolean formula

More information

The Complexity of Optimization Problems

The Complexity of Optimization Problems The Complexity of Optimization Problems Summary Lecture 1 - Complexity of algorithms and problems - Complexity classes: P and NP - Reducibility - Karp reducibility - Turing reducibility Uniform and logarithmic

More information

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions CS 6743 Lecture 15 1 Fall 2007 1 Circuit Complexity 1.1 Definitions A Boolean circuit C on n inputs x 1,..., x n is a directed acyclic graph (DAG) with n nodes of in-degree 0 (the inputs x 1,..., x n ),

More information

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

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1 U.C. Berkeley CS278: Computational Complexity Handout N1 Professor Luca Trevisan August 30, 2004 Notes for Lecture 1 This course assumes CS170, or equivalent, as a prerequisite. We will assume that the

More information

Lecture 21: Space Complexity (The Final Exam Frontier?)

Lecture 21: Space Complexity (The Final Exam Frontier?) 6.045 Lecture 21: Space Complexity (The Final Exam Frontier?) 1 conp NP MIN-FORMULA conp P NP FIRST-SAT TAUT P FACTORING SAT NP NP NP 2 VOTE VOTE VOTE For your favorite course on automata and complexity

More information

Lecture 20: conp and Friends, Oracles in Complexity Theory

Lecture 20: conp and Friends, Oracles in Complexity Theory 6.045 Lecture 20: conp and Friends, Oracles in Complexity Theory 1 Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode:

More information

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

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k. Complexity Theory Problems are divided into complexity classes. Informally: So far in this course, almost all algorithms had polynomial running time, i.e., on inputs of size n, worst-case running time

More information

CSE 135: Introduction to Theory of Computation NP-completeness

CSE 135: Introduction to Theory of Computation NP-completeness CSE 135: Introduction to Theory of Computation NP-completeness Sungjin Im University of California, Merced 04-15-2014 Significance of the question if P? NP Perhaps you have heard of (some of) the following

More information

The P versus NP Problem. Dean Casalena University of Cape Town CSLDEA001

The P versus NP Problem. Dean Casalena University of Cape Town CSLDEA001 The P versus NP Problem Dean Casalena University of Cape Town CSLDEA001 dean@casalena.co.za Contents 1. Introduction 2. Turing Machines and Syntax 2.1 Overview 2.2 Turing Machine Syntax. 2.3 Polynomial

More information

: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall October 2007

: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall October 2007 80240233: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall 2007 16 October 2007 Instructor: Andrej Bogdanov Notes by: Jialin Zhang and Pinyan Lu In this lecture, we introduce the complexity

More information

conp = { L L NP } (1) This problem is essentially the same as SAT because a formula is not satisfiable if and only if its negation is a tautology.

conp = { L L NP } (1) This problem is essentially the same as SAT because a formula is not satisfiable if and only if its negation is a tautology. 1 conp and good characterizations In these lecture notes we discuss a complexity class called conp and its relationship to P and NP. This discussion will lead to an interesting notion of good characterizations

More information

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

More information

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

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010 CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010 Computational complexity studies the amount of resources necessary to perform given computations.

More information

6-1 Computational Complexity

6-1 Computational Complexity 6-1 Computational Complexity 6. Computational Complexity Computational models Turing Machines Time complexity Non-determinism, witnesses, and short proofs. Complexity classes: P, NP, conp Polynomial-time

More information

Finish K-Complexity, Start Time Complexity

Finish K-Complexity, Start Time Complexity 6.045 Finish K-Complexity, Start Time Complexity 1 Kolmogorov Complexity Definition: The shortest description of x, denoted as d(x), is the lexicographically shortest string such that M(w) halts

More information

Lecture 18: P & NP. Revised, May 1, CLRS, pp

Lecture 18: P & NP. Revised, May 1, CLRS, pp Lecture 18: P & NP Revised, May 1, 2003 CLRS, pp.966-982 The course so far: techniques for designing efficient algorithms, e.g., divide-and-conquer, dynamic-programming, greedy-algorithms. What happens

More information

P, NP, NP-Complete, and NPhard

P, NP, NP-Complete, and NPhard P, NP, NP-Complete, and NPhard Problems Zhenjiang Li 21/09/2011 Outline Algorithm time complicity P and NP problems NP-Complete and NP-Hard problems Algorithm time complicity Outline What is this course

More information

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems Valentine Kabanets September 13, 2007 1 Complexity Classes Unless explicitly stated,

More information

DRAFT. Diagonalization. Chapter 4

DRAFT. Diagonalization. Chapter 4 Chapter 4 Diagonalization..the relativized P =?NP question has a positive answer for some oracles and a negative answer for other oracles. We feel that this is further evidence of the difficulty of the

More information

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity CSE 531: Computational Complexity I Winter 2016 Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity January 22, 2016 Lecturer: Paul Beame Scribe: Paul Beame Diagonalization enabled us to separate

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

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

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

CS154, Lecture 17: conp, Oracles again, Space Complexity

CS154, Lecture 17: conp, Oracles again, Space Complexity CS154, Lecture 17: conp, Oracles again, Space Complexity Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string

More information

NP, polynomial-time mapping reductions, and NP-completeness

NP, polynomial-time mapping reductions, and NP-completeness NP, polynomial-time mapping reductions, and NP-completeness In the previous lecture we discussed deterministic time complexity, along with the time-hierarchy theorem, and introduced two complexity classes:

More information

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

NP-Completeness I. Lecture Overview 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

More information

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem. 1 More on NP In this set of lecture notes, we examine the class NP in more detail. We give a characterization of NP which justifies the guess and verify paradigm, and study the complexity of solving search

More information

CSE200: Computability and complexity Space Complexity

CSE200: Computability and complexity Space Complexity CSE200: Computability and complexity Space Complexity Shachar Lovett January 29, 2018 1 Space complexity We would like to discuss languages that may be determined in sub-linear space. Lets first recall

More information

Reductions in Computability Theory

Reductions in Computability Theory Reductions in Computability Theory Prakash Panangaden 9 th November 2015 The concept of reduction is central to computability and complexity theory. The phrase P reduces to Q is often used in a confusing

More information

Time-bounded computations

Time-bounded computations Lecture 18 Time-bounded computations We now begin the final part of the course, which is on complexity theory. We ll have time to only scratch the surface complexity theory is a rich subject, and many

More information

CS154, Lecture 13: P vs NP

CS154, Lecture 13: P vs NP CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of

More information

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 So far our notion of realistic computation has been completely deterministic: The Turing Machine

More information

Space Complexity. then the space required by M on input x is. w i u i. F ) on. September 27, i=1

Space Complexity. then the space required by M on input x is. w i u i. F ) on. September 27, i=1 Space Complexity Consider a k-string TM M with input x. Assume non- is never written over by. a The purpose is not to artificially reduce the space needs (see below). If M halts in configuration (H, w

More information

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).

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). CS 221: Computational Complexity Prof. Salil Vadhan Lecture Notes 4 February 3, 2010 Scribe: Jonathan Pines 1 Agenda P-/NP- Completeness NP-intermediate problems NP vs. co-np L, NL 2 Recap Last time, we

More information

Complexity Theory Part II

Complexity Theory Part II Complexity Theory Part II Time Complexity The time complexity of a TM M is a function denoting the worst-case number of steps M takes on any input of length n. By convention, n denotes the length of the

More information

CS154, Lecture 13: P vs NP

CS154, Lecture 13: P vs NP CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of

More information

Lecture 14 - P v.s. NP 1

Lecture 14 - P v.s. NP 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 27, 2018 Lecture 14 - P v.s. NP 1 In this lecture we start Unit 3 on NP-hardness and approximation

More information

Advanced Topics in Theoretical Computer Science

Advanced Topics in Theoretical Computer Science Advanced Topics in Theoretical Computer Science Part 5: Complexity (Part II) 30.01.2014 Viorica Sofronie-Stokkermans Universität Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1 Contents Recall: Turing

More information

Introduction to Complexity Theory

Introduction to Complexity Theory Introduction to Complexity Theory Read K & S Chapter 6. Most computational problems you will face your life are solvable (decidable). We have yet to address whether a problem is easy or hard. Complexity

More information

Apropos of an errata in ÜB 10 exercise 3

Apropos of an errata in ÜB 10 exercise 3 Apropos of an errata in ÜB 10 exercise 3 Komplexität von Algorithmen SS13 The last exercise of the last exercise sheet was incorrectly formulated and could not be properly solved. Since no one spotted

More information

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

Friday Four Square! Today at 4:15PM, Outside Gates P and NP Friday Four Square! Today at 4:15PM, Outside Gates Recap from Last Time Regular Languages DCFLs CFLs Efficiently Decidable Languages R Undecidable Languages Time Complexity A step of a Turing

More information

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3 6.841/18.405J: Advanced Complexity Wednesday, February 12, 2003 Lecture Lecture 3 Instructor: Madhu Sudan Scribe: Bobby Kleinberg 1 The language MinDNF At the end of the last lecture, we introduced the

More information

Computational Tasks and Models

Computational Tasks and Models 1 Computational Tasks and Models Overview: We assume that the reader is familiar with computing devices but may associate the notion of computation with specific incarnations of it. Our first goal is to

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3 U.C. Berkeley CS278: Computational Complexity Handout N3 Professor Luca Trevisan 9/6/2004 Notes for Lecture 3 Revised 10/6/04 1 Space-Bounded Complexity Classes A machine solves a problem using space s(

More information

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity) CS5371 Theory of Computation Lecture 23: Complexity VIII (Space Complexity) Objectives Introduce Space Complexity Savitch s Theorem The class PSPACE Space Complexity Definition [for DTM]: Let M be a DTM

More information

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

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete) CS5371 Theory of Computation Lecture 19: Complexity IV (More on NP, NP-Complete) Objectives More discussion on the class NP Cook-Levin Theorem The Class NP revisited Recall that NP is the class of language

More information

Computational Complexity: A Modern Approach. Draft of a book: Dated January 2007 Comments welcome!

Computational Complexity: A Modern Approach. Draft of a book: Dated January 2007 Comments welcome! i Computational Complexity: A Modern Approach Draft of a book: Dated January 2007 Comments welcome! Sanjeev Arora and Boaz Barak Princeton University complexitybook@gmail.com Not to be reproduced or distributed

More information

conp, Oracles, Space Complexity

conp, Oracles, Space Complexity conp, Oracles, Space Complexity 1 What s next? A few possibilities CS161 Design and Analysis of Algorithms CS254 Complexity Theory (next year) CS354 Topics in Circuit Complexity For your favorite course

More information

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

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine. The Class NP NP is the problems that can be solved in polynomial time by a nondeterministic machine. NP The time taken by nondeterministic TM is the length of the longest branch. The collection of all

More information

Lecture 3: Reductions and Completeness

Lecture 3: Reductions and Completeness CS 710: Complexity Theory 9/13/2011 Lecture 3: Reductions and Completeness Instructor: Dieter van Melkebeek Scribe: Brian Nixon Last lecture we introduced the notion of a universal Turing machine for deterministic

More information

Time Complexity. CS60001: Foundations of Computing Science

Time Complexity. CS60001: Foundations of Computing Science Time Complexity CS60001: Foundations of Computing Science Professor, Dept. of Computer Sc. & Engg., Measuring Complexity Definition Let M be a deterministic Turing machine that halts on all inputs. The

More information

Definition: conp = { L L NP } What does a conp computation look like?

Definition: conp = { L L NP } What does a conp computation look like? Space Complexity 28 Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string y of x k length and the machine accepts

More information

Introduction to Computer Science and Programming for Astronomers

Introduction to Computer Science and Programming for Astronomers Introduction to Computer Science and Programming for Astronomers Lecture 8. István Szapudi Institute for Astronomy University of Hawaii March 7, 2018 Outline Reminder 1 Reminder 2 3 4 Reminder We have

More information

Space and Nondeterminism

Space and Nondeterminism CS 221 Computational Complexity, Lecture 5 Feb 6, 2018 Space and Nondeterminism Instructor: Madhu Sudan 1 Scribe: Yong Wook Kwon Topic Overview Today we ll talk about space and non-determinism. For some

More information

Beyond NP [HMU06,Chp.11a] Tautology Problem NP-Hardness and co-np Historical Comments Optimization Problems More Complexity Classes

Beyond NP [HMU06,Chp.11a] Tautology Problem NP-Hardness and co-np Historical Comments Optimization Problems More Complexity Classes Beyond NP [HMU06,Chp.11a] Tautology Problem NP-Hardness and co-np Historical Comments Optimization Problems More Complexity Classes 1 Tautology Problem & NP-Hardness & co-np 2 NP-Hardness Another essential

More information

Space Complexity. The space complexity of a program is how much memory it uses.

Space Complexity. The space complexity of a program is how much memory it uses. Space Complexity The space complexity of a program is how much memory it uses. Measuring Space When we compute the space used by a TM, we do not count the input (think of input as readonly). We say that

More information

NP-Completeness. Algorithmique Fall semester 2011/12

NP-Completeness. Algorithmique Fall semester 2011/12 NP-Completeness Algorithmique Fall semester 2011/12 1 What is an Algorithm? We haven t really answered this question in this course. Informally, an algorithm is a step-by-step procedure for computing a

More information

Lecture 4: NP and computational intractability

Lecture 4: NP and computational intractability Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples

More information

CSCI3390-Lecture 14: The class NP

CSCI3390-Lecture 14: The class NP CSCI3390-Lecture 14: The class NP 1 Problems and Witnesses All of the decision problems described below have the form: Is there a solution to X? where X is the given problem instance. If the instance is

More information

Notes for Lecture 21

Notes for Lecture 21 U.C. Berkeley CS170: Intro to CS Theory Handout N21 Professor Luca Trevisan November 20, 2001 Notes for Lecture 21 1 Tractable and Intractable Problems So far, almost all of the problems that we have studied

More information

Computational Complexity Theory

Computational Complexity Theory Computational Complexity Theory Marcus Hutter Canberra, ACT, 0200, Australia http://www.hutter1.net/ Assumed Background Preliminaries Turing Machine (TM) Deterministic Turing Machine (DTM) NonDeterministic

More information

15-855: Intensive Intro to Complexity Theory Spring Lecture 7: The Permanent, Toda s Theorem, XXX

15-855: Intensive Intro to Complexity Theory Spring Lecture 7: The Permanent, Toda s Theorem, XXX 15-855: Intensive Intro to Complexity Theory Spring 2009 Lecture 7: The Permanent, Toda s Theorem, XXX 1 #P and Permanent Recall the class of counting problems, #P, introduced last lecture. It was introduced

More information

Computational Complexity

Computational Complexity CS311 Computational Structures Computational Complexity Lecture 16 Andrew P. Black Andrew Tolmach 1 So, itʼs computable! But at what cost? Some things that are computable in principle are in practice intractable

More information

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar Turing Machine A Turing machine is an abstract representation of a computing device. It consists of a read/write

More information