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.

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 
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
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)
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
Turing’s Thesis Fall 2006 Costas Busch - RPI.
Computability and Complexity 19-1 Computability and Complexity Andrei Bulatov Non-Deterministic Space.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
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.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
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.
Chapter 11: Limitations of Algorithmic Power
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.
Fall 2004COMP 3351 Turing’s Thesis. Fall 2004COMP 3352 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine.
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.
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.
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.
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.
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.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
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
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:

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

Fall 2004COMP 3352 Example: Algorithm to accept a string : Use a two-tape Turing machine Copy the on the second tape Compare the and

Fall 2004COMP 3353 Copy the on the second tape Compare the and Time needed: Total time:

Fall 2004COMP 3354 For string of length time needed for acceptance:

Fall 2004COMP 3355 Language class: A Deterministic Turing Machine accepts each string of length in time

Fall 2004COMP 3356

Fall 2004COMP 3357 In a similar way we define the class for any time function: Examples:

Fall 2004COMP 3358 Example: The membership problem for context free languages (CYK - algorithm) Polynomial time

Fall 2004COMP 3359 Theorem:

Fall 2004COMP Polynomial time algorithms: Represent tractable algorithms: For small we can compute the result fast

Fall 2004COMP for all The class All tractable problems Polynomial time

Fall 2004COMP CYK-algorithm

Fall 2004COMP Exponential time algorithms: Represent intractable algorithms: Some problem instances may take centuries to solve

Fall 2004COMP Example: the Hamiltonian Problem Question: is there a Hamiltonian path from s to t? s t

Fall 2004COMP s t YES!

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

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

Fall 2004COMP Satisfiable: Example:

Fall 2004COMP Not satisfiable Example:

Fall 2004COMP For variables: Algorithm: search exhaustively all the possible binary values of the variables exponential

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

Fall 2004COMP 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

Fall 2004COMP 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

Fall 2004COMP 33524

Fall 2004COMP In a similar way we define the class for any time function: Examples:

Fall 2004COMP Non-Deterministic Polynomial time algorithms:

Fall 2004COMP for all The class Non-Deterministic Polynomial time

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

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

Fall 2004COMP The satisfiability problem is an - Problem

Fall 2004COMP Observation: Deterministic Polynomial Non-Deterministic Polynomial

Fall 2004COMP Open Problem: WE DO NOT KNOW THE ANSWER

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