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}

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

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

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

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

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

Resource-Bounded Computation

CS601 DTIME and DSPACE Lecture 5. Time and Space functions: t,s : N N +

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

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

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

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

Computational complexity

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

Review of Basic Computational Complexity

conp, Oracles, Space Complexity

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

Advanced Topics in Theoretical Computer Science

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

Computability and Complexity CISC462, Fall 2018, Space complexity 1

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

Algorithms & Complexity II Avarikioti Zeta

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

Lecture 16: Time Complexity and P vs NP

Lecture 9: Polynomial-Time Hierarchy, Time-Space Tradeoffs

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

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

CSCI 1590 Intro to Computational Complexity

Lecture 5: The Landscape of Complexity Classes

Time-Space Tradeoffs for SAT

CSE 105 THEORY OF COMPUTATION

Theory of Computation

Complexity: moving from qualitative to quantitative considerations

Space is a computation resource. Unlike time it can be reused. Computational Complexity, by Fu Yuxi Space Complexity 1 / 44

Time Complexity. CS60001: Foundations of Computing Science

1 Computational Problems

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

Complexity: Some examples

CSE200: Computability and complexity Space Complexity

Theory of Computation Time Complexity

Chapter 7: Time Complexity

Introduction to Computational Complexity

Notes for Lecture Notes 2

Finish K-Complexity, Start Time Complexity

ECS 120 Lesson 24 The Class N P, N P-complete Problems

Time-bounded computations

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

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Computability and Complexity

The Polynomial Hierarchy

CS151 Complexity Theory. Lecture 1 April 3, 2017

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

Lecture 3: Reductions and Completeness

INAPPROX APPROX PTAS. FPTAS Knapsack P

Computational Complexity CSCI-GA Subhash Khot Transcribed by Patrick Lin

Lecture 9: PSPACE. PSPACE = DSPACE[n O(1) ] = NSPACE[n O(1) ] = ATIME[n O(1) ]

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

Definition: Alternating time and space Game Semantics: State of machine determines who

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

Lecture 22: PSPACE

CSE 105 THEORY OF COMPUTATION

Definition: Alternating time and space Game Semantics: State of machine determines who

Lecture 3: Nondeterminism, NP, and NP-completeness

CSE 105 Theory of Computation

CS154, Lecture 13: P vs NP

Introduction to Complexity Classes. Marcin Sydow

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

NP, polynomial-time mapping reductions, and NP-completeness

Mm7 Intro to distributed computing (jmp) Mm8 Backtracking, 2-player games, genetic algorithms (hps) Mm9 Complex Problems in Network Planning (JMP)

CS154, Lecture 13: P vs NP

Advanced topic: Space complexity

COMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems

Lecture 8. MINDNF = {(φ, k) φ is a CNF expression and DNF expression ψ s.t. ψ k and ψ is equivalent to φ}

Complexity Theory 112. Space Complexity

Complexity (Pre Lecture)

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

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

Computational Complexity Theory

Umans Complexity Theory Lectures

CSE 105 THEORY OF COMPUTATION

Computational Models Lecture 11, Spring 2009

Notes for Lecture 3... x 4

CSE 135: Introduction to Theory of Computation NP-completeness

Notes for Lecture 3... x 4

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

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

Deterministic Time and Space Complexity Measures

Theory of Computation

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

Ταουσάκος Θανάσης Αλγόριθμοι και Πολυπλοκότητα II 7 Φεβρουαρίου 2013

DIMACS Technical Report May Complexity Classes. Eric Allender 1;2. Dept. of Computer Science. Rutgers University

DRAFT. Diagonalization. Chapter 4

Boolean circuits. Lecture Definitions

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

Lecture 8: Alternatation. 1 Alternate Characterizations of the Polynomial Hierarchy

Limits of Feasibility. Example. Complexity Relationships among Models. 1. Complexity Relationships among Models

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

Chapter 2 : Time complexity

Intractable Problems [HMU06,Chp.10a]

Transcription:

