Theory of Computation

Similar documents
Theory of Computation (IX) Yijia Chen Fudan University

1 Showing Recognizability

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

CS21 Decidability and Tractability

Theory of Computation

Theory of Computation

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

CSCE 551 Final Exam, Spring 2004 Answer Key

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

Computability Theory. CS215, Lecture 6,

Foundations of

CS151 Complexity Theory. Lecture 1 April 3, 2017

The Church-Turing Thesis

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Lecture Notes: The Halting Problem; Reductions

Theory of Computation

Decidability and Undecidability

Theory of Computation

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

Introduction to Turing Machines. Reading: Chapters 8 & 9

TURING MAHINES

CSE 105 THEORY OF COMPUTATION

Turing Machines. Lecture 8

CSCC63 Worksheet Turing Machines

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

Turing Machines, diagonalization, the halting problem, reducibility

UNRESTRICTED GRAMMARS

Further discussion of Turing machines

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

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

Decidability: Church-Turing Thesis

Most General computer?

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

CSCI3390-Assignment 2 Solutions

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

CSCI3390-Lecture 6: An Undecidable Problem

Theory of Computation

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

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

Introduction to Turing Machines

Computability and Complexity

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

Theory of Computation

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Turing Machines Part III

Time-bounded computations

CS 361 Meeting 26 11/10/17

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

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

Chapter 3: The Church-Turing Thesis

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

CpSc 421 Homework 9 Solution

A Note on Turing Machine Design

Reductions in Computability Theory

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

Computational Models Lecture 9, Spring 2009

1 Computational Problems

CS3719 Theory of Computation and Algorithms

Computational Models Lecture 8 1

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

Theory of Computation Lecture Notes. Problems and Algorithms. Class Information

Computational Models Lecture 8 1

Notes for Lecture Notes 2

CSCE 551 Final Exam, April 28, 2016 Answer Key

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

Lecture 12: Mapping Reductions

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

CSE 105 THEORY OF COMPUTATION

Theory of Computation

Turing Machine Recap

Introduction to Languages and Computation

V Honors Theory of Computation

CS6901: review of Theory of Computation and Algorithms

Exam Computability and Complexity

Turing Machines Part Three

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

CS4026 Formal Models of Computation

Turing Machine Variants

Computability Crib Sheet

Lecture 13: Foundations of Math and Kolmogorov Complexity

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

Complexity Theory Part II

Computational Models - Lecture 6

Computational complexity

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

Variants of Turing Machine (intro)

CSE 105 THEORY OF COMPUTATION

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

7.1 The Origin of Computer Science

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

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

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

CST Part IB. Computation Theory. Andrew Pitts

Lecture 16: Time Complexity and P vs NP

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

The Unsolvability of the Halting Problem. Chapter 19

Computational Models Lecture 8 1

Decidability: Reduction Proofs

Transcription:

Theory of Computation Lecture #6 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 39

Lecture 6: Overview Prove the equivalence of enumerators and TMs. Dovetailing Definition of Algorithm The Church-Turing Thesis. Encodings. Hilbert s 10th problem. Matijasevič s Theorem. Sarmad Abbasi (Virtual University) Theory of Computation 2 / 39

Enumerators Enumerator s are another model of computation. They do not take any input and only produce output. Let us define them formally: An enumerator E = (Q, Σ, Γ, q 0, δ). 1 Q is the set of states. 2 Σ is the output alphabet and #, Σ. 3 Γ is the work alphabet and Γ. 4 q 0 is the start state. 5 δ is the transition function. Well what is the domain and range of δ. δ : Q Γ Q Γ{L, R} (Σ {ɛ, #}) Sarmad Abbasi (Virtual University) Theory of Computation 3 / 39

Enumerators How does the a configuration of E look like: αqβ, w 1 #w 2 # w k 1 #x where α, β (Γ ) and x (Σ Σ #) Sarmad Abbasi (Virtual University) Theory of Computation 4 / 39

Enumerators Write the definition of the yields relation for enumerators. We say that E outputs a string w if it reaches a configuration αqβ, w 1 #w 2 w k 1 #w# Sarmad Abbasi (Virtual University) Theory of Computation 5 / 39

Enumerators L(E) the language enumerated by E is the set of all strings that it outputs. Sarmad Abbasi (Virtual University) Theory of Computation 6 / 39

Enumerators Last time we outlined a proof of the following theorem. A language L is Turing-recognizable if and only if some enumerator enumerates it. Sarmad Abbasi (Virtual University) Theory of Computation 7 / 39

Enumerators One side was easy: Let L be a language enumerated by an enumerator E. The L is Turing recognizable. To prove this we are given that an enumerator E enumerates L. We have to show that some Turing machine M accepts L. The informal description of the Turing machine is as follows: 1 Input x 2 Run the Enumerator E each time it outputs a string w check if w = x. If w = x go to accept state. Otherwise, continue. Sarmad Abbasi (Virtual University) Theory of Computation 8 / 39

