XI. Computational Complexity

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

Computability and Complexity

Computable Functions

Informal Statement Calculus

Computation Histories

XII. Elementary Function

Introduction to Turing Machines

Non-emptiness Testing for TMs

Theory of Computation

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

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

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

NP-completeness was introduced by Stephen Cook in 1971 in a foundational paper.

Theory of Computation

Computability Theory. CS215, Lecture 6,

Lecture 14: Recursive Languages

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

Halting and Equivalence of Schemes over Recursive Theories

CHAPTER 5. Interactive Turing Machines

Introduction to Turing Machines. Reading: Chapters 8 & 9

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

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

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

Predicate Logic - Undecidability

AN INTRODUCTION TO COMPUTABILITY THEORY

Equivalence of Regular Expressions and FSMs

1 Showing Recognizability

ELEMENTS IN MATHEMATICS FOR INFORMATION SCIENCE NO.6 TURING MACHINE AND COMPUTABILITY. Tatsuya Hagino

7. The Recursion Theorem

Part I: Definitions and Properties

Ma/CS 117c Handout # 5 P vs. NP

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

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

4.2 The Halting Problem

The Power of One-State Turing Machines

1 The decision problem for First order logic

About the relationship between formal logic and complexity classes

Turing Machines. Chapter 17

arxiv: v1 [cs.cc] 3 Feb 2019

Limits of Computability

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

7. The Recursion Theorem

(a) Definition of TMs. First Problem of URMs

7. The Recursion Theorem

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Verifying whether One-Tape Turing Machines Run in Linear Time

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

Monotonically Computable Real Numbers

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

Algorithmic Model Theory SS 2016

6.8 The Post Correspondence Problem

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Chapter 2 Algorithms and Computation

On Rice s theorem. Hans Hüttel. October 2001

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

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

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

S 1 S 2 L S 1 L S 2 S 2 R

Lecture notes on Turing machines

Decidability: Church-Turing Thesis

The Cook-Levin Theorem

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

5 3 Watson-Crick Automata with Several Runs

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

2.6 Variations on Turing Machines

Small polynomial time universal Turing machines

Equivalent Variations of Turing Machines

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

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

The halting problem is decidable on a set of asymptotic probability one

Section 14.1 Computability then else

Theory of Computation

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

TAKE-HOME: OUT 02/21 NOON, DUE 02/25 NOON

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

A Turing Machine Distance Hierarchy

Theory of Computer Science. Theory of Computer Science. D8.1 Other Halting Problem Variants. D8.2 Rice s Theorem

VI. Church-Turing Thesis

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

Automata Theory. Definition. Computational Complexity Theory. Computability Theory

Turing Machines. Wolfgang Schreiner

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang

Foundations of

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

Automata Theory CS Complexity Theory I: Polynomial Time

arxiv: v2 [cs.fl] 29 Nov 2013

Speed-up Theorems in Type-2 Computations Using Oracle Turing Machines

MTAT Introduction to Theoretical Computer Science

CSC 373: Algorithm Design and Analysis Lecture 18

Homework Assignment 6 Answers

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

9 Nondeterministic Turing Machines

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

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

,

Lecture 12: Mapping Reductions

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

Transcription:

XI. Computational Complexity Yuxi Fu BASICS, Shanghai Jiao Tong University

Mathematic proofs, like computations, are energy consuming business. There are mathematical theorems, and computational tasks, that require more resources than what are available to us. A mathematical proof, and a program as well, must be short enough to be practically relevant. Computability Theory, by Y. Fu XI. Computational Complexity 1 / 34

In real world we are not only interested in if a problem is solvable but also how costly it is to solve the problem. Computability Theory, by Y. Fu XI. Computational Complexity 2 / 34

Synopsis 1. Complexity Measure 2. Blum s Speedup Theorem 3. Gap Theorem Computability Theory, by Y. Fu XI. Computational Complexity 3 / 34

1. Complexity Measure Computability Theory, by Y. Fu XI. Computational Complexity 4 / 34

Time appears to be the best criterion for the amount of energy necessary to execute a program. Computability Theory, by Y. Fu XI. Computational Complexity 5 / 34

Time Function Given a program P, the time function t (n) P ( x) is defined by t (n) P We write t e (n) ( x) for t (n) P e ( x). Remark: ( x) = µt.(p( x) terminates in t steps). The time function is computable since P( x) in t steps is a primitive recursive predicate. We shall omit the superscript (n) when n = 1. Computability Theory, by Y. Fu XI. Computational Complexity 6 / 34

Time Function Fact. (i) dom(t e (n) ( x)) = dom(φ (n) e ( x)) for all n, e. (ii) The predicate t (n) e ( x) y is decidable for all n. Computability Theory, by Y. Fu XI. Computational Complexity 7 / 34