Time Complexity Definition Let t : n n be a function. TIME(t(n)) = {L L is a language decidable by a O(t(n)) deterministic TM} NTIME(t(n)) = {L L is a language decidable by a O(t(n)) non-deterministic TM} H. Yen (NTUEE) Theory of Computation Fall 2012 1 / 33

Polynomial Time Definition P = k TIME(n k ) Example {a n b n c n n 0} P Which are in P and Which arent? H. Yen (NTUEE) Theory of Computation Fall 2012 2 / 33

Nondeterministic Polynomial Time Definition NP = k NTIME(n k ) Example the Traveling Salesman Problem (TSP) problem the Integer Linear Programming (ILP) problem Claim: P NP Proof: A deterministic Turing machine is a special case of non-deterministic Turing machines. H. Yen (NTUEE) Theory of Computation Fall 2012 3 / 33

Exponential Time Definition EXPTIME = k TIME(2 nk ) H. Yen (NTUEE) Theory of Computation Fall 2012 4 / 33

Space Complexity Definition Let s : n n be a function. DSPACE(s(n)) = {L L is a language decidable by a O(s(n)) space deterministic TM} NSPACE(s(n)) = {L L is a language decidable by a O(s(n)) space non-deterministic TM} 3-Tape TM H. Yen (NTUEE) Theory of Computation Fall 2012 5 / 33

Logarithmic Space Definition L = DSPACE(log n) NL = NSPACE(log n) H. Yen (NTUEE) Theory of Computation Fall 2012 6 / 33

Polynomial Space Definition PSPACE = k DSPACE(n k ) Example {a n b n c n n 0} PSPACE Claim: P PSPACE Proof: A TM which runs in time t(n) can use at most t(n) space. H. Yen (NTUEE) Theory of Computation Fall 2012 7 / 33

Observation Theorem PSPACE EXPTIME Proof. A machine which uses polynomial space has at most exponential number of configurations (remember? ). As deterministic machine that halts may not repeat a configuration, its running time is bounded by the number of possible configurations. H. Yen (NTUEE) Theory of Computation Fall 2012 8 / 33

Conjectured Relations Among Deterministic Classes H. Yen (NTUEE) Theory of Computation Fall 2012 9 / 33

Two Important Theorems Regarding Space Complexity Theorem (Savitch s Theorem) S(n) log(n), NSPACE(S(n)) SPACE(S(n) 2 ) Theorem (Immerman s Theorem ) S(n) log(n), NSPACE(s(n)) = co NSPACE(s(n)) H. Yen (NTUEE) Theory of Computation Fall 2012 10 / 33

Time and Space Recall: TIME(f (n)), SPACE(s(n)) Questions: how are these classes related to each other? how do we define robust time and space classes? what problems are contained in these classes? complete for these classes? H. Yen (NTUEE) Theory of Computation Fall 2012 11 / 33

Linear Speedup Theorem Suppose TM M decides language L in time f (n). Then for any ɛ > 0, there exists TM M that decides L in time ɛ f (n) + n + 2. Proof Idea: compress input onto fresh tape: H. Yen (NTUEE) Theory of Computation Fall 2012 12 / 33

Linear Speedup (cont d) simulate M, m steps at a time accounting: part 1 (copying): n + 2 steps part 2 (simulation): 6(f (n)/m) set m = 6/ɛ total: ɛ f (n) + n + 2 H. Yen (NTUEE) Theory of Computation Fall 2012 13 / 33

Hierarchy Theorems Does genuinely more time permit us to decide new languages? how can we construct a language L that is not in TIME(f (n)) idea: same as HALT undecidable diagonalization and simulation H. Yen (NTUEE) Theory of Computation Fall 2012 14 / 33

Time Hierarchy Theorem H. Yen (NTUEE) Theory of Computation Fall 2012 15 / 33

