CSCI 2670 Introduction to Theory of Computing

Slides:



Advertisements
Similar presentations
Measuring Time Complexity
Advertisements

Models of Computation Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 1, Lecture 2.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Measuring Time Complexity Sipser 7.1 (pages )
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)
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 8+9 Time complexity 1 Jan Maluszynski, IDA, 2007
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
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.
CS 310 – Fall 2006 Pacific University CS310 Complexity Section 7.1 November 27, 2006.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
CSCI 2670 Introduction to Theory of Computing November 10, 2005.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
The class P Section 7.2 CSC 4170 Theory of Computation.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
ATM, Halting Problem, P vs. NP Chapter 4, 5 & 7. Russel’s Paradox An Index is a book that lists other books in.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
CSCI 2670 Introduction to Theory of Computing November 17, 2005.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
The Classes L and NL Section 8.4 Giorgi Japaridze Theory of Computability.
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.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
Chapters 11 and 12 Decision Problems and Undecidability.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
CSE 105 theory of computation
Turing’s Thesis Costas Busch - LSU.
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSC 4170 Theory of Computation The class P Section 7.2.
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Computability and Complexity
Decision trees Polynomial-Time
CSC 4170 Theory of Computation The class P Section 7.2.
Polynomial time The Chinese University of Hong Kong Fall 2010
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Complexity 6-1 The Class P Complexity Andrei Bulatov.
Intractable Problems Time-Bounded Turing Machines Classes P and NP
Intro to Theory of Computation
Time Complexity We use a multitape Turing machine
CSCI 2670 Introduction to Theory of Computing
CLASSES P AND NP.
CS154, Lecture 13: P vs NP.
Theory of Computability
Theory of Computability
CS21 Decidability and Tractability
Time Complexity Classes
CSC 4170 Theory of Computation The class NP Section 7.3.
CSCI 2670 Introduction to Theory of Computing
Instructor: Aaron Roth
CSCI 2670 Introduction to Theory of Computing
Instructor: Aaron Roth
Instructor: Aaron Roth
CSE 105 theory of computation
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Theory of Computability
Theory of Computability
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing November 16, 2005

Announcement Homework due next Tuesday (11/22) 7.3 a, 7.4, 7.6 (union only), 7.9, 7.12 1st edition 7.3a, 7.4, 7.6 (union only), 7.10, 7.12 November 16, 2005

Last class Relationship of time complexity for different TM models If a problem can be solved in O(t(n)) time on a multi-tape TM, it can be solved in O(t2(n)) time on a single-tape TM If a problem can be solved in O(t(n)) time on a nondeterministic TM, it can be solved in 2O(t(n)) time on a deterministic TM November 16, 2005

Polynomial vs. exponential time We distinguish between algorithms that have polynomial running time and those that have exponential running time Assume a single tape deterministic TM Polynomial functions – even ones with large exponents – grow less quickly than exponential functions We can only process large data sets with polynomial running time algorithms November 16, 2005

Polynomial equivalence Two algorithms A1 and A2 are polynomially equivalent if we can simulate A2 using A1 with only a polynomial increase in running time November 16, 2005

The class P P is the class of languages that are decidable in polynomial time on a single-tape Turing machine P = k TIME(nk) P “roughly corresponds” to the problems that are realistically solvable on a computer November 16, 2005

Size of input: Important consideration The running time is measured in terms of the size of the input If we increase the input size can that make the problem seem more efficient E.g., if we represent integers in unary instead of binary We consider only reasonable encodings November 16, 2005

A problem in class P Binary tree query Given a binary search tree T and a key k, find the node in T with key(node) = k How do we show this problem is in class P? Write an algorithm and show that the algorithm has running time O(nk) for some k November 16, 2005

Binary search M = “On input <G,k> Let node = root(G) Do while key(node) <> k If key(node) < k If right(node) == NIL return NIL Else node = right(node) If left(node) == NIL node = left(node) Return node November 16, 2005

Execution time Worst case running time? O(|nodes|) Occurs if tree is unbalanced Is this O(n)? Yes … any reasonable encoding will have an entry for each node November 16, 2005

Path problem PATH = {<G,s,t> | G is a directed graph that has a path from s to t>} PATH  P How would we show this? Mark all nodes that can be reached from s If t gets marked, accept If t doesn’t get marked, reject November 16, 2005

Solution to path problem M = “On input <G,s,t>, where G is a digraph with nodes s and t: Place a mark on node s Repeat the following until no additional nodes are marked Scan all edges of G If an edge (a,b) is found where a is marked and b is unmarked, mark b If t is marked accept Else reject” November 16, 2005

Verify solution is in P Is M a decider? Yes How long will it take M to run? Loop takes O(|edges|) to execute each time Loop is executed O(|nodes|) times Total time is O(|edges|x|nodes|) Is this polynomial in the length of the input? This is o(n2) where n = lentgh of input November 16, 2005