INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.

Slides:



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

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
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.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The diagonalization method The halting problem is undecidable Decidability.
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 · L 2 means: For some polynomial time computable map r : 8 x: x 2 L 1 iff.
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 )
CS151 Complexity Theory Lecture 3 April 6, Nondeterminism: introduction A motivating question: Can computers replace mathematicians? L = { (x,
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.
NP-Completeness CS 51 Summer 2008 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AA A A AAA.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Completeness NP-Completeness Graphs 4/17/2017 4:10 AM x x x x x x x
Time Complexity.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
1 The Cook-Levin Theorem Zeph Grunschlag. 2 Announcements Last HW due Thursday Please give feedback about course at oracle.seas.columbia.edu/wces oracle.seas.columbia.edu/wces.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
1 L is in NP means: There is a language L’ in P and a polynomial p so that L 1 ≤ L 2 means: For some polynomial time computable map r : x: x L 1 iff r(x)
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
חישוביות וסיבוכיות 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.
Fall 2013 CMU CS Computational Complexity Lecture 3 and 4 Non-determinism, NTIME hierarchy threorem, Ladner’s Proof 9/17/2013.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
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.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
NP-completeness Section 7.4 Giorgi Japaridze Theory of Computability.
Computability & Complexity II Chris Umans Caltech.
1 How to establish NP-hardness Lemma: If L 1 is NP-hard and L 1 ≤ L 2 then L 2 is NP-hard.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C.
Theory of Computational Complexity Yuji Ishikawa Avis lab. M1.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
1 SAT SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?
1 Design and Analysis of Algorithms Yoram Moses Lecture 13 June 17, 2010
 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
CS154, Lecture 13: P vs NP.
CSC 4170 Theory of Computation The class NP Section 7.3.
CS154, Lecture 13: P vs NP.
CS21 Decidability and Tractability
Umans Complexity Theory Lectures
Our First NP-Complete Problem
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  N IMPORTANT COMPLEXITY CLASSES Problems in P can be efficiently solved. Problems in NP can be efficiently verified. NP = NTIME(n c )  c  N L ∈ P iff there is an n c -time TM that decides L. L ∈ NP iff there is an n c -time NTM that decides L iff there is an n c -time “verifier” for L

NP = { } Languages that have “nifty proofs” (certificates) of membership. 3SAT = { ϕ | ∃ y so that ϕ (y)=1 and ϕ is in 3cnf } certificate: the satisfying assignment y HAMPATH = { 〈 G,s,t 〉 | G has a hamiltonian path from s to t} certificate: the hamiltonian path CLIQUE= { 〈 G,k 〉 | G has a clique of size k} certificate: the clique (set of k nodes) FACTOR = { 〈 N,k 〉 | N has a prime factor ≥ k} certificate: the factor p ≥ k

If P = NP… Recognition is the same as Generation. We could design optimal: cars, airplanes, fusion generators, circuits, medicines… Cryptography as we know it is impossible. In 40+ years, no one has found a proof that P  NP. Mathematicians are out of a job.

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

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 ⇒ def 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.

Let BA NTM = { 〈 M,x,t 〉 | M is an NTM that accepts x in at most t steps} Theorem. BA NTM is NP-Complete. 1. BA NTM  NP: The list of guesses M makes to accept x in t steps is the proof that 〈 M,x,t 〉  BA NTM. 2. For all A  NP, A ≤ P BA NTM. A  NP iff there is an NTM for A that runs in time O(n c ). Let ƒ A (w) = 〈 N,w,|w| c 〉. 〈 N,w,|w| c 〉  BA NTM iff N accepts w, iff w  A. Hyper-technical detail: we let n denote 1 n.

Let C DTM = { 〈 M,x,t 〉 | ∃ y, |y| ≤ t and M(x,y) accepts in at most t steps} Theorem. C DTM is NP-Complete. 1. C DTM ∈ NP: The string y proves 〈 M,x,t 〉 ∈ C DTM.

Let C DTM = { 〈 M,x,t 〉 | ∃ y, |y| ≤ t and M(x,y) accepts in at most t steps} Theorem. C DTM is NP-Complete. 2. For all A ∈ NP, A ≤ P C DTM. A ∈ NP ⇒ There is a n a -time TM V A and c where A = { x | ∃ y. |y| ≤ |x| c and V A (x,y) accepts } Define ƒ A (w) = 〈 V, w, t 〉, where t=(|w| c + |w|) a

Let EA DTM = { 〈 M,n,t 〉  | ∃ y ∈ {0,1} n : M accepts y in at most t steps} Theorem. EA DTM is NP-Complete. 2. C DTM ≤ P EA DTM. Define ƒ(M,x,t) = 〈 M x, t, t 〉, where M x (y) = “run M(x,y).” 1. EA DTM ∈ NP: The string y proves 〈 M,n,t 〉  EA DTM.

A CIRCUIT … is a collection of (boolean) gates and inputs connected by wires. ⋁ ∧ ¬ ∧ x0x0 x1x1 x2x2 … is satisfiable if some setting of inputs makes it output 1. … has arbitrary fan-in and fan-out CIRCUIT-SAT = { 〈 C 〉 | C is a satisfiable circuit } ∧

Theorem. CIRCUIT-SAT is NP-Complete. Proof. 1. CIRCUIT-SAT ∈ NP. 2. EA DTM ≤ P CIRCUIT-SAT. Recall that the language EA DTM = { 〈 M, n, t 〉 | M is a TM and ∃ y  {0,1} n such that M accepts y in ≤ t steps.} is NP-Complete. We prove EA DTM ≤ P C-SAT.

WARMUP Given 〈 M,t 〉, there is a function C : {0,1} t → {0,1} such that C(x) = 1 iff M(x) accepts in t steps. Any boolean function in k variables can be written as a CNF with at most 2 k clauses: x0x0 x1x1 F ⇔ (x 0 ⋁ ¬x 1 ) ∧ (¬x 0 ⋁ x 1 ) Why doesn’t this prove the theorem?

Given TM M and time bound t, we create a circuit that takes n input bits and runs up to t steps of M. The circuit will have t “rows”, where the i th row represents the configuration of M after i steps: q00q q11q q10q q01q q00q q11q11 010q1q1 010qaqa t t a “tableau”

q0q0 Rows are made up of cells. Each cell has a “light” for every state and every tape symbol. q1q1 qaqa 01  q0q0 q1q1 qaqa 01  q0q0 q1q1 qaqa 01  q0q0 q1q1 qaqa 01  Each light has a circuit that turns it on or off based on the previous row. q0q0 ∧ ∧ ⋁

q0q0 EXAMPLE q0q0 q1q1 qaqa 0 → 0, R 0 → □, R 1 → 1, R 1 → □, R □ → □, L q1q1 qaqa 01  q0q0 q1q1 qaqa 01  q0q0 q1q1 qaqa 01  q0q0 q1q1 qaqa 01  q0q0 ∧ ∧ ⋁ q1q1 ∧ ∧ ⋁ ∧ ⋁ qaqa 0 ∧ ⋁ ⋁ ∙ ∧ 1 ∧ ⋁ ⋁ ∙ ∧  ∧ ⋁ ⋁ ∙ ∧ ∧ ∧

The lights in the first row are connected to the circuit inputs and the tape head is hardwired in: x1x1 x2x2 x3x3 … x n-1 xnxn q0q0  The circuit should output 1 iff M ends in q accept. qaqa qaqa qaqa qaqa qaqa qaqa qaqa qaqa ⋁

How big is the circuit if M has m states+symbols? O(m 2 t 2 ) How long does it take to build the circuit? O(m 2 t 2 ) When is the circuit satisfiable? Iff there is a n-bit input that makes M accept in at most t steps.