Lecture 2: Tape reduction and Time Hierarchy

Similar documents
Lecture 1: Introduction

Lecture 16: Time Complexity and P vs NP

1 Deterministic Turing Machines

Lecture 3: Reductions and Completeness

1 Deterministic Turing Machines

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

: On the P vs. BPP problem. 30/12/2016 Lecture 12

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Lecture 3: Nondeterminism, NP, and NP-completeness

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

Time-bounded computations

Finish K-Complexity, Start Time Complexity

Computability and Complexity

Variations of the Turing Machine

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

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

Review of Basic Computational Complexity

MTAT Complexity Theory September 15th, Lecture 3

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

Lecture 1: Course Overview and Turing machine complexity

Computational complexity

CSE 105 THEORY OF COMPUTATION

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

Lecture 14: Recursive Languages

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:

CSE 105 Theory of Computation

Lecture 1: Introduction

Time-Space Tradeoffs for SAT

CSE 105 THEORY OF COMPUTATION

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

Computational Models Lecture 11, Spring 2009

Deterministic Time and Space Complexity Measures

Advanced topic: Space complexity

1 Computational Problems

Computability Theory. CS215, Lecture 6,

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}

Notes for Lecture Notes 2

Chapter 3: The Church-Turing Thesis

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Turing s Thesis. Fall Costas Busch - RPI!1

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

V Honors Theory of Computation

1 Showing Recognizability

CSCE 551: Chin-Tser Huang. University of South Carolina

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

The P versus NP Problem. Dean Casalena University of Cape Town CSLDEA001

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

On the Computational Hardness of Graph Coloring

CS151 Complexity Theory. Lecture 1 April 3, 2017

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

MTAT Complexity Theory October 20th-21st, Lecture 7

Turing s original paper (1936)

Decidability and Undecidability

CSCE 551 Final Exam, Spring 2004 Answer Key

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

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

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

Computational Complexity

ECE 695 Numerical Simulations Lecture 2: Computability and NPhardness. Prof. Peter Bermel January 11, 2017

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Turing Machines Part III

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

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

CSCI 1590 Intro to Computational Complexity

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

CS 525 Proof of Theorems 3.13 and 3.15

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

Intractable Problems [HMU06,Chp.10a]

Intro to Theory of Computation

Foundations of

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

Turing Machine Variants. Sipser pages

Theory of Computation Time Complexity

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

NP-Completeness and Boolean Satisfiability

Complexity: moving from qualitative to quantitative considerations

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS154, Lecture 13: P vs NP

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Turing machines and linear bounded automata

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

Chapter 7: Time Complexity

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

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

Exam Computability and Complexity

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

Lecture 7: Polynomial time hierarchy

Part I: Definitions and Properties

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

Reducability. Sipser, pages

Lecture 12: Mapping Reductions

DRAFT. Diagonalization. Chapter 4

CSE 135: Introduction to Theory of Computation NP-completeness

Lecture 12: Randomness Continued

Complexity (Pre Lecture)

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions

Theory of Computation (IX) Yijia Chen Fudan University

Transcription:

