Lecture 1: Course Overview and Turing machine complexity

Similar documents
Review of Basic Computational Complexity

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

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

where Q is a finite set of states

Notes for Lecture 3... x 4

Lecture 3: Nondeterminism, NP, and NP-completeness

Lecture 3: Reductions and Completeness

CSCI3390-Assignment 2 Solutions

The Cook-Levin Theorem

Lecture 1: Introduction

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

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

Variations of the Turing Machine

CSCC63 Worksheet Turing Machines

Computability Theory. CS215, Lecture 6,

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

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

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

CpSc 421 Homework 9 Solution

Circuit Complexity / Counting Problems

CS4026 Formal Models of Computation

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

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

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

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

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

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

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

CS151 Complexity Theory. Lecture 1 April 3, 2017

Chapter 3: The Church-Turing Thesis

CSCI3390-Lecture 16: NP-completeness

Part I: Definitions and Properties

Lecture 14: Recursive Languages

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University

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

CS294: Pseudorandomness and Combinatorial Constructions September 13, Notes for Lecture 5

Theory of Computation

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

Exam Computability and Complexity

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Most General computer?

Introduction to Turing Machines. Reading: Chapters 8 & 9

Notes for Lecture 3... x 4

CS20a: NP completeness. NP-complete definition. Related properties. Cook's Theorem

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

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

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

arxiv: v1 [cs.cc] 3 Feb 2019

CSCE 551 Final Exam, Spring 2004 Answer Key

CSE 105 THEORY OF COMPUTATION

Homework Assignment 6 Answers

CS 525 Proof of Theorems 3.13 and 3.15

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

MTAT Complexity Theory September 15th, Lecture 3

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

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

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

Chapter 7 Turing Machines

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Universal Turing Machine. Lecture 20

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

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

Foundations of

Lecture 2: Tape reduction and Time Hierarchy

9 Nondeterministic Turing Machines

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

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010

Computability and Complexity

Complexity (Pre Lecture)

Lecture 21: Algebraic Computation Models

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

Turing Machines and the Church-Turing Thesis

On the Computational Hardness of Graph Coloring

Advanced Topics in Theoretical Computer Science

CSE 105 Theory of Computation

UNIT-VIII COMPUTABILITY THEORY

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

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

Turing Machines. Chapter 17

Computability and Complexity CISC462, Fall 2018, Space complexity 1

DRAFT. Diagonalization. Chapter 4

Lecture 12: Mapping Reductions

Parallelism and Machine Models

Turing Machines and Time Complexity

conp, Oracles, Space Complexity

CSE 105 THEORY OF COMPUTATION

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

Week 2: Defining Computation

Week 3: Reductions and Completeness

CSE200: Computability and complexity Space Complexity

Space Complexity. Huan Long. Shanghai Jiao Tong University

Verifying whether One-Tape Turing Machines Run in Linear Time

TURING MAHINES

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

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

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

Transcription:

CSE 531: Computational Complexity I Winter 2016 Lecture 1: Course Overview and Turing machine complexity January 6, 2016 Lecturer: Paul Beame Scribe: Paul Beame 1 Course Outline 1. Basic properties of Turing Machines (TMs), Circuits & Complexity 2. P, NP, NP-completeness, Cook-Levin Theorem. 3. Hierarchy theorems, Circuit lower bounds. 4. Space complexity: PSPACE, PSPACE-completeness, L, NL, Closure properties 5. Polynomial-time hierarchy 6. #P and counting problems 7. Randomized complexity 8. Circuit lower bounds 9. Interactive proofs & PCP Theorem - Hardness of approximation 10. Communication complexity (?) 11. Strong Exponential Time Hypothesis (SETH). COnnecting the complexity of SAT and polynomialtime problems. Logistics The course website is http://www.cs.washington.edu/531. Coursework: problem sets (3 or 4, 50% total) take-home midterm (15-20%) in-class exam (30-35%) extra credit homework problems and class participation 1

