INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.

Slides:



Advertisements
Similar presentations
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Advertisements

Time Complexity P vs NP.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
Lecture 21 NP-complete problems
Complexity class NP Is the class of languages that can be verified by a polynomial-time algorithm. L = { x in {0,1}* | there exists a certificate y with.
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The diagonalization method The halting problem is undecidable Decidability.
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
P and NP Sipser (pages ). CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)
NP-completeness Sipser 7.4 (pages 271 – 283). CS 311 Mount Holyoke College 2 The classes P and NP NP = ∪ k NTIME(n k ) P = ∪ k TIME(n k )
NP-completeness Sipser 7.4 (pages 271 – 283). CS 311 Fall The classes P and NP NP = ∪ k NTIME(n k ) P = ∪ k TIME(n k )
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
CS 310 – Fall 2006 Pacific University CS310 P vs NP the steel cage death match Section 7.2 November 29, 2006.
Time Complexity.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete Problems Algorithm : Design & Analysis [23]
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
NP-Completeness A problem is NP-complete if: It is in NP
Chapter 10 NP-Complete Problems.
Computational Complexity Theory
CS154, Lecture 13: P vs NP.
Intro to Theory of Computation
CSC 4170 Theory of Computation The class NP Section 7.3.
CS154, Lecture 13: P vs NP.
CSC 4170 Theory of Computation The class NP Section 7.3.
Umans Complexity Theory Lectures
CSE 589 Applied Algorithms Spring 1999
Theory of Computability
Presentation transcript:

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011

TIME COMPLEXITY Definition: Let M be a TM that halts on all inputs. The running time or time-complexity of M is the function f : N  N, where f(n) is the maximum number of steps that M uses on any input of length n. Definition: TIME(t(n)) = { L | L is a language decided by a O(t(n)) time Turing Machine }

P = TIME(n c )  c  ℕ IMPORTANT COMPLEXITY CLASS P is the class of problems that can be solved in polynomial time: they are efficiently decidable

NON-DETERMINISTIC PROGRAMS …are just like standard programs, except: 1. There is a special instruction, guess(), that can return 0 or The program accepts an input if there exists a list of guesses that make it accept. 3. The running time of the program is the maximum number of steps that can be caused by calls to guess().

NP = NTIME(n c )  c  ℕ { L | L is decided by a O(t(n))-time non-deterministic Turing machine } Definition: NTIME(t(n)) =

BOOLEAN FORMULAS (  x  y)  z  = logical operations variables parentheses A satisfying assignment is a setting of the variables that makes the formula true x = 1, y = 1, z = 1 is a satisfying assignment for   (x  y)  (z   x) 0010 A Boolean formula is satisfiable if there exists a satisfying assignment for it SAT = {  |  is a satisfiable Boolean formula }

A 3cnf-formula is of the form: (x 1   x 2  x 3 )  (x 4  x 2  x 5 )  (x 3   x 2   x 1 ) clauses (x 1  x̅ 2  x 1 ) (x 3  x 1 )  (x 3  x̅ 2  x̅ 1 ) (x 1  x 2  x 3 )  (x̅ 4  x 2  x 1 )  (x 3  x 1  x̅ 1 ) (x 1  x̅ 2  x 3 )  (x 3  x̅ 2  x̅ 1 ) YES NO 3SAT = {  |  is a satisfiable 3cnf-formula }

Theorem: 3SAT  NP 3SAT = {  |  is a satisfiable 3cnf-formula } 1. Check if the formula is in 3cnf On input  : 2. For each variable x i : 3. Test if the assignment satisfies  a. Set temp = guess(). b. Scan across , replacing x i with temp. Total running time = O(mn)

Theorem: L  NP if and only if there exists a poly-time Turing machine V (for “Verifier”) with L = { x |  y |y| = poly(|x|) and V(x,y) accepts } Proof: (1) If L = { x |  y |y| = poly(|x|) and V(x,y) accepts } then L  NP Because we can guess() y and then run V(x,y) (2) If L  NP then L = { x |  y |y| = poly(|x|) and V(x,y) accepts } Let N be a non-deterministic poly-time TM that decides L and define V(x,y) to accept if y is an accepting computation history of N on x

