Theory of Computation

Similar documents
Theory of Computation

Theory of Computation

,

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

Intro to Theory of Computation

Time-bounded computations

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Theory of Computation

Complexity Theory Part I

Finish K-Complexity, Start Time Complexity

Advanced topic: Space complexity

Time Complexity. CS60001: Foundations of Computing Science

Lecture Notes: The Halting Problem; Reductions

Computational complexity

CS173 Running Time and Big-O. Tandy Warnow

Asymptotic notation : big-o and small-o

Kolmogorov complexity

CS154, Lecture 12: Kolmogorov Complexity: A Universal Theory of Data Compression

Theory of Computation

Introduction to Languages and Computation

Please give details of your answer. A direct answer without explanation is not counted.

M. Smith. 6 September 2016 / GSAC

Lecture 13: Foundations of Math and Kolmogorov Complexity

Great Theoretical Ideas in Computer Science. Lecture 9: Introduction to Computational Complexity

TURING MAHINES

Theory of Computation

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

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

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

Turing Machines, diagonalization, the halting problem, reducibility

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 20. To Infinity And Beyond: Countability and Computability

Great Theoretical Ideas in Computer Science. Lecture 7: Introduction to Computational Complexity

Growth of Functions (CLRS 2.3,3)

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

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

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.

Notes for Lecture Notes 2

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

Theory of Computation

Lecture 2. More Algorithm Analysis, Math and MCSS By: Sarah Buchanan

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

Ph219/CS219 Problem Set 3

CSCI3390-Lecture 6: An Undecidable Problem

Chapter 7: Time Complexity

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

Data Structures and Algorithms. Asymptotic notation

When we use asymptotic notation within an expression, the asymptotic notation is shorthand for an unspecified function satisfying the relation:

NP-Completeness. Until now we have been designing algorithms for specific problems

EECS 477: Introduction to algorithms. Lecture 5

An analogy from Calculus: limits

Algorithms, Design and Analysis. Order of growth. Table 2.1. Big-oh. Asymptotic growth rate. Types of formulas for basic operation count

CSCE 551 Final Exam, Spring 2004 Answer Key

Intractable Problems [HMU06,Chp.10a]

Algorithm efficiency can be measured in terms of: Time Space Other resources such as processors, network packets, etc.

MATH 22 FUNCTIONS: ORDER OF GROWTH. Lecture O: 10/21/2003. The old order changeth, yielding place to new. Tennyson, Idylls of the King

How many hours would you estimate that you spent on this assignment?

COMPUTATIONAL COMPLEXITY

CS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms

CP405 Theory of Computation

CS Data Structures and Algorithm Analysis

Lecture 20: conp and Friends, Oracles in Complexity Theory

Designing 1-tape Deterministic Turing Machines

MA008/MIIZ01 Design and Analysis of Algorithms Lecture Notes 2

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

5 + 9(10) + 3(100) + 0(1000) + 2(10000) =

CSCC63 Worksheet Turing Machines

Intractable Problems. Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Harvard CS 121 and CSCI E-121 Lecture 20: Polynomial Time

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).

CSED233: Data Structures (2017F) Lecture4: Analysis of Algorithms

Friday Four Square! Today at 4:15PM, Outside Gates

Comparison of functions. Comparison of functions. Proof for reflexivity. Proof for transitivity. Reflexivity:

The Growth of Functions. A Practical Introduction with as Little Theory as possible

Theory of Computation (IX) Yijia Chen Fudan University

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

Computability and Complexity

P, NP, NP-Complete, and NPhard

Lecture 7: Sections 2.3 and 2.4 Rational and Exponential Functions. Recall that a power function has the form f(x) = x r where r is a real number.

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

1 Computational Problems

Analysis of Algorithms I: Asymptotic Notation, Induction, and MergeSort

CS151 Complexity Theory. Lecture 1 April 3, 2017

Turing Machines and Time Complexity

Complexity (Pre Lecture)

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

Further discussion of Turing machines

Design and Analysis of Algorithms

Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols

Lecture 16: Time Complexity and P vs NP

Asymptotic Analysis. Slides by Carl Kingsford. Jan. 27, AD Chapter 2

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

Lecture 7: More Arithmetic and Fun With Primes

Theory of Computation

with the size of the input in the limit, as the size of the misused.

where Q is a finite set of states

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

AP Calculus Chapter 9: Infinite Series

Analysis of Algorithm Efficiency. Dr. Yingwu Zhu

Transcription:

Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation 1 / 33

Lecture 20: Overview Incompressible strings Minimal Length Descriptions Descriptive Complexity Dr. Sarmad Abbasi () Theory of Computation 2 / 33