Computational Complexity Theory, Fall 2010 August 27 Lecture 2: Tape reduction and Time Hierarchy Lecturer: Peter Bro Miltersen Scribe: Andreas Hummelshøj Jakobsen Tape reduction Theorem 1 (k-tapes 2-tape reduction). Suppose L is computed by a k-tape T (n) time-bounded turing machine M. Then L is computed by a 2-tape O(T (n) log(t (n)) time-bounded turing machine M. Proof. (sketch) Tape 1 is a two-way infinite tape with 3 tracks for each of the k-tapes. The tape cells are divided into blocks of cells..., B 2, B 1, B 0, B 1, B 2...,, of sizes B i = B i = 2 i 1 cells, see figure 1 (NOTE: The picture shows only the layout, had we used only 2 tracks for each tape). 2-tracks b -3 b -2 b -1 b 0 b 1 b 2 b 3-5 -3-1 -6-4 -2 0 1 2 3 4 5 6 Figure 1: The numbers on the block parts indicates how the simulated tape is placed on the 3 tracks, only full parts is an actual part of the tape, the orginal tape is placed {..., 6, 5, 4 3, 2, 1, 0, 1, 2, 3, 4, 5, 6,... }, parts numbered < 0 is to the left of the current position of the tape head, and parts > 0 is to the right of the current position of the tape head. Tape 2 is a scratch tape. The intuition behind the reduction is: move data not tape heads scratch b 0 holds the storage symbols scanned by each of the tape heads. When simulating a move data is then transported in the opposite direction of the move for the tracks of the tape head being moved. Invariant In each block, each track is either full (i.e. contains content of original tapes) or completely empty (i.e. contains a special symbol indicating this). b 0 contains one cell of the original tape; that at the position of the head of the orignal tape. Definition 2. A block is clean if either 1 or 2 tracks (of the 3 tracks) are full. Procedure: step(k) Simulates 2 k steps of the original machine M. Precondition: Blocks b (k+1) through b k+1 are all clean. Postconditions: Only blocks b (k+1) through b k+1 are touched; of these b k through b k are left clean. And the number of full/empty tracks in b (k+1) and b k+1 change by at most 1. 1

If k = 0, do a single step of M and shift tape by 1, using b 1 and b 1. Otherwise: step(k 1) clean(k) step(k 1) clean(k), where clean is defined below. Procedure: clean(k) Ensures that block b ±k are clean. Scan to block b k. If 0 tracks are filled, take the innermost filled track of block b k+1 (Note: such a filled track exists!), split it in two and move the halves to b k If 3 are filled, merge the two outermost tracks of b k and move them to b k+1 (Note: there is an empty track available for this!). Repeat for b k Time complexity The times for step and clean are: ( k ) Time clean (k) = O 2 i i=0 = O (2 k) Time step (k) = 2 Time step (k 1) + O(2 k ) = O(2 k k) If k = log T (n) we then have that Time step (k) = O(T (n) log(t (n))). Problem: We don t know the correct k to use for the initial call (We don t assume that we can compute T (n)). Solution: Try for all k in sequence, k = 1, k = 1, etc. until the simulation is successful. This only adds a constant factor overhead in the time complexity. 2

Time complexity classes Definition 3. DTIME ( T (n) ) = { Class of languages computed by a multitape O(T (n)) timebounded turing machine }. PTIME := k>0 DTIME(n k ) EXP := k>0 DTIME(2 nk ) Universal Turing Machine Recall the existence of efficient an universal Turing machine M k : Takes a description of a Turing Machine M (and input) as input. Simulates a run of M. U k is defined as: has k + 1 tapes put encoding of M, a k-tape turing machine on tape k + 1 then U k can simulate M on input x with a constant overhead. If M is T (n) time-bounded then U k runs for O(T (n)) steps where the constant only depends on M. Time-constructible Definition 4. T (n) is time-constructible iff there is a Turing machine that on input 1 n halts with 1 T (n) on a given tape in time O(T (n)). Time Hierachy Theorem Theorem 5. Let T 2 (n) be time-constructable, and assume T 1 (n) fulfills T 1 (n) log(t 1 (n)) = o(t 2 (n)) and T 1 (n), T 2 (n) n. Then DTIME(T 1 (n)) DTIME(T 2 (n)), meaning at least one thing that can be computed in DT IME(T 2 (n)) cannot be computed in DT IME(T 1 (n)). Proof. We want to prove that the time class DT IME(T 2 (n)) is strictly larger than the time class DT IME(T 1 (n)). We do this by constructing a machine M which cannot be in DT IME(T 1 (n)), by diagonalization, and we then show that M is in DT IME(T 2 (n)). Contruction of M For a input x, where x = n, we use the time-constructibility to put a clock 1 T 2(n) on a spare tape, and then we run the remaining parts below for at most T 2 (n) steps. We can write x on the form x = 0 i 1w, for i N, now M does: test if w is an encoding of a 2-tape turing machine M, if not reject. simulate M on input x, using U 2. 3

if M halts then accept iff M rejects (diagonalization). if time runs out, then reject. Analysis Clearly M is O(T 2 (n)) time-bounded. Assume L(M) is computed by a T 1 (n) time-bounded turing machine. By 2-tape reduction we get a 2-tape TM M, which is O(T 1 (n) log(t 1 (n))) time bounded, that computes L(M). Look at the simulation of M with input x = 0 i 1w, on M. Since T 1 (n) log(t 1 (n)) = o(t 2 (n)) the simulation of M will succeed for all sufficiently large i. For these inputs the machines M and M disagree, and hence M cannot compute the language L(M). From this theorem we now directly get P = k>0 DT IME(n k ) DT IME(2 n ) DT IME(2 n2 ) EXP. because n2 n = o(2 n2 ). Nondeterministic Turing Machines Definition 6. Nondeterministic TM. Exactly like a [deterministic] TM, execpt replace δ with Definition 7. Language of a nondet. TM. δ : Q Γ k 2 (Q Γk {L,R} k ) A nondeterministic TM accepts an input x if at least one possible computation accepts x. Definition 8. Time Complexity of nodet. TM. Time complexity of M on x is still worst-case, so we use the longest computation path possible on x. Definition 9. NTIME ( T (n) ) = { Class of languages computed by a multitape O(T (n)) timebounded non-deterministic turing machine }. NP := k>0 NTIME(n k ) NEXP := k>0 NTIME(2 nk ) Tape reduction, non-deterministic Theorem 10 ((non-det) k-tapes 2-tape reduction). Suppose L is accepted by a k-tape T (n) time-bounded non-deterministic TM M. Then L is accepted by a 2-tape O(T (n)) time-bounded non-deterministic TM M. Furthermore, M has at most 2 choices; δ(r) 2 for all r Q Γ k Proof. Homework. 4

Nondeterministic Time Hierachy Theorem Theorem 11. Let T 1 and T 2 be functions such that T 2 (n) = ω(n) and T 2 is time-constructible. T 1 (n + 1) = o(t 2 (n)). Then NTIME(T 1 (n)) NTIME(T 2 (n)). Proof. Next lecture. 5