Enumerators The other side was a bit tricky. But let us look at the details. If L is Turing recognizable then there is an enumerator E that enumerates L. Since L is Turing recognizable therefore some TM M accepts L. We can use M as a subroutine in our enumerator E. Here is our first attempt. Recall that we know how to generate strings in lexicographical order as ɛ, 0, 1, 00, 01, 10, 11,..., 1 For i = 1,..., 2 Simulate the machine M on x i 3 If M accepts x i output x i. Why is this wrong? Sarmad Abbasi (Virtual University) Theory of Computation 9 / 39

Enumerators Lets say 1 M accepts ɛ. 2 M rejects 0. 3 M accepts 1. 4 M loops forever on 00. 5 M accepts 01. Then the enumerator will never output 01. Whereas, 01 L. So, we have to get around this problem. Sarmad Abbasi (Virtual University) Theory of Computation 10 / 39

Dovetailing The solution is given by dovetailing: 1 For i = 1, 2, 3,..., 2 For j = 1, 2,..., i 3 Simulate M on x j for i steps only. 4 If M accepts x j output x j. Sarmad Abbasi (Virtual University) Theory of Computation 11 / 39

Dovetailing Suppose x t L. Then M accepts x t and it must accept x t is some finite number of steps. Lets say this number is k. Then we claim that when i = max(k, t) the string x t will be outputted. That is because M is simulated for on x 1,..., x i for i steps. Since, i t hence x t {x 1,..., x i } and since i k hence M will accept x t in k steps and x t will be outputted. Sarmad Abbasi (Virtual University) Theory of Computation 12 / 39

Dovetailing Hence all strings that are in L are enumerated by this enumerators. To see if x L then E will not enumerate it, we simply observe that E only enumerates strings that are accepted by M. Sarmad Abbasi (Virtual University) Theory of Computation 13 / 39

Dovetailing A minor point to notice is that E enumerates a given string many many times. If this bothers you, you can modify E so that it enumerates each string only once. Now, E keeps a list of all the strings it has enumerated and checks the list before enumerating every string if it has been enumerated before. Show that if L is Turing recognizable then there is an enumerator E that enumerates L. Furthermore, each string of L is enumerated by E exactly once. Sarmad Abbasi (Virtual University) Theory of Computation 14 / 39

Definition of an algorithm Intuitive notion of algorithms equals Turing machine algorithms Another way to put it: An algorithm is a Turing machine that halts on all inputs. An algorithm is a decider. Sarmad Abbasi (Virtual University) Theory of Computation 15 / 39

Church-Turing Thesis The Church-Turing thesis states that the intuitive notion of algorithms is equivalent to the mathematical concept of a Turing machine. It gives the formal definition for answering questions like Hilbert s tenth problem. Sarmad Abbasi (Virtual University) Theory of Computation 16 / 39

Encodings Note that we always take inputs to be strings over some alphabet Σ. Suppose Σ = {a, b, c, d} we can map 1 a to 00; that is e(a) = 00. 2 b to 01; that is e(a) = 01. 3 c to 10; that is e(a) = 10. 4 d to 01; that is e(a) = 11. This way we can encode any alphabet to {0, 1}. Note that this maps Σ to {0, 1} in a natural way. e(w 1 w 2... w n ) = e(w 1 )e(w 2 ) e(w n ). Sarmad Abbasi (Virtual University) Theory of Computation 17 / 39

Encodings Suppose we can define L Σ L e = {e(w) : w L}. Designing a TM for M or designing a TM for L e is equally difficult or easy. Sarmad Abbasi (Virtual University) Theory of Computation 18 / 39

Encodings We want to solve problems where the input is an interesting object such as a graph, or a matrix. However, our definitions only allow us inputs which are strings. But, this is usually not a restriction. Let us look at a few examples: L = {(i, j) : i 2 = j} (1, 1), (2, 4), (3, 9) are in L and (1, 3), (2, 5), (3, 1) are not in L. L is a subset of N N. Sarmad Abbasi (Virtual University) Theory of Computation 19 / 39

Encodings What we can do is to encode the pairs into strings. Let us say we reserve 11 to represent a 1, 00 to represent a 0 and 01 will be the separator. Then we can encode (2, 4) to 110001110000 We represent the encoding of a pair (i, j) by < (i, j) >. Then we can solve the following problem This is a language over {0, 1}. L = {< (i, j) >: i 2 = j} Sarmad Abbasi (Virtual University) Theory of Computation 20 / 39

Encodings Let us look at another example: D = {A : A is a n n with integer entires and det(a) = 0} Sarmad Abbasi (Virtual University) Theory of Computation 21 / 39

Encodings How can we encode this problem so that it becomes a language over {0, 1}. Lets say we have the matrix ( ) 2 5 3 6 Sarmad Abbasi (Virtual University) Theory of Computation 22 / 39

