Could we potentially place A in a smaller complexity class if we consider other computational models?

Similar documents
Complexity Theory 112. Space Complexity

Time Complexity. CS60001: Foundations of Computing Science

Lecture 21: Space Complexity (The Final Exam Frontier?)

Chapter 7: Time Complexity

Computational Complexity

Computability and Complexity CISC462, Fall 2018, Space complexity 1

CS154, Lecture 17: conp, Oracles again, Space Complexity

CSE 105 THEORY OF COMPUTATION

CISC 4090 Theory of Computation

Lecture 16: Time Complexity and P vs NP

CSE 105 THEORY OF COMPUTATION

Review of Basic Computational Complexity

CSCI 1590 Intro to Computational Complexity

Theory of Computation Time Complexity

Definition: conp = { L L NP } What does a conp computation look like?

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

conp, Oracles, Space Complexity

Time Complexity. Definition. Let t : n n be a function. NTIME(t(n)) = {L L is a language decidable by a O(t(n)) deterministic TM}

COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

CSCI 1590 Intro to Computational Complexity

Computational complexity

Computability Theory

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

Computational Models Lecture 11, Spring 2009

CS154, Lecture 13: P vs NP

The space complexity of a standard Turing machine. The space complexity of a nondeterministic Turing machine

CS154, Lecture 13: P vs NP

CSE 105 THEORY OF COMPUTATION

Lecture 19: Finish NP-Completeness, conp and Friends

Finish K-Complexity, Start Time Complexity

CSE 105 Theory of Computation

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.

TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20

The Polynomial Hierarchy

CS151 Complexity Theory. Lecture 1 April 3, 2017

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) Spring l. Blum TIME COMPLEXITY AND POLYNOMIAL TIME;

Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all

CSE 135: Introduction to Theory of Computation NP-completeness

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

CS5371 Theory of Computation. Lecture 24: Complexity IX (PSPACE-complete, L, NL, NL-complete)

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

22c:135 Theory of Computation. Analyzing an Algorithm. Simplifying Conventions. Example computation. How much time does M1 take to decide A?

Space Complexity. Huan Long. Shanghai Jiao Tong University

Space Complexity. The space complexity of a program is how much memory it uses.

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

Lecture 3: Reductions and Completeness

Computability and Complexity

Lecture 18: PCP Theorem and Hardness of Approximation I

Hierarchy theorems. Evgenij Thorstensen V18. Evgenij Thorstensen Hierarchy theorems V18 1 / 18

Lecture 3: Nondeterminism, NP, and NP-completeness

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems

Algorithms & Complexity II Avarikioti Zeta

Space Complexity. Master Informatique. Université Paris 5 René Descartes. Master Info. Complexity Space 1/26

6.045 Final Exam Solutions

Lecture 24: Randomized Complexity, Course Summary

Undirected ST-Connectivity in Log-Space. Omer Reingold. Presented by: Thang N. Dinh CISE, University of Florida, Fall, 2010

Complexity (Pre Lecture)

1 Non-deterministic Turing Machine

Complexity: moving from qualitative to quantitative considerations

Principles of Knowledge Representation and Reasoning

Lecture 22: PSPACE

MTAT Complexity Theory October 13th-14th, Lecture 6

Advanced Topics in Theoretical Computer Science

Complete problems for classes in PH, The Polynomial-Time Hierarchy (PH) oracle is like a subroutine, or function in

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

Resource-Bounded Computation

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

Introduction to Computational Complexity

Turing Machines and Time Complexity

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Time-Space Tradeoffs for SAT

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1

CS151 Complexity Theory. Lecture 4 April 12, 2017

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Chapter 2 : Time complexity

Computer Sciences Department

The Complexity of Optimization Problems

Lecture Notes Each circuit agrees with M on inputs of length equal to its index, i.e. n, x {0, 1} n, C n (x) = M(x).

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12

CSE200: Computability and complexity Space Complexity

P and NP. Or, how to make $1,000,000.

Intro to Theory of Computation

Complexity: Some examples

Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky SOLUTION

Lecture 20: conp and Friends, Oracles in Complexity Theory

Intractable Problems [HMU06,Chp.10a]

CS256 Applied Theory of Computation

Theory of Computation

The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

CSCI 1590 Intro to Computational Complexity

Outline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018

Transcription:

Introduction to Complexity Theory Big O Notation Review Linear function: r(n) =O(n). Polynomial function: r(n) =2 O(1) Exponential function: r(n) =2 no(1) Logarithmic function: r(n) = O(log n) Poly-log function: r(n) =log O(1) n Definition 1 (TIME) Let t : ℵ ℵ. Define the time complexity class, TIME(t(n)) to be TIME(t(n)) = {L DTM M which decides L in time O(t(n))}. Definition 2 (NTIME) Let t : ℵ ℵ. Define the time complexity class, NTIME(t(n)) to be NTIME(t(n)) = {L NDTM M which decides L in time O(t(n))}. Example 1 Consider the language A = {0 k 1 k k 0}. Is A TIME(n 2 )? Is A TIME(n log n)? Is A TIME(n)? Could we potentially place A in a smaller complexity class if we consider other computational models? Theorem 1 If t(n) n, then every t(n) time multitape Turing machine has an equivalent O(t 2 (n)) time single-tape turing machine. see Theorem 7.8 in Sipser (pg. 232) Theorem 2 If t(n) n, then every t(n) time RAM machine has an equivalent O(t 3 (n)) time multi-tape turing machine. optional exercise Conclusion: Linear time is model specific; polynomical time is model indepedent. Definition 3 (The Class P ) P = k TIME(n k ) Definition 4 (The Class NP)