Incompressible strings Recall that a string, x, is b-compressible if K(x) x b 1 A string is b-incompressible if it is not b-compressible. 2 A string is incompressible if it is not 1-compressible. Incompressible strings cannot be compressed. Their description is at least as long as the string itself. Dr. Sarmad Abbasi () Theory of Computation 3 / 33

Incompressible strings 1 Incompressible strings look like random strings. 2 This can be made precise in many ways. Many properties of random strings are also true for incompressible strings. For example Dr. Sarmad Abbasi () Theory of Computation 4 / 33

Incompressible strings We proved two theorems: Theorem For every n there is a incompressible string of length n. Theorem The number of b-incompressible strings of length b is at least The proof is simple counting! 2 n 2 n b+1 + 1 Dr. Sarmad Abbasi () Theory of Computation 5 / 33

Incompressible strings 1 Incompressible strings have roughly the same number of 0 s and 1 s. 2 The longest run of 0 is of size O(log n). Let us prove a theorem which is central in this theory. Dr. Sarmad Abbasi () Theory of Computation 6 / 33

Incompressible strings Theorem A computable property that holds for almost all strings also holds for incompressible strings. Let us formalize this statement. A property p is a mapping from set of all strings to {TRUE, FALSE}. Thus p : {0, 1} {true, false} Dr. Sarmad Abbasi () Theory of Computation 7 / 33

Incompressible strings We say that p holds for almost all strings if {x {0, 1} n : p(x) = false } 2 n approaches 0 as n approaches infinity. Dr. Sarmad Abbasi () Theory of Computation 8 / 33

Incompressible strings Theorem Let p be a computable property. If p holds for almost all strings the for any b > 0, the property p is false on only finitely many strings that are incompressible by b. Let M be the following algorithm: 1 On input i (in binary) 2 Find the ith string s such that p(s) = False. Considering the strings lexicographically. 3 Output s. Dr. Sarmad Abbasi () Theory of Computation 9 / 33

Incompressible strings We can use M to obtain short descriptions of string that do not have property p. Let x be a string that does not have property p. Let i x be the index of x in the list of all strings that do not have property p ordered lexicographically. Then M, i x is a description of x. The length of this description is i x + c Dr. Sarmad Abbasi () Theory of Computation 10 / 33

Incompressible strings Now we count. For any give b > 0 select n such that at most 1 2 b+c fraction of the strings of length n do not have property p. Note that since p holds for almost all strings, this is true for all sufficiently large n. Dr. Sarmad Abbasi () Theory of Computation 11 / 33

Incompressible strings Then we have i x 2n 2 b+c Therefore, i x n b c. Hence the length of M i x is at most n b c + c = n b. Thus K(x) n b which means x is b-compressible. Hence, only finitely many strings that fail p can be incompressible by b. Dr. Sarmad Abbasi () Theory of Computation 12 / 33

Incompressible strings We can ask a very interesting question now: Is it possible to compress a string that is already compressed? The answer to this question seems to be no! Let us prove something that is quite close to this. Dr. Sarmad Abbasi () Theory of Computation 13 / 33

Incompressible strings Theorem There is a constant b such that for every string x the minimal description d(x) is incompressible by b. Roughly the idea of the proof is that If d(x) were compressible we could use the compressed version of d(x) to obtain a smaller description of x than d(x). Dr. Sarmad Abbasi () Theory of Computation 14 / 33

Incompressible strings Consider the following TM M: 1 On input R, y 2 Run R on y and reject if its output is not of the form S, z 3 Run S on z and halt with its output on the tape. This machine is decoding twice. Let b = 2 M + 3. We now show that b satisfies the statement of the theorem. Suppose on the contrary that d(x) is b compressible for some string. The d(d(x)) d(x) b. But what happens if we run M on d(d(x)). Note that it outputs x Dr. Sarmad Abbasi () Theory of Computation 15 / 33

Incompressible strings Thus < M > d(d(x)) is a description of x. How long is this description? 2 M + 2 + d(d(x)) = (b 1) + ( d(x) b) = d(x) 1 This contradicts the fact that d(x) is the minimal description of x. Dr. Sarmad Abbasi () Theory of Computation 16 / 33

Complexity Theory Now we will look at resource bounded computations. Two of the most important resources are going to be 1 Time 2 Space Dr. Sarmad Abbasi () Theory of Computation 17 / 33

Complexity Theory Let A = {0 k 1 k : k 0} Consider the following TM that accepts A 1 Scan across the tape to check if all 0 s are before 1 s if not reject. 2 Scan across the tape crossing of a 0 and a 1 each time. 3 If 0 s remain and 1 s finished reject. 4 if 1 s remain and 0 s are finished reject. 5 if both 0 s and 1 s are finished accept. 6 Goto Step 2 We want to analyze this algorithm and talk about how many steps (time) does it take. Dr. Sarmad Abbasi () Theory of Computation 18 / 33