Blum Complexity Measure (φ i, Φ i ) is a Blum complexity measure if the following hold: Φ i (x) is defined iff φ i (x) is defined. Φ i (x) n is decidable. Manuel Blum A Machine-Independent Theory of the Complexity of Recursive Functions. J. ACM 14:322-336, 1967. Computability Theory, by Y. Fu XI. Computational Complexity 8 / 34

We are mainly interested in asymptotic behaviour of time function. A predicate M(n) holds almost everywhere (a.e.) if M(n) holds for all but finitely many natural numbers n. Computability Theory, by Y. Fu XI. Computational Complexity 9 / 34

Theorem. Given a total computable function b(x), there is a total computable function f (x) with range {0, 1} such that t e (x) > b(x) a.e. for every index e of f (x). There are arbitrarily complex time functions. Computability Theory, by Y. Fu XI. Computational Complexity 10 / 34

Define f so that it differs from every function in the sequence φ j0, φ j1, φ j2,..., φ jk,.... (1) A function φ i appears in (1) if φ i (m) b(m) for infinitely many m. Suppose f (0), f (1),..., f (n 1) have been defined. Let i n be µi.(i n, t i (n) b(n), i is not yet defined) and let f (n) be defined by f (n) = { 1, if in is defined and φ in (n) = 0, 0, otherwise. 1. If φ e = f, then e i n whenever i n is defined. 2. If t i (m) b(m) for infinitely many m then i = i n for some n. Computability Theory, by Y. Fu XI. Computational Complexity 11 / 34

2. Blum s Speedup Theorem Computability Theory, by Y. Fu XI. Computational Complexity 12 / 34

Is there always a best program that solves a problem? Blum s Speedup Theorem says that the answer is negative. Computability Theory, by Y. Fu XI. Computational Complexity 13 / 34

Speedup Theorem Lemma. Let r be a total computable function. There is a total computable function f such that given any program P i for f we can construct effectively a program P j with the following properties: 1. φ j is total and φ j (x) = f (x) a.e.. 2. r(t j (x)) < t i (x) a.e.. Computability Theory, by Y. Fu XI. Computational Complexity 14 / 34

Proof of the Lemma By S-m-n Theorem, there is a total computable function s st φ s(e,u) (x) φ (2) e (u, x). (2) We will construct some e using Recursion Theorem such that φ (2) e (u, x) g(e, u, x), (3) where g(e, u, x) is obtained by the diagonalisation construction described on the next slide. Computability Theory, by Y. Fu XI. Computational Complexity 15 / 34

Proof of the Lemma Suppose some finite sets of canceled indices C e,u,0,..., C e,u,x 1 have been defined. If t s(e,i+1) (x) is defined for all i {u,..., x 1}, then let C e,u,x = { i u i < x, t i (x) r(t s(e,i+1) (x)) } \ y<x C e,u,y ; otherwise let C e,u,x be undefined. Clearly C e,u,x is computable, and if i C e,u,x then φ i (x). Now g(e, u, x) is defined by g(e, u, x) = { 1 + max{φi (x) i C e,u,x }, if C e,u,x is defined,, otherwise. Computability Theory, by Y. Fu XI. Computational Complexity 16 / 34

Proof of the Lemma C e,0,0, C e,0,1, C e,0,2,..., C e,0,x, C e,0,x+1,... C e,1,0, C e,1,1, C e,1,2,..., C e,1,x, C e,1,x+1,........ C e,x,0, C e,x,1, C e,x,2,..., C e,x,x, C e,x,x+1,...... The unary function g(e, u, ) is defined to differ from all functions eliminated in x ω C e,u,x... Computability Theory, by Y. Fu XI. Computational Complexity 17 / 34

Proof of the Lemma For each pair of e, x we show that g(e, u, x) is total. If u x, then C e,u,x = and consequently g(e, u, x) = 1. Suppose u < x and g(e, x, x),..., g(e, u + 1, x) are defined. φs(e,x) (x),..., φ s(e,u+1) (x) are defined according to (3). Hence ts(e,x) (x),..., t s(e,u+1) (x) are defined. It follows that Ce,u,x is defined. Consequently g(e, u, x) is also defined. This completes the downward induction. We conclude that g is a total function, which implies that t s(e,u+1) (x) is always defined. Computability Theory, by Y. Fu XI. Computational Complexity 18 / 34

Proof of the Lemma Fact. Some v exists such that φ 2 e(0, x) = φ 2 e(u, x) for all x > v. Proof. By definition C e,u,x = C e,0,x {u, u + 1,..., x 1}. Let v = max{x C e,0,x contains an index i < u}. It is clear that C e,0,x {u, u + 1,..., x 1} for all x > v. Hence C e,0,x = C e,u,x for all x > v. Computability Theory, by Y. Fu XI. Computational Complexity 19 / 34

Proof of the Lemma Fact. If φ i = φ 2 e(0, x), then r(t s(e,i+1) (x)) < t i (x) a.e.. Proof. Let i be an index for φ 2 e(0, x). It should be clear that for all x > i, the following holds: r(t s(e,i+1) (x)) < t i (x). If not, i would have been canceled at some stage, say i C e,0,w. But then φ i (w) g(e, 0, w) by definition. That is φ i (w) φ 2 e(0, w), contradicting to the assumption. Computability Theory, by Y. Fu XI. Computational Complexity 20 / 34

Proof of the Lemma Let f (x) = φ (2) e (0, x). We have proved that f satisfies the property stated in the lemma. Computability Theory, by Y. Fu XI. Computational Complexity 21 / 34

Theorem (Blum, 1967). Let r be a total computable function. There is a total computable function f such that given any program P i for f there is another program P j for f satisfying r(t j (x)) < t i (x) a.e.. Computability Theory, by Y. Fu XI. Computational Complexity 22 / 34

W.l.o.g. assume that r is increasing. By a slight modification of the proof of the lemma, we get a total computable function f such that given any program P i for f there is a program P k for f satisfying the following: φ k (x) is total and φ k (x) = f (x) a.e.. r(t k (x) + x) < t i (x) a.e.. Some c exists such that φ k (x) = f (x) whenever x > c. We get a program P j from P k by short-cutting computations at inputs c. If c is large enough such that the additional computation cost is less than c, then the program P j satisfies r(t j (x)) < t i (x) a.e.. Computability Theory, by Y. Fu XI. Computational Complexity 23 / 34

We cannot define time complexity for problems. We can however define time complexity for solutions. Computability Theory, by Y. Fu XI. Computational Complexity 24 / 34

Hartmanis and Stearns Linear Speedup Theorem Theorem (Hartmanis and Stearns, 1965). If L is decidable in T (n) time, then for any ɛ > 0 it is decidable in ɛt (n) + n + 2 time. Computability Theory, by Y. Fu XI. Computational Complexity 25 / 34

Hartmanis and Stearns Linear Speedup Theorem Proof. Suppose a k-tape TM M = (Q, Γ, δ) accepts L in time T (n). Design a k-tape TM M that encodes m symbols of M by one symbol of M. The alphabet of M is Γ Γ m. In n + 2 steps M converts the input. M then uses n/m steps to realign the head. In state (q, h 1,..., h k ), where h 1,..., h k m, M moves right one step, left two steps, right one step to gather information. It then takes two steps to update data. The overall time it takes is n + 2 + n m + 6 m T (n) n + 2 + 7 m T (n). So let m be 7/ɛ. Computability Theory, by Y. Fu XI. Computational Complexity 26 / 34

3. Gap Theorem Computability Theory, by Y. Fu XI. Computational Complexity 27 / 34

Complexity Class Let b(x) be total and computable. The time complexity class of b(x), denoted by TIME(b(x)), is the following set {φ e φ e (z) is total and t e (z) b( z ) a.e.}. Computability Theory, by Y. Fu XI. Computational Complexity 28 / 34

Is it true that for every total computable function b(x) the inclusion TIME(b(x)) TIME(2 b(x) ) is strict? Computability Theory, by Y. Fu XI. Computational Complexity 29 / 34

Boris Trakhtenbrot. Turing Computations with Logarithmic Delay. Algebra and Logic 3(4):33-48, 1964. (in Russian) Allan Borodin. Computational Complexity and the Existence of Complexity Gaps. Journal of the ACM 19(1):158-174, 1972. Computability Theory, by Y. Fu XI. Computational Complexity 30 / 34

Gap Theorem (Trakhtenbrot, 1964; Borodin, 1972). Let r(x) be a total computable function such that r(x) x. Then there is a total computable function b(x) such that TIME(b(x)) = TIME(r(b(x))). Computability Theory, by Y. Fu XI. Computational Complexity 31 / 34

Proof of Gap Theorem Define a sequence of numbers k 0 < k 1 < k 2 <... < k x by k 0 = 0, k i+1 = r(k i ) + 1, for i < x. The x + 1 intervals [k 0, r(k 0 )],..., [k x, r(k x )] are disjoint. Let P(i, k) denote the following decidable property: On every input of length i, each of M 0,..., M i either halts in k steps or does not halt in r(k) steps. Computability Theory, by Y. Fu XI. Computational Complexity 32 / 34

Proof of Gap Theorem Let n i be i j=0 Γ j i, the number of input of size i in M 0,..., M i. The n i input strings of size i cannot fill all the n i + 1 intervals [k 0, r(k 0 )],..., [k ni, r(k ni )]. It follows that there is some j n i such that P(i, k j ) is true. Let b(i) be the least such k j. Suppose M h accepts L TIME(r(b(n))). For every x with x h then by definition M h (x) either halts in b( x ) steps or does not halt in r(b( x )) steps. It follows that L TIME(b(x)). Computability Theory, by Y. Fu XI. Computational Complexity 33 / 34

The growth of b(x) is too fast for r to make any difference. Computability Theory, by Y. Fu XI. Computational Complexity 34 / 34