NP = k NTIME(n k ) Equivalent Definition of NP NP = {L L has a polynomial time verifier }. A polynomial time verifier for a language A is an algorithm, V,whereA = {w V acepts <w,c> for some string c}. Example 2 Let RELP RIME = {< x,y > gcd(x, y) = 1}. Is RELP RIME NP? Is RELP RIME P? Example 3 PATH = {<G,s,t > G has a directed path from s to t}. IsPATH P? Construct a deterministic polynomial time Turing machine, M, that decides P AT H. M = On Input <G,s,t > where G is a directed graph with nodes s and t. 1. Place a mark on node s. 2. While there exists an unmarked node do 3. Search for all edges (a, b) wherea is marked and b unmarked, and mark such b. 4. If t is marked, accept; otherwise, reject. To show an algorithm runs in polynomial, one must show that each step is executed only a polynomial number of steps as well as each steps executes in polynomial time. Example 4 SAT = {< φ> φ is a satisfiable boolean formula }. IsSAT NP? Construct a nondeterministic polynomial time Turing machine, M, as follows: M = On Input <φ>: 1. Nondeterministically select an assignment of the variables, x. 2. Teset where x satisfies φ. 3. If thest test passes, accept; otherwise, reject. Example 5 VALUE = {< φ,x > φ(x) where φ is a boolean formula and x an assignment of variables }. IsVALUE P? Example 6 RATIONALROOT = {< p> q Q such that p(q) =0where p(x) =a 0 + a 1 x +...+ a k x k is a polynomial of degree k where i =1...k, a i ℵ. Is RATIONALROOT P? Construct a nondeterministic polynomial time Turing machine, M, for RATIONALROOT: M = On Input <p>where p(x) =a 0 + a 1 x +...+ a k x k, a i ℵ.

1. Nondeterministically select q Q. 2. Evaluate p(q). 3. If p(q) = 0, accept; otherwise, reject. Does this run in polynomial time? Cearly, to evaulate p(q) is polynomial in the length of q since multipication can be computed in polynomial time. How big is q though? From the Rational Root Theorem in algebra, any rational root, x, ofp(x) =0isoftheformx = s t where s a 0 and t a k. Since a 0 =log(a 0 ) <nand a k =log(a k ) <n, q = O(n). Thus, step 1 and 2 can be computed in polynomial steps. Example 7 Let SUBSETSUM = {< S,t> {y 1,y 2,...,y n } = Y S = {s 1,s 2,...,s n } such that i y i = t} Construct a nondeterministic polynomial time Turing machine, M, as follows: M = On Input <S,t>: 1. Nondeterministically select a subset c of the numbers in S. 2. Test whether c is a collection of numbers that sum to t. 3. If thest test passes, accept; otherwise, reject. Theorem 3 P NP A O(t(n)) DTM has an equivalent O(t(n)) NDTM. Definition 5 (The Class EXPTIME) EXPTIME = k TIME(2 nk ) Definition 6 (The Class NEXPTIME) NEXPTIME = k NTIME(2 nk ) Relations: P NP EXPTIME NEXPTIME Definition 7 (Space Complexity Classes) SPACE(t(n)) = {L DTM M which decides L in space O(t(n))}. NSPACE(t(n)) = {L NDTM M which decides L in space O(t(n))}. PSPACE = k SPACE(n k ) NPSPACE = k NSPACE(n k )

Definition 8 (Logarithmic Space Classes) L = SPACE(log n) NL = NSPACE(log n) How can our definition of a turing machine use only logarithmic space since the input tape uses linear space? We introduce a new turing machine with two tapes: a read-only input tape and a read/write tape. Example 8 PATH NL Relations between time and space: Theorem 4 TIME(f(n)) SPACE(f(n)) A deterministic turing machine that decides membership in O(f(n)) steps can use at most O(f(n)) space since one TM step requires can only write to one memory cell. Theorem 5 If f(n) log(n), SPACE(f(n)) TIME(k f(n) ) Define a configuration as a snap shot of a turing machine including the position of the heads, the state of the control unit, and the contents of all cells on tape. If our turing machine is restricted to O(f(n)) space, the work tape head can be in only O(f(n)) locations and the input tape head canbeinonlyo(n). The control unit can be in any of c positions were c is a constant representing the number of states in the fsm. If we have k characters that can be written to a cell, then there are O(k f(n) ) possibilities for the content of the tape. Thus, there are O(cnf(n) k f(n) )=O(k f(n) ) configurations. If the turing machine is to halt, there will be no duplicate configuration and thus it must run in O(k f(n) ). Corollary 1 L P Corollary 2 P PSPACE Corollary 3 PSPACE EXPTIME Complements of complexity classes Definition 9 (coc) The complement of a complexity class of decision problems C, denoted coc, is the set of decision problems that are complemnt of decision problems of C. Example 9 cosat = {< φ> φ is NOT a satisfiable boolean formula }. Is cosat NP? Is cosat EXPTIME? IscoSAT PSPACE? Theorem 6 If C is a deterministic time or space complexity class, then C=coC.

Deterministic turing machines are closed under complementation. Is NP = conp? Theorem 7 NP conp {} Let PRIMALITY = {< n> n is prime}. WeshowPRIMALITY NP conp. not quite done. Lemma 1 An integer p>2 is prime iff there is an integer 1 <r<psuch that r p 1 1(modp) and q such that q p 1, r p 1 q 1(modp). not quite done