3SAT = {  |  y such that y is a satisfying assignment to  and  is in 3cnf } SAT = {  |  y such that y is a satisfying assignment to  } V( ,y) = “Accept if  is in 3cnf and  (y) is true” V( ,y) = “Accept if  is a formula and  (y) is true”

A language is in NP if and only if there exist polynomial-length certificates for membership to the language SAT is in NP because a satisfying assignment is a polynomial-length certificate that a formula is satisfiable

HAMILTONIAN PATHS b a e c d f h i g

HAMPATH = { 〈 G,s,t 〉 | G is a directed graph with a Hamiltonian path from s to t } Theorem: HAMPATH  NP The Hamiltonian path itself is a certificate

K- CLIQUES b a e c d f g

CLIQUE = { 〈 G,k 〉 | G is an undirected graph with a k-clique } Theorem: CLIQUE  NP The k-clique itself is a certificate

SEARCHING FOR… A search problem is one where the “answer” is more than a single bit, for example: if 〈 B,G 〉 is a “stable marriage” problem, the “answer” is a stable matching between every boy and some girl. If 〈 C 〉 is a CIRCUIT-SAT problem, the “answer” is an input that makes the circuit output 1. We can think of these problems as “finding a right answer.”

NP = { search problems where it is easy to check if an answer is right. }

EXAMPLES FACTOR = { 〈 N,k 〉 | N has a prime factor ≥ k }. SUBSET-SUM = { 〈 y 1,…y n, t 〉 | there exist bits b 1 …b n so that Σ i b i y i = t }. FUSION = { 〈 SIM,1 k 〉 | SIM is a program that simulates nuclear fusion reactor designs and has an input of length at most k where energy output > energy input }

P = NP? $$$

P VS NP RecognitionvsGeneration Checking if a song sounds like Mozart Composing a song that sounds like Mozart Checking if a proof is correctFinding a correct proof Checking if a fusion generator is efficient Finding an efficient fusion generator Verifying that p q = NFinding prime factors of N Appreciating funny jokesWriting funny jokes If P=NP, especially by a fast algorithm, then the tasks on left and right are all equally difficult!

If P = NP… Cryptography as we know it would not be possible Mathematicians would be out of a job We could determine if cold fusion is possible We could determine if faster-than-light travel is possible.

If P = NP… We could find optimal circuits for any task: EQC = { 〈 C 1,C 2 〉 | ∀ x. C 1 (x) = C 2 (x) } ∈ coNP MIN-CIRCUIT = { 〈 C 〉 | ∀ C’, |C’|≤|C| or (C,C’)  EQC} If P=NP, then EQC ∈ P, so MIN-CIRCUIT ∈ coNP = P.

If P = NP… Writing symphonies is as easy as listening to them. Being a chef is as easy as eating. Writing Shakespeare is as easy as recognizing Shakespeare. Generation is as easy as recognition: In 40+ years, no one has found a proof that P  NP.

POLY-TIME REDUCIBILITY A language A is polynomial time reducible to language B, written A  P B, if there is a polynomial time computable function ƒ : Σ*  Σ*, where for every w, w  A  ƒ(w)  B ƒ is called a polynomial time reduction of A to B

AB ƒ ƒ ∀ w. w  A  ƒ(w)  B

Theorem. If A ≤ P B and B ∈ P, then A ∈ P. (so if A ≤ P B and A  P, then B  P.) Proof. B  P ⇒ TIME COMPLEXITY = O(|w| ab ) |s| b -time program test_b(s) to decide B A ≤ P B ⇒ test_a(w): s = map(w) return test_b(s) |w| a -time function map s.t. map(w)  B iff w  A.

Definition: A language B is NP-complete if: 1. B  NP 2. Every A in NP is poly-time reducible to B (i.e. B is NP-hard) HARDEST PROBLEMS IN NP

B is NP-Complete P NP B

Theorem. If B is NP-Complete, C ∈ NP, and B ≤ P C, then C is NP-Complete. P NP B C

Theorem. If B is NP-Complete and B ∈ P, then P=NP. Corollary. If B is NP-Complete, and P  NP, there is no fast algorithm for B.