1 / 30

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.

kalani
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) c  ℕ IMPORTANTCOMPLEXITY CLASS P is the class of problems that can be solved in polynomial time: they are efficientlydecidable

  4. NON-DETERMINISTIC PROGRAMS …are just like standard programs, except: 1. There is a special instruction, guess(), that can return 0 or 1. 2. 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().

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

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

  7. clauses A 3cnf-formula is of the form: (x1  x2 x3)  (x4  x2  x5) (x3  x2  x1) YES (x1 x̅2 x1) NO (x3  x1) (x3  x̅2 x̅1) NO (x1  x2  x3)  (x̅4 x2  x1) (x3  x1  x̅1) NO (x1  x̅2 x3) (x3  x̅2 x̅1) 3SAT = {  |  is a satisfiable 3cnf-formula }

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

  9. 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: • If L = { x | y |y| = poly(|x|) and V(x,y) accepts } • then L  NP Because we can guess y and then run V (2) If L  NPthen 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

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

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

  12. e f b a g d i c h HAMILTONIAN PATHS

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

  14. e f b a g d c K-CLIQUES

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

  16. 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.”

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

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

  19. $$$ P = NP? $$$

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

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

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

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

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

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

  26. 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 iff w A. test_a(w): s = map(w) return test_b(s) TIME COMPLEXITY = O(|w|ab)

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

  28. NP P B B is NP-Complete

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

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

More Related