2 Uniform vs non-uniform models of computation Uniform models of computation - one device for all input sizes: Turing machines Non-uniform models of computation - one device for each input size: e.g. Circuits. We will look at the complexity of functions f : D R. We will focus on Boolean functions; i.e., D = {0, 1} and R = {0, 1} or {0, 1}. Multitape Turing Machines A (multitape) Turing Machine (TM) M consists of the following: finite set of states Q a state register storage: tapes divided into cells, each of which can store an a symbol from the alphabet Γ. heads that scan one cell of each tape. input alphabet Σ Γ, { (blank), > (start)} Γ \ Σ. All but a finite portion of each tape contents consist of the blank symbol. k read/write work tapes 1-way infinite read-only input tape, initially > x 1... x n. write-only output tape; unnecessary if output is in {0, 1} - use special state q accept to indicate output 1 in that case. transition function δ : Q Γ k+1 Q Γ k+1 {L, S, R} k+1. The k + 1 symbols in the domain (being read) are from the input tape and k work tapes; the k + 1 symbols in the co-domain (being written) are from the k work tapes and the output tape. The Turing Machine reads one symbol from each tape based on the position of each head. Each head moves left, right, or stays where it is depending on the value of the corresponding element of {L, S, R}. It runs for ever or until it reaches a halting state. We write M(x) for the contents of the output tape of when x halts. In the same journal issue in which the original paper where Turing described the TM appear, there was another paper by Post in which he defined a very simular computational model. (Excerpts of both papers are linked on the course website.) There are a number of reasons stemming from 2

that original paper that the model has become so closely linked to Turing. Turing gave persuasive arguments that his model was both natural and sufficient to cover every possible computation. He showed the existence of a universal Turing machine. Finally, he showed the undecidability of the halting problem as part of showing that there could be no model that both captures all possible computations and always halts. There are many variations in the Turing machine model that are equivalent to each other. For example, one can easy simulate a 2-way infinite tape cells indexed by consecutive elemments of Z rather than a single 1-way infinite tape indexed by N. In this simulation we can view the 2-way infinite tape as folded over itself, with a single leftmost cell representing a cell on the two-way infinite tape indexed by 0 and upper and lower tracks on the remaining cells representing the negativly and positivly-indexed cells on the two-way infinite tape, respectively. Another variation is the random access or index TM, in which, instead of the read heads, there is a special tape register i that can be written by the TM and causes the value of x i to be copied to a specific tape location whenever the TM enters of a special query state. Many of the results we will cover also apply to this model. None of these other deterministic variations will change the # of steps required to solve problems by more than a polylog( x ) factor. Definition 2.1. Let f : {0, 1} {0, 1} and T : N N. M computes f in time T (usually written T (n)) iff n N and for every input x {0, 1} n, M runs in at most T (n) steps and halts with f(x) on its output tape. Definition 2.2. We define the complexity class of Boolean functions, DTIME(T(n)) = {f : {0, 1} {0, 1} there is a TM M that computes f in time O(T (n))}. We also interpret DTIME(T(n)) as a set of languages L {0, 1} where L = {x f(x) = 1}. Definition 2.3. Let f : {0, 1} {0, 1} and S : N N. M computes f in space S (usually written S(n)) iff n N and for every input x {0, 1} n, M visits at most S(n) cells on each work tape and halts with f(x) on its output tape. Definition 2.4. We define the complexity class of Boolean functions, DSPACE(S(n)) = {f : {0, 1} {0, 1} there is a TM M that computes f in space O(S(n))}. We also interpret DSPACE(S(n)) as a set of languages L {0, 1} where L = {x f(x) = 1}. The definitions of time and space on multitape Turing machines and the view that these are the right ways to capture computational complexity is due to Hartmanis and Stearns, and Hartmanis, Lewis, and Stearns in the early to mid 1960 s. Definition 2.5. P = k DTIME(nk ). 3