Encodings First we can write it as linearly as 2, 5, 3, 6. Now, we can write all the numbers in binary where 00 represents a 0, 11 represents a 1 and 01 represents the separator,. So ( ) 2 5 = 11000111001101111101111100 3 6 Sarmad Abbasi (Virtual University) Theory of Computation 23 / 39

Encodings Now, we can define the following language D = { A : A is a n n with integer entires and det(a) = 0} Sarmad Abbasi (Virtual University) Theory of Computation 24 / 39

Encodings Similarly we can encode graphs into strings: Let us do an example: Consider the graph shown in the following figure: Sarmad Abbasi (Virtual University) Theory of Computation 25 / 39

Encodings This graph can be written as a vertex list followed by an edge list as follows: 1 101 represents ). 2 110 represent (. 3 011 represents,. 4 000 represents 0 5 111 represents 1. (1, 2, 3, 4)((1, 2), (2, 3), (3, 1), (1, 4)). and now it is easy to encode this whole graph into a 0/1 string. The encoding starts as 110111011111000011111111011111 000000101110110111011111000101011110 which is very long but not conceptually difficult. Sarmad Abbasi (Virtual University) Theory of Computation 26 / 39

Encodings Thus suppose we have We can instead look at L = {G : G is connected }. L = { G : G is connected }. This should not be surprising for you. As computer scientist you know that everything inside a computer is represented by 0 s and 1 s. Sarmad Abbasi (Virtual University) Theory of Computation 27 / 39

Hilbert s Tenth Problem Recall from the first lecture: Hilbert s tenth problem was about diaphantine equations. Let us cast it in modern language. Devise an algorithm that would decide if a (multi-variate) polynomial has integral roots Here is an example of a multivariate polynomial: 6x 3 yz 2 + 3xy 2 x 3 10. Sarmad Abbasi (Virtual University) Theory of Computation 28 / 39

Hilbert s Tenth Problem Hilbert asked to study the language H = { p : p is a polynomial with integral roots}. Once again mean encodings. Is there a Turing machine M that halts on all inputs and L(M) = H Sarmad Abbasi (Virtual University) Theory of Computation 29 / 39

Matijasevič Theorem Theorem (Matijasevič 1970) H is not decidable. There is no Turing machine M that halts on all inputs with L(M) = H. Sarmad Abbasi (Virtual University) Theory of Computation 30 / 39

Matijasevič Theorem Let look at a simpler language: H 1 = { p : p is a polynomial in x and has an integral root} Lets see that H 1 is Turing decidable: Sarmad Abbasi (Virtual University) Theory of Computation 31 / 39

Matijasevič Theorem Here is the description of a TM 1 On input p. 2 for i = 0, 1, 2,..., 3 evaluate the polynomial on x = i and x = i. If it evaluates to 0 accept. Sarmad Abbasi (Virtual University) Theory of Computation 32 / 39

Matijasevič Theorem Note the the above machine is not a decider. It is only a recognizer. Show that H 1 is also Turing decidable. Sarmad Abbasi (Virtual University) Theory of Computation 33 / 39

How to describe a Turing machine There are three ways to do it. 1 formal description. 2 implementation description. 3 high-level description. Sarmad Abbasi (Virtual University) Theory of Computation 34 / 39

How to describe a Turing machine In a formal description you have to specify the whole TM using the 7-things needed. That is you have to specify (Q, Σ, Γ, q 0, q a, q r, δ). We have seen examples of this in the last two lectures. Sarmad Abbasi (Virtual University) Theory of Computation 35 / 39

How to describe a Turing machine Implementation description: In this you refer to the tapes of the Turing machine and explain how it moves and performs its task. Let look at an example A TM can be described as follows: L = {w#w : w {0, 1} }. 1 Scan the input and make sure it is of the form w 1 #w 2 where w 1, w 2 {0, 1}. Or in other words make sure there is only one # in the input. 2 Zigzag over the input matching symbols of w 1 and w 2. 3 If all symbols match then accept. If any symbol fails to match reject. Sarmad Abbasi (Virtual University) Theory of Computation 36 / 39

How to describe a Turing machine In a high level description we do not refer to the tapes. We simply describe the Turing machine as an algorithm. We simply give psuedo-code for the algorithm. Suppose we wish to show that L = { j : i 2 = j for some i}. A description of TM can be given as follows: 1 On input j. 2 For i = 1,..., j 3 check if i 2 = j if it is accept. 4 Reject Note that in this case, we are assuming many things. Sarmad Abbasi (Virtual University) Theory of Computation 37 / 39

How to describe a Turing machine We are assuming that we can build a machine (subroutine) that can multiply numbers, check for equality etc. Sarmad Abbasi (Virtual University) Theory of Computation 38 / 39

How to describe a Turing machine When you give a high-level description you must be convinced that you can convert it into a formal one in principle. Although it will take a very long time to do so. Sarmad Abbasi (Virtual University) Theory of Computation 39 / 39