Time Complexity We use a multitape Turing machine

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.
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)
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.
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
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.
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.
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.
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.
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.
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.
1 Recursively Enumerable and Recursive Languages.
Decidability.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
Chapter 10 NP-Complete Problems.
Turing’s Thesis Costas Busch - LSU.
CSC 4170 Theory of Computation The class P Section 7.2.
Time Complexity Costas Busch - LSU.
Linear Bounded Automata LBAs
CSC 4170 Theory of Computation The class P Section 7.2.
CSCI 2670 Introduction to Theory of Computing
Other Models of Computation
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CSE322 The Chomsky Hierarchy
ICS 353: Design and Analysis of Algorithms
How Hard Can It Be?.
Computational Complexity
Space Complexity Costas Busch - LSU.
Deterministic PDAs - DPDAs
Decidable Problems of Regular Languages
CLASSES P AND NP.
Halting Problem.
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
CS154, Lecture 13: P vs NP.
Theory of Computability
CS21 Decidability and Tractability
Time Complexity Classes
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
P, NP and NP-Complete Problems
Our First NP-Complete Problem
NP-Completeness Lecture for CS 302.
P, NP and NP-Complete Problems
Decidability continued….
Applications of Regular Closure
Our old list of problems
Theory of Computability
The Chomsky Hierarchy Costas Busch - LSU.
Presentation transcript:

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

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

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

For string of length time needed for acceptance:

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

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

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

Theorem:

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

The class for all Polynomial time All tractable problems

CYK-algorithm

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

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

s t YES!

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

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

Example: Satisfiable:

Example: Not satisfiable

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

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

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

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

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

Non-Deterministic Polynomial time algorithms:

The class for all Non-Deterministic Polynomial time

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

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

The satisfiability problem is an - Problem

Observation: Deterministic Polynomial Non-Deterministic Polynomial

Open Problem: WE DO NOT KNOW THE ANSWER

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