We begin by focussing on time complexity. It turns out that there are some time bounds T that do not correspond to running times of Turing machines. All of the time bounds that we consider are particularly well-behaved in the following sense. Definition 2.6. A function T : N N is time constructible iff T (n) n and there is some TM M T such that M T computes the map x [T ( x )] in time at most T (n) where [N] denotes the binary representation of N. The functions n, n log n, n c, and 2 n are all time-constructible as are all the functions we will consider. The Universal Turing Machine A universal Turing Machine is a Turing machine with two input arguments x {0, 1} and the binary encooding [M] of a Turing machine M such that U halts iff M halts on input x and, if it does halt, U(x, [M]) = M(x). A universal TM may have a smaller tape alphabet, smaller state set, and smaller number of tapes than the machine M given by [M]. It will represent the elements of Γ in binary as [a] for a Γ. It will have to use a tape to store a register holding an encoding [q] of the current state q Q of M, and (possibly) to store encodings of the k + 1 symbols currently scanned by the heads of M. The contents of the k work tapes of M and the positions of their read/write heads are simulated on a fixed # of tapes of M. The general idea of the simulation is for the simulating machine to match up the scanned symbols with the transition table δ encoded in [M] and simulate the actions of each step of M. Definition 2.7. A Turing machine M is oblivious the location of the read heads of M depend only on the length x of the input x, and the time step t. Theorem 2.8. There is an oblivious (universal) Turing machine U such that for all TMs M there is a C > 0 such that for all x {0, 1} and all time bounds T (n) n, if M halts on input x within T ( x ) steps then U(x, [M]) = M(x) and U on input (x, [M]) halts in at most CT ( x ) log 2 T ( x ) steps. Proof sketch. We first describe a simpler version that proves this with time bound CT 2 ( x ) and only uses one work tape. The work tape of U will have 2k tracks. There will be blocks of cells that represent elements of (Γ {, }) k. The represents the position of the read head on the corresponding tape. The algorithm proceeds by (1) sweeping across the occupied region of the work tape left to right to find the symbols currently 4

scanned, and hence the moves to execute using [M], (2) sweeping right to left to execute those moves for which the read/write head moves left or stays in place, (3) sweeping left to right to execute the rightward head moves of M. (4) moving back to the left end of the work tape. The number of occupied cells on the work tapes of M is at most T ( x ) so each step costs at most O(T ( x ) steps; i.e. O(T 2 ( x )) total. The algorithm is essentially oblivious - to do so one needs to make sure that the length of the region being swept over in simulating time step t does not depend on the input (using max t, n works). In order to improve the running time we first describe a simple alternative approach to simulating the tapes of [M]. In this version, we use k tracks that each use the simulation of a 2-way infinite tape and align the positions of the work tapes at the 0 position (left end) of the tapes. This way, there is no need to mark the head positions and no need to record the currently scanned positions separately. However, whenever a head position on a simulated tape moves to the right, the entire contents of that tape need to be shifted one simulated cell to the left, and whenever it moves to the left, the contents must be shifted to the right. It costs O(T ( x ) steps of U to do the shift to simulate each step of M so again the total running time is O(T 2 ( x )). To get the improved time bound, the simulating universal machine will need an extra work tape. The difficulty in improving this simulation is that each shift has to move the entire non-blank portion of the tape of M. The idea, due to Hennie and Stearns, is to have a more relaxed representation of each tape by using a dummy character d that is ignored so that 0110, d0 d d11 d0, and 01 d1 d d0 d all represent the same tape contents. The general idea is to periodically spread out the contents of the tape to have sufficient room (in the form of d symbols) so that left and right shifts only need to move a small portion of the tape contents at each step. More precisely, in addition to the leftmost cell, the two-way infinite simulation of a single tape will have consecutive zones Z 0, Z 1,..., where Z i is 2 i cells wide and represents the contents in L i and R i both left and right of the read head. The invariant that will be maintained is that 2 i of the 2 i+1 values in L i R i will contain d. The balance between L i and R i will change over time, and after 2 i simulated steps it is possible that one of them will be packed so that there is no room to shift further. Every 2 i steps the algorithm will spread the contents out so that each of L 0, R 0,..., L i, R i is half filled with d symbols. This requires shifting Θ(2 i ) elements up to Θ(2 i ) positions. If there were only a single tape this would cost the product of these two, which would lead only to an O(T 2 (n)) running time. However, with the second tape these shifts can be done in O(2 i ) time by copying the contents using the second tape. Since the algorithm runs only for T (n) steps and T (n) n, only log 2 T (n) zones are required. Therefore the total cost is log 2 T (n) i=0 c2 i T (n) 2 i = O(T (n) log T (n)). The textbook contains more details (but neglects to mention the need for the second tape). 5

In all of the above it will be important for some of the applications that U is not only oblivious but each head position is also very simple and easy to compute as a function of x, [M], and t. 6