Time Hierarchy Theorem Theorem (Time Hierarchy Theorem) For every proper complexity function f (n) n, TIME(f (n)) TIME(f (2n) 3 ). Proper complexity function (also known as (fully) time-constructible function): f (n) f (n 1) for all n there exists a TM M that outputs exactly f (n) symbols on input 1 n, and runs in time O(f (n) + n) and space O(f (n)). includes all reasonable functions we will work with. logn, n, n 2, 2 n, n!,... If f and g are proper then f + g, fg, f (g), f g, 2 g are all proper. can mostly ignore, but be aware it is a genuine concern. Theorem: non-proper f such that TIME(f (n)) = TIME(2 f (n)). H. Yen (NTUEE) Theory of Computation Fall 2012 16 / 33

Proof of Time Hierarchy Theorem SIM is TM deciding language {< M, x >: M accepts x in f ( x ) steps } Claim: SIM runs in time g(n) = f (n) 3. define new TM D: on input < M > if SIM accepts < M, M >, reject if SIM rejects < M, M >, accept. D runs in time g(2n) suppose M in TIME(f (n)) decides L(D) M(< M >) = SIM(< M, M >) D(< M >) but M(< M >) = D(< M >) contradiction. H. Yen (NTUEE) Theory of Computation Fall 2012 17 / 33

Space Hierarchy Theorem Theorem (Time Hierarchy Theorem) For every proper complexity function f (n) log 2 n, DSPACE(f (n)) DSPACE(f (n)log 2 n). H. Yen (NTUEE) Theory of Computation Fall 2012 18 / 33

Robust Time and Space Classes What is meant by robust class? no formal definition reasonable changes to model of computation shouldnt change class should allow modular composition calling subroutine in class (for classes closed under complement... ) Examples: L = DSPACE(logn) PSPACE = k DSPACE(n k ) P = k DTIME(n k ) EXP = k DTIME(2 nk ) H. Yen (NTUEE) Theory of Computation Fall 2012 19 / 33

Relationships between classes How are these four classes related to each other? Time Hierarchy Theorem implies Space Hierarchy Theorem implies L vs. P? PSPACE vs. EXP? P EXP L PSPACE H. Yen (NTUEE) Theory of Computation Fall 2012 20 / 33

Relationships between classes H. Yen (NTUEE) Theory of Computation Fall 2012 21 / 33

Relationships between classes H. Yen (NTUEE) Theory of Computation Fall 2012 22 / 33

Relationships between classes H. Yen (NTUEE) Theory of Computation Fall 2012 23 / 33

Relationships between classes H. Yen (NTUEE) Theory of Computation Fall 2012 24 / 33

Relationships between classes H. Yen (NTUEE) Theory of Computation Fall 2012 25 / 33

A P-complete problem We don t know how to prove L P But, can identify problems in P least likely to be in L using P-completeness. need stronger reduction (why?) logspace reduction: f computable by DTM that uses O(logn) space, denoted gl 1 L L 2 If L 2 is P-complete, then L 2 in L implies L = P H. Yen (NTUEE) Theory of Computation Fall 2012 26 / 33

A P-complete problem Circuit Value (CVAL): given a variable-free Boolean circuit (gates (,,, 0, 1), does it output 1? Theorem CVAL is P-complete. H. Yen (NTUEE) Theory of Computation Fall 2012 27 / 33

CVAL is P-complete (proof) already argued in P L arbitrary language in P, TM M decides L in n k steps H. Yen (NTUEE) Theory of Computation Fall 2012 28 / 33

CVAL is P-complete (proof) H. Yen (NTUEE) Theory of Computation Fall 2012 29 / 33

CVAL is P-complete (proof) H. Yen (NTUEE) Theory of Computation Fall 2012 30 / 33

CVAL is P-complete (proof) H. Yen (NTUEE) Theory of Computation Fall 2012 31 / 33

CVAL is P-complete (proof) H. Yen (NTUEE) Theory of Computation Fall 2012 32 / 33

Summary First separations (via simulation and diagonalization): P EXP, L PSPACE First major open questions: L? = P, P? = PSPACE First complete problems: CVAL is P-complete H. Yen (NTUEE) Theory of Computation Fall 2012 33 / 33