1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.

Slides:



Advertisements
Similar presentations
Fall 2006Costas Busch - RPI1 Time Complexity. Fall 2006Costas Busch - RPI2 Consider a deterministic Turing Machine which decides a language.
Advertisements

Complexity Classes: P and NP
Time Complexity P vs NP.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-Completeness Lecture for CS 302. Traveling Salesperson Problem You have to visit n cities You want to make the shortest trip How could you do this?
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
The diagonalization method The halting problem is undecidable Decidability.
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
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)
Computability and Complexity 19-1 Computability and Complexity Andrei Bulatov Non-Deterministic Space.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
Linear Bounded Automata LBAs
CS 310 – Fall 2006 Pacific University CS310 P vs NP the steel cage death match Section 7.2 November 29, 2006.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Chapter 11: Limitations of Algorithmic Power
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Complexity theory and combinatorial optimization Class #2 – 17 th of March …. where we deal with decision problems, finite automata, Turing machines pink.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSCI 2670 Introduction to Theory of Computing December 1, 2004.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
CS 3813: Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
Costas Busch - LSU1 Time Complexity. Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
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.
NP-Completeness A problem is NP-complete if: It is in NP
Chapter 10 NP-Complete Problems.
Time Complexity Costas Busch - LSU.
Linear Bounded Automata LBAs
Other Models of Computation
CSE322 The Chomsky Hierarchy
How Hard Can It Be?.
Intro to Theory of Computation
Computational Complexity
Time Complexity We use a multitape Turing machine
Decidable Problems of Regular Languages
Section 14.3 Complexity Classes
CLASSES P AND NP.
CS21 Decidability and Tractability
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Our old list of problems
The Chomsky Hierarchy Costas Busch - LSU.
Presentation transcript:

1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation

2 Example: Algorithm to accept a string : Use a two-tape Turing machine Copy the on the second tape Compare the and

3 Copy the on the second tape Compare the and Time needed: Total time:

4 For string of length time needed for acceptance:

5 Language class: A Deterministic Turing Machine accepts each string of length in time

6

7 In a similar way we define the class for any time function: Examples:

8 Example: The membership problem for context free languages (CYK - algorithm) Polynomial time

9 Theorem:

10 Polynomial time algorithms: Represent tractable algorithms: For small we can compute the result fast

11 for all The class All tractable problems Polynomial time

12 CYK-algorithm

13 Exponential time algorithms: Represent intractable algorithms: Some problem instances may take centuries to solve

14 Example: the Hamiltonian Problem Question: is there a Hamiltonian path from s to t? s t

15 s t YES!

16 Exponential time Intractable problem A solution: search exhaustively all paths L = { : there is a Hamiltonian path in G from s to t}

17 Example: The Satisfiability Problem Boolean expressions in Conjunctive Normal Form: Variables Question: is expression satisfiable?

18 Satisfiable: Example:

19 Not satisfiable Example:

20 For variables: Algorithm: search exhaustively all the possible binary values of the variables exponential

21 Non-Determinism Language class: A Non-Deterministic Turing Machine accepts each string of length in time

22 Example: Non-Deterministic Algorithm to accept a string : Use a two-tape Turing machine Guess the middle of the string and copy on the second tape Compare the two tapes

23 Time needed: Total time: Use a two-tape Turing machine Guess the middle of the string and copy on the second tape Compare the two tapes

24

25 In a similar way we define the class for any time function: Examples:

26 Non-Deterministic Polynomial time algorithms:

27 for all The class Non-Deterministic Polynomial time

28 Example: The satisfiability problem Non-Deterministic algorithm: Guess an assignment of the variables Check if this is a satisfying assignment

29 Time for variables: Total time: Guess an assignment of the variables Check if this is a satisfying assignment

30 The satisfiability problem is an - Problem

31 Observation: Deterministic Polynomial Non-Deterministic Polynomial

32 Open Problem: WE DO NOT KNOW THE ANSWER

33 Example: Does the Satisfiability problem have a polynomial time deterministic algorithm? WE DO NOT KNOW THE ANSWER Open Problem: