1 / 25

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

CSci 4011. INHERENT LIMITATIONS OF COMPUTER PROGRAMS. 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.

etoile
Download Presentation

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS

  2. TIMECOMPLEXITY 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 }

  3.  P = TIME(nc) NP = NTIME(nc) c  N c  N IMPORTANTCOMPLEXITY CLASSES L ∈P iff there is an nc-time TM that decides L. L ∈NP iff there is an nc-time NTM that decides L iff there is an nc-time “verifier” for L Problems in P can be efficiently solved. Problems in NP can be efficiently verified.

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

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

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

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

  8. HARDEST PROBLEMS IN NP 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)

  9. NP P B B is NP-Complete

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

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

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

  13. BPCP = {〈P, n〉 | P is a PCP instance with a match of length at most n. } Theorem. BPCP is NP-Complete. 1. BPCP  NP. The PCP match of length at most n is the proof that 〈P, n〉 BPCP.

  14. BPCP = { 〈P, n〉 | P is a PCP instance with a match of length at most n. } Theorem. BPCP is NP-Complete. 2. BANTM≤P BPCP. We know how to make a PCP instance P so that a match corresponds to an accepting NTM computation on w. If M accepts in t steps, the match has length s = 3t(t+1)/2. Let ƒPCP denote the mapping from 〈M,w〉 to P. Our reduction is thus ƒ(M,w,t) = 〈ƒPCP(M,w),s〉

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

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

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

  18. ∧ ∧ A CIRCUIT x1 … is a collection of (boolean) gatesand inputs connected by wires. x2 x0 : … 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 }

  19. Theorem. CIRCUIT-SAT is NP-Complete. Proof. 1. CIRCUIT-SAT ∈NP. 2. EADTM≤PCIRCUIT-SAT. Recall that the language EADTM= { 〈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 EADTM≤PC-SAT.

  20. 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 2k clauses: (x0 ⋁¬x1)∧(¬x0⋁x1) ⇔ Why doesn’t this prove the theorem?

  21. 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 ith row represents the configuration of M after i steps: a “tableau” t t

  22. q0 q0 qa q1 q0 qa q0 qa q1 q0 q1 qa q1     1 0 0 0 1 1 0 1 ∧ ∧ ⋁ Rows are made up of cells. Each cell has a “light” for every state and every tape symbol. Each light has a circuit that turns it on or off based on the previous row.

  23. q0 qa qa q1 q0 qa q1 qa q1 q0 q0 q1 qa q0 q1      0 1 0 0 1 0 1 1 0 1 ∧ ∧ ⋁ ∧ ⋁ ∧ ∧ ⋁ ∧ ∧ ∧ ⋁ ⋁ ∧ ∧ ⋁ ⋁ ∧ ∧ ⋁ ∧ ⋁ ∙ ∙ ∙ EXAMPLE 1→□, R 1→1, R 0→0, R q1 qa q0 □→□, L 0→□, R

  24. xn-1 … xn x1 x2 x3 qa qa qa qa qa qa q0 qa qa   ⋁ The lights in the first row are connected to the circuit inputs and the tape head is hardwired in: The circuit should output 1 iff M ends in qaccept.

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

More Related