Complexity Theory A step of the Turing machine is assumed to take unit time. Lets start with a definition. Let M be a TM that halts on all inputs. The running time or the time complexity of M is a function f : N N such that f (n) is the maximum number of steps that M uses on any input of length n. 1 We say that M runs in time f (n). 2 M is f (n)-time TM. Dr. Sarmad Abbasi () Theory of Computation 19 / 33

Big O notation We want to understand how much time a TM takes in the worst case. The exact running time t(n) is going to be very complicated expression. In some cases we will not be able to compute it. But what we are interested in is getting a rough idea of how t(n) grows for large inputs. So we will use asymptotic notation. Dr. Sarmad Abbasi () Theory of Computation 20 / 33

Big O notation Lets look at an example let f (n) = 5n 3 + 13n 2 6n + 48 This function has four terms. He most important term is 5n 3 which will be the bulk if n is large. Dr. Sarmad Abbasi () Theory of Computation 21 / 33

Big O notation In fact 5n 3 the constant 5 does not contribute to the growth of this function. Thus we will say that f (n) is order n 3. We will denote this by Let us state this precisely: f (n) = O(n 3 ). Dr. Sarmad Abbasi () Theory of Computation 22 / 33

Big O notation Let f, g : N R +. We say that f (n) = O(g(n)) if there are positive integers c, n 0 such that for all n n 0 f (n) cg(n) When f (n) = O(g(n)) we say that g is an asymptotic upper-bound on f. Sometime we will just say that g is an upper bound on f. Dr. Sarmad Abbasi () Theory of Computation 23 / 33

Big O notation Intuitively if f (n) = O(g(n)) you can think that f is less than or equal to some multiple of g. For most functions the highest order term is is an obvious candidate to be g. Dr. Sarmad Abbasi () Theory of Computation 24 / 33

Big O notation Let Then Furthermore, But it is not true that f (n) = 13n 4 + 7n 2 + 13 f (n) = O(n 4 ) f (n) = O(n 5 ) f (n) = O(n 3 ) Dr. Sarmad Abbasi () Theory of Computation 25 / 33

Big O notation When we say that f (n) = O(g(n)) we are only claiming that g(n) is an asymptotic upper bound on f. It may not be the best one. Lets look at other examples. Dr. Sarmad Abbasi () Theory of Computation 26 / 33

Big O notation Suppose that where b is a constant. Note that f (n) = log b n log b n = log 2 n log 2 b. Hence we can say Let then f (n) = O(log n) f 2 (n) = 5n log n + 200n log log n + 17 f 2 (n) = O(n log n) Dr. Sarmad Abbasi () Theory of Computation 27 / 33

Big O notation We can use O notation in exponents also. Thus 2 O(n) stands for a function that is upper bounded by 2 cn for some constant c. We have to be careful though For example O(log n) 2 Well remember that O(log n) has a constant attached to it. Thus this is upper bounded by 2 c log n by some constant c. Now, we get 2 c log n = (2 log n ) c = n c Dr. Sarmad Abbasi () Theory of Computation 28 / 33

Big O notation Bounds of the form n c are called polynomial bounds. Where as bounds of the form 2 nc are called exponential bounds. Dr. Sarmad Abbasi () Theory of Computation 29 / 33

small o notation The Big O notation roughly says that f is upper bounded by g. Now we want to say f grows strictly slower that g. Let f, g : N R +. We say that f (n) = o(g(n)) if f (n) lim n g(n) = 0 Thus the ratio of f and g becomes closer and closer to 0. Dr. Sarmad Abbasi () Theory of Computation 30 / 33

small o notation 1 n = o(n) 2 n = o(n log log n) 3 n log log n = o(n log n) 4 n log n = o(n 2 ) 5 n 2 = o(n 3 ). Dr. Sarmad Abbasi () Theory of Computation 31 / 33

small o notation Lets look at a new TM that recognizes A = {0 k 1 k : k 0} 1 Scan the tape and make sure all the 0s are before 1s. 2 Repeat till there are 0s and 1 s on the tape. 3 Scan the tape and if the total number of 0 s and 1 s is odd reject. 4 Scan and cross of every other 0 and do the same with every other 1. 5 If all 0 s and 1 s are crossed accept. Thus if we have 13 0 s in the next stage there would be 6. Dr. Sarmad Abbasi () Theory of Computation 32 / 33

small o notation How much time does this TM take? O(n log n) Thus the time taken by this TM is o(n 2 ). Hence, this reflects a real algorithmic improvement. Dr. Sarmad Abbasi () Theory of Computation 33 / 33