CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Size: px
Start display at page:

Download "CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY"

Transcription

1 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY RYAN DOUGHERTY If we want to talk about a program running on a real computer, consider the following: when a program reads an instruction, the contents of the memory may change based on what the current memory contents were, and what the input is. In fact, we can conceive of a program as a state machine that has some sort of memory component. Turing Machines are a particular type of state-based model of computation. Specifically, a Turing machine (TM) has a finite control via states and an infinite tape. The first usage in the literature about TMs, oddly enough, comes from Turing s famous paper. 1 In this class, our basic model will have a tape that is infinite only in one direction. A Turing machine starts up with the input string written at the left end of the tape. The rest of the tape is filled with a special blank character (i.e., ). Initially, the head is located at the first tape position and the start state of the machine. Thus, the initial configuration of a Turing machine for the input cse355 is as follows. Tape: c s e Read/Write tape head Each step of the Turing machine first reads the symbol on the cell of the tape under the head. Depending on the symbol and the current state of the controller, it then writes a symbol at the current tape position, moves either left or right, and changes state. For example, the following transition is taken if the controller is in state q and the symbol under the read head is c. It replaces the c with the character f and then moves right, switching the controller to state r. We will design Turing machines to be deterministic. That is, once we know the state and which symbol is under the read/write head, there is exactly one choice for what the machine can (and must) do. This leads to the interesting observation that since there is always a transition to do, then the machine will run forever; in the definition, we will handle when the machine should stop. For now, we proceed with an example. Date: Last Updated July 11, Turing, Alan Mathison. On computable numbers, with an application to the Entscheidungsproblem. Proceedings of the London mathematical society 2.1 (1937): No, he did not call them Turing machines. 1

2 2 RYAN DOUGHERTY Example 1. Consider the language Let s describe a TM for L. L = {0 n $0 n : n 0}, Definition 1. A Turing Machine (TM) is a 7-tuple (Q, Σ, Γ, δ, q 0, q accept, q reject ) where: Q is a finite set of states; Σ Γ is a finite input alphabet; Γ is a finite tape alphabet which contains a symbol / Σ; δ : (Q \ {q accept, q reject }) Γ Q Γ {L, R} is the transition function; q 0 Q is the start state; q accept Q is the accept state; q reject Q with q accept q reject is the reject state. For a TM, the input provided to the TM is on an infinite one-way tape, leftadjusted. We now define what it means for a TM to accept (or reject) a given input. Example 2. Can you determine the language of this TM?

3 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 3 x R 0 L R, 1 R x R,1 R 0 L x L 0, R 1 x, R L q 1 q 2 q 3 q 5 R x R 1 R R 0 R q reject q accept q 4 0 x, R x R 1 L R Exercise: show that the above TM always halts on any input. Another nice exercise: given an input of length n, what is the run-time of the above TM in terms of n? Definition 2. A configuration C of a TM currently in state q and tape contents s 1 s k and observing tape cell i is the string s 1 s i 1 qs i s k. Definition 3. A computation of a TM M on input w is a sequence of configurations C 0, C 1, C s where: C 0 is the starting configuration (i.e., its state is q 0 ) C i is obtained from C i 1 by a single transition of M for all i (often said that C i 1 yields C i ). Suppose that the original state is q and goes to state q. (1) C i 1 = s 1 s i 1 qs i s i+1 s k and the next transition moves right and writes symbol b, then C i = s 1 s i 1 bq s i+1 s k. (2) C i 1 = s 1 s k 1 qs k and the next transition moves right and writes symbol b, then C i = s 1 s k 1 bq. (3) C i 1 = s 1 s i 2 s i 1 qs i s k and the next transition moves left and writes symbol b, then C i = s 1 s i 2 q s i 1 b s k. A computation is accepting if the last configuration contains q accept, and is rejecting if it contains q reject. Definition 4. The language recognized by M, L(M), is the set of all strings w such that M has an accepting computation on w. A language is Turing-recognizable (or recognizable) if there is some TM that recognizes it. Unfortunately, it may be possible for a TM to run forever. We will make a distinction now about TMs that can run forever and the ones that do not: Definition 5. A TM is a decider if it halts on all inputs (i.e., doesn t run forever, and says accept or reject in a finite amount of time). A language L is Turingdecidable (or decidable) if some decider has language L. Some languages that are decidable are: Σ

4 4 RYAN DOUGHERTY Any finite language The language {0 n $0 n : n 0} from earlier. The language of the machine in Example 2. Theorem 1. Any decidable language L is also recognizable. Proof. Follows from the definition. It will turn out that the converse is not true (i.e., there are recognizable languages that are not decidable). Like writing assembly language explicitly, it is a good idea to do it once or a few times to get the general understanding of how it works; but after that, it is much more convenient and useful to stay in a higher-level programming language. The same is true here, we will write high-level descriptions of TMs moving forward (unless specific details are needed): Example 3. Let L 1 = {0 2n : n 0} ( powers of 2 ). Here is a high-level description of a TM to decide L 1 : M = On input w: (1) Sweep left and right across the input, crossing off every other 0 (by writing a character x). (2) If in step 1 we only find a single 0, accept. (3) If in step 1 we find more than one 0 and the number of 0s was odd, reject. (4) Return the tape head to the left end of the tape, and go back to Step 1. Piazza Question 1. Let L 2 = {a i b j c k : i j = k}. Make a TM that decides L 2. Example 4. Let L 3 = {#w 1 #w 2 # #w k # : w i {0, 1}, i j w i w j }. Here is a high-level description of a TM to decide L 3 : M = On input w: (1) If the leftmost tape symbol is, accept. If it is not #, reject. If it is #, mark it. (2) Scan right to the next # and place a marker on it (with a special symbol indicating so); if not found, accept. (3) Zig-zag across the adjacent strings to the marked # symbol to check for equality (by marking symbols in each). If the strings are the same, reject. If not, then restore the strings without marked symbols. (4) Move to the next pair of strings by moving the second # marker. If none found, move the first marker forward to the next #, and the second # marker the one after that. If none is found, accept. (5) Go back to Step 3. Piazza Question 2. Are L 1, L 2, L 3 decidable? Now we make characterizations as to what languages are decidable or recognizable. When a class of languages C has the property that for any L 1, L 2 C and a specific operation has that L 1 L 2 C, then we say that C is closed under. Theorem 2. Let L 1, L 2 be recognizable (resp. decidable) languages. Then L 1 L 2, L 1 L 2, L 1 L 2, L 1 are recognizable (resp. decidable) languages. If L 1 is decidable, then L 1 is also decidable.

5 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 5 Showing the above theorem will have that the recognizable (and decidable) languages are closed under intersection, union, concatenation, and star. Furthermore, decidable languages are closed under complement. Proof: Piazza Question 3. Why does the above idea not work to show recognizable languages are closed under complement? There is a characterization between recognizable and decidable languages: Theorem 3. L is decidable if and only if L is recognizable and L is recognizable. Proof:

6 6 RYAN DOUGHERTY 1. TM Variants To show evidence for why TMs are a good model for our everyday use of computers, we want to show that for any reasonable modification to the definition of a TM, that it is equivalent to the standard definition. By this, we want to show that a normal TM can decide/recognize a language if and only if the variant can decide/recognize it. When this happens, we say that the variant is equivalent to the standard model. Example 5. A stay-put TM (STM) is one that can move left or right, but also stay put and not move the tape head. Formally, its transition function is δ : Q Γ Q Γ {L, R, S}, and the next configuration has the tape head at the same location. Theorem 4. STMs are equivalent to TMs. Proof. A STM can simulate a TM (it just has no stay-put transitions). For the other direction, it suffices to show we can simulate a stay-put transition with only left/right transitions. We can do this by moving right, then moving left, without changing the symbol on the right. Example 6. A multitape TM is one that has a fixed number k of tapes that all operate independently. A transition moves all of the tapes, but we also allow for the tape heads to stay put instead of moving left or right. Theorem 5. Multitape TMs are equivalent to TMs. Proof: it s clear that a multitape TM can simulate a normal TM, since it only uses one tape (the multitape TM can do whatever it wants on the other tapes). So we show how to simulate a multitape TM using a normal TM: Example 7. Nondeterminism is where the TM has multiple choices it can make for transitions, it picks the correct one, and continues from there. Formally, nondeterminism means that if there is a choice that will eventually lead to acceptance, the TM will pick that choice (and if not, it makes an arbitrary choice).

7 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 7 Formally, the transition function is: δ : Q Γ P(Q Γ {L, R}). Theorem 6. Nondeterministic TMs (NTMs) are equivalent to TMs. Proof: it s clear that a NTM can simulate an arbitrary TM (it isn t required to use multiple choices for transitions). Now we show that a TM can simulate an arbitrary NTM: Definition 6. A TM M is an enumerator for a language L if M, starting with empty tape, lists out strings in L so that for any string w L, M will eventually print out w. A language L is enumerable if there is an enumerator for L. Piazza Question 4. Give an enumerator for Σ (as a high-level algorithm).

8 8 RYAN DOUGHERTY You may wonder if there is a relation between enumerable languages and decidable/recognizable ones. In fact, there is: Theorem 7. A language L is enumerable if and only if L is recognizable. Proof. We prove this in both directions: 2. Church-Turing Thesis One of the very interesting aspects of Turing Machines is that they do compute and solve the same problems as what we can with everyday computers. This was established through the works of Alonzo Church and Alan Turing in the 1930s, which essentially stated the following: The languages decided by Turing Machines are exactly those that correspond to an intuitive computer algorithm. Piazza Question 5. This is not a theorem that can be proven why? Let s establish why this statement is true, however:

9 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 9 So in fact, if we have a language L we are interested in, and show that it is undecidable for Turing Machines, the Church-Turing thesis says that that is impossible to write an algorithm for on a computer. 3. Undecidability of Problems We have seen several examples of languages that are decidable (and hence recognizable). Here, we show that certain problems are undecidable. The main result we will show is the following: Theorem 8. Let A T M = { M, w : M is a TM and M accepts w}. Then A T M is undecidable. We proceed in steps. Theorem 9. A T M is recognizable. Remember that a recognizer only has to halt on the strings M, w that are in A T M, not guarantee to halt on these inputs that are not (a decider has to halt on both these cases). Proof:

10 10 RYAN DOUGHERTY Theorem 10. A T M is a recognizable, but not decidable language. Proof: So how do we go about proving that A T M is undecidable? We will proceed with proof by contradiction; i.e., we start with a supposed TM that decides A T M, and then we will at some point derive a contradiction. First, a high-level overview. Consider the language { M : M is a TM with at least 7 states}. Note that this is decidable; why? Because we can look through the input TM given and count the states, and accept iff this number is at least 7. So TMs can in fact answer questions about other TMs. Now onto the proof.

11 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 11 But we also prove a striking result between decidable and recognizable languages: Theorem 11. L is decidable if and only if L and L are recognizable. Proof: Piazza Question 6. What can we conclude about A T M? Using the undecidable result of A T M, we can in fact show that some other languages are also undecidable through reductions. Definition 7. A reduction from A to B, written A B, is a computable (i.e., finite time to compute) function f : Σ Σ such that x A if and only if f(x) B. Theorem 12. If A B and B is decidable (resp. recognizable), then A is decidable (resp. recognizable). If A B and A is undecidable (resp. unrecognizable), then B is undecidable (resp. unrecognizable). Proof. The second is the contrapositive of the first, and hence is equivalent.

12 12 RYAN DOUGHERTY We now apply reductions to show that other languages are undecidable: Theorem 13. E T M = { M : M is a TM and L(M) = } is undecidable. Proof. Suppose E decides E T M. We now make a decider for A T M as follows: It would be useful in programming (such as a grader for a course of that nature) to determine if a given program is equivalent to the sample solution you have; i.e., it has the same behavior on all inputs. Unfortunately, deciding whether this is true is impossible: Theorem 14. EQ T M = { M 1, M 2 : M 1, M 2 are TMs and L(M 1 ) = L(M 2 )} is undecidable. Proof. We construct a reduction E T M EQ T M.

13 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 13 Piazza Question 7. What about ALL T M = { M : L(M) = Σ }? 4. Rice s Theorem The above undecidability proofs make it seem as though there is a general theme underlying them: we construct a new TM that has different behaviors based on what the input is. For example, for A T M E T M the machine we constructed had nonempty language if and only if M accepts w. In fact, there is something more general that can be said, which is Rice s theorem. Definition 8. A property of TM languages P is a language of TM descriptions such that if M 1, M 2 are arbitrary TMs with L(M 1 ) = L(M 2 ), then either: (1) M 1, M 2 P, or (2) M 1, M 2 / P. In other words, the language of TM descriptions is of the form { M : M is a TM and L(M) has some property}. If we have two machines with the same language, then it cannot be the case that one of them has the property (is in the language), and the other does not have the property (is not in the language). Definition 9. A property of TM languages P is nontrivial if there exist TMs M 1, M 2 such that M 1 P, M 2 / P. Now we can prove Rice s theorem. Theorem 15 (Rice s Theorem). Every nontrivial property of TM languages is undecidable. As a corollary, we immediately can prove, using the theorem, that E T M is undecidable. Proof. Let P be such a nontrivial property, and we will show A T M P.

14 14 RYAN DOUGHERTY 5. LBAs We consider the restriction of TMs where we can only use the tape where the input is initially given. Formally, if the input is w 1 w n, the tape contents are w 1 w n, where, are special characters to help determine when the tape head is at the beginning or the end of the tape. Also, the TM is not allowed to write, anywhere other than the beginning and end. This type of machine is called a linear bounded automaton (LBA), and other than the tape, behaves identically to a standard TM. The use of such an object would be that we restrict the amount of space used, such as if we are dealing with a large data set and cannot afford more space than what we are given. One may ask the question of whether LBAs decide/recognize the same languages as TMs. In fact, they are different! 2 Hopefully we get to time complexity where we can prove using a powerful theorem there. And the following theorem certifies that this must be true for recognizable languages, but not necessarily decidable ones. Theorem 16. A LBA = { M, w : M is an LBA and M accepts w} is decidable. Proof. Suppose M has n states, q tape symbols, and the input w has length g. But they behave similarly to TMs with regards to emptiness: Theorem 17. E LBA is undecidable. Proof. Let an accepting computation history (ACH) for a given TM M (yes, I mean TM) and input w to be a string #C 0 #C 1 # #C m # where C 0 is a start configuration, C m is an accepting computation, and C i is obtained from C i 1 via a single transition. Consider the language, for a given M and w, L M,w = {w : w is an accepting computation history of M on w}. 2 If you re interested, the languages of LBAs are called context-sensitive languages, named for a completely different reason than LBAs.

15 CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 15 This seems to suggest that even restricting to just the input for space is not very useful, in the sense that we cannot even determine whether or not an LBA actually accepts anything! We would like to have a model that is maybe not as computationally powerful as an LBA, but we can get potentially many more problems that we could solve. Piazza Question 8. What about EQ LBA?

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

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger

More information

Chapter 3: The Church-Turing Thesis

Chapter 3: The Church-Turing Thesis Chapter 3: The Church-Turing Thesis 1 Turing Machine (TM) Control... Bi-direction Read/Write Turing machine is a much more powerful model, proposed by Alan Turing in 1936. 2 Church/Turing Thesis Anything

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser Ch 3 Trace the computation of a Turing machine using its transition function and configurations.

More information

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

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

Computability Theory. CS215, Lecture 6,

Computability Theory. CS215, Lecture 6, Computability Theory CS215, Lecture 6, 2000 1 The Birth of Turing Machines At the end of the 19th century, Gottlob Frege conjectured that mathematics could be built from fundamental logic In 1900 David

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

The Church-Turing Thesis

The Church-Turing Thesis The Church-Turing Thesis Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/

More information

CSCC63 Worksheet Turing Machines

CSCC63 Worksheet Turing Machines 1 An Example CSCC63 Worksheet Turing Machines Goal. Design a turing machine, M that accepts only strings of the form {w#w w {0, 1} }. Idea. Describe in words how the machine would work. Read first symbol

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2018 http://cseweb.ucsd.edu/classes/sp18/cse105-ab/ Today's learning goals Sipser Ch 5.1, 5.3 Define and explain core examples of computational problems, including

More information

A Note on Turing Machine Design

A Note on Turing Machine Design CS103 Handout 17 Fall 2013 November 11, 2013 Problem Set 7 This problem explores Turing machines, nondeterministic computation, properties of the RE and R languages, and the limits of RE and R languages.

More information

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA Turing Machines A Turing machine is similar to a finite automaton with supply of unlimited memory. A Turing machine can do everything that any computing device can do. There exist problems that even a

More information

Computation Histories

Computation Histories 208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation

More information

1 Showing Recognizability

1 Showing Recognizability CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove

More information

CS4026 Formal Models of Computation

CS4026 Formal Models of Computation CS4026 Formal Models of Computation Turing Machines Turing Machines Abstract but accurate model of computers Proposed by Alan Turing in 1936 There weren t computers back then! Turing s motivation: find

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

TURING MAHINES

TURING MAHINES 15-453 TURING MAHINES TURING MACHINE FINITE STATE q 10 CONTROL AI N P U T INFINITE TAPE read write move 0 0, R, R q accept, R q reject 0 0, R 0 0, R, L read write move 0 0, R, R q accept, R 0 0, R 0 0,

More information

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

More Turing Machines. CS154 Chris Pollett Mar 15, 2006. More Turing Machines CS154 Chris Pollett Mar 15, 2006. Outline Multitape Turing Machines Nondeterministic Turing Machines Enumerators Introduction There have been many different proposals for what it means

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

More information

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

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite The Church-Turing Thesis CS60001: Foundations of Computing Science Professor, Dept. of Computer Sc. & Engg., Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q 0, q accept, q reject ), where

More information

1 Unrestricted Computation

1 Unrestricted Computation 1 Unrestricted Computation General Computing Machines Machines so far: DFAs, NFAs, PDAs Limitations on how much memory they can use: fixed amount of memory plus (for PDAs) a stack Limitations on what they

More information

Most General computer?

Most General computer? Turing Machines Most General computer? DFAs are simple model of computation. Accept only the regular languages. Is there a kind of computer that can accept any language, or compute any function? Recall

More information

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

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 8 Nancy Lynch Today More undecidable problems: About Turing machines: Emptiness, etc. About

More information

Turing Machines, diagonalization, the halting problem, reducibility

Turing Machines, diagonalization, the halting problem, reducibility Notes on Computer Theory Last updated: September, 015 Turing Machines, diagonalization, the halting problem, reducibility 1 Turing Machines A Turing machine is a state machine, similar to the ones we have

More information

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

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman Equivalence of TMs and Multitape TMs Theorem 3.13 and Corollary 3.15 By: Joseph Lauman Turing Machines First proposed by Alan Turing in 1936 Similar to finite automaton, but with an unlimited and unrestricted

More information

Homework Assignment 6 Answers

Homework Assignment 6 Answers Homework Assignment 6 Answers CSCI 2670 Introduction to Theory of Computing, Fall 2016 December 2, 2016 This homework assignment is about Turing machines, decidable languages, Turing recognizable languages,

More information

Non-emptiness Testing for TMs

Non-emptiness Testing for TMs 180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to

More information

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

More information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

More information

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 8 January 24, 2018 Outline Turing Machines and variants multitape TMs nondeterministic TMs Church-Turing Thesis So far several models of computation finite automata

More information

Decidability and Undecidability

Decidability and Undecidability Decidability and Undecidability Major Ideas from Last Time Every TM can be converted into a string representation of itself. The encoding of M is denoted M. The universal Turing machine U TM accepts an

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 4.2 Trace high-level descriptions of algorithms for computational problems. Use

More information

Turing Machines Part III

Turing Machines Part III Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

More information

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility)

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility) CS5371 Theory of Computation Lecture 15: Computability VI (Post s Problem, Reducibility) Objectives In this lecture, we introduce Post s correspondence problem (playing with a special type of domino) We

More information

16.1 Countability. CS125 Lecture 16 Fall 2014

16.1 Countability. CS125 Lecture 16 Fall 2014 CS125 Lecture 16 Fall 2014 16.1 Countability Proving the non-existence of algorithms for computational problems can be very difficult. Indeed, we do not know how to prove P NP. So a natural question is

More information

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction) CS5371 Theory of Computation Lecture 14: Computability V (Prove by Reduction) Objectives This lecture shows more undecidable languages Our proof is not based on diagonalization Instead, we reduce the problem

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cse.yorku.ca/course/2001 11/7/2013 CSE

More information

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

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators

More information

Lecture Notes: The Halting Problem; Reductions

Lecture Notes: The Halting Problem; Reductions Lecture Notes: The Halting Problem; Reductions COMS W3261 Columbia University 20 Mar 2012 1 Review Key point. Turing machines can be encoded as strings, and other Turing machines can read those strings

More information

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

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility

More information

Decidable Languages - relationship with other classes.

Decidable Languages - relationship with other classes. CSE2001, Fall 2006 1 Last time we saw some examples of decidable languages (or, solvable problems). Today we will start by looking at the relationship between the decidable languages, and the regular and

More information

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties More About Turing Machines Programming Tricks Restrictions Extensions Closure Properties 1 Overview At first, the TM doesn t look very powerful. Can it really do anything a computer can? We ll discuss

More information

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

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) 1 Deterministic Turing Machine (DTM).. B B 0 1 1 0 0 B B.. Finite Control Two-way, infinite tape, broken into

More information

ECS 120 Lesson 15 Turing Machines, Pt. 1

ECS 120 Lesson 15 Turing Machines, Pt. 1 ECS 120 Lesson 15 Turing Machines, Pt. 1 Oliver Kreylos Wednesday, May 2nd, 2001 Before we can start investigating the really interesting problems in theoretical computer science, we have to introduce

More information

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

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harry Lewis October 22, 2013 Reading: Sipser, 3.2, 3.3. The Basic Turing Machine The Basic Turing Machine a a b a

More information

Lecture 12: Mapping Reductions

Lecture 12: Mapping Reductions Lecture 12: Mapping Reductions October 18, 2016 CS 1010 Theory of Computation Topics Covered 1. The Language EQ T M 2. Mapping Reducibility 3. The Post Correspondence Problem 1 The Language EQ T M The

More information

Chapter 7 Turing Machines

Chapter 7 Turing Machines Chapter 7 Turing Machines Copyright 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 A General Model of Computation Both finite automata and pushdown automata are

More information

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CS154, Lecture 10: Rice s Theorem, Oracle Machines CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive

More information

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory

More information

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

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

More information

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb) We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb) CS /55 Theory of Computation The is A TM = { M,w M is a TM and w L(M)} A TM is Turing-recognizable. Proof Sketch:

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 13 CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 4.1, 5.1 Define reductions from one problem to another. Use reductions to prove

More information

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

More information

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

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

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018 CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts

More information

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement: Decidability 2017/10/31 Chapter 4.1 in Sipser Ø Announcement: q q q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/decidability.pdf Happy Hollaween! Delayed

More information

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

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012 Decision Problems with TM s Look at following sets: Lecture 31: Halting Problem CSCI 81 Spring, 2012 Kim Bruce A TM = { M,w M is a TM and w L(M)} H TM = { M,w M is a TM which halts on input w} TOTAL TM

More information

Decidability (What, stuff is unsolvable?)

Decidability (What, stuff is unsolvable?) University of Georgia Fall 2014 Outline Decidability Decidable Problems for Regular Languages Decidable Problems for Context Free Languages The Halting Problem Countable and Uncountable Sets Diagonalization

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

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

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

More information

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 CS 373: Theory of Computation Sariel Har-Peled and Madhusudan Parthasarathy Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 This lecture covers Rice s theorem, as well as

More information

Computability Crib Sheet

Computability Crib Sheet Computer Science and Engineering, UCSD Winter 10 CSE 200: Computability and Complexity Instructor: Mihir Bellare Computability Crib Sheet January 3, 2010 Computability Crib Sheet This is a quick reference

More information

Foundations of

Foundations of 91.304 Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin dm@cs.uml.edu With some modifications by Prof. Karen Daniels, Fall 2012

More information

CSCI3390-Assignment 2 Solutions

CSCI3390-Assignment 2 Solutions CSCI3390-Assignment 2 Solutions due February 3, 2016 1 TMs for Deciding Languages Write the specification of a Turing machine recognizing one of the following three languages. Do one of these problems.

More information

Turing machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 30 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 25 November 2016 1 / 17 The Chomsky hierarchy: summary Level Language

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with

More information

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5. CSCC63 Worksheet Reducability For your reference, A T M is defined to be the language { M, w M accepts w}. 1 Reducability Theorem 5.1 HALT TM = { M, w M is a T M that halts on input w} is undecidable.

More information

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

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Computation History A computation history of a TM M is a sequence of its configurations C 1, C 2,, C l such

More information

CS 525 Proof of Theorems 3.13 and 3.15

CS 525 Proof of Theorems 3.13 and 3.15 Eric Rock CS 525 (Winter 2015) Presentation 1 (Week 4) Equivalence of Single-Tape and Multi-Tape Turing Machines 1/30/2015 1 Turing Machine (Definition 3.3) Formal Definition: (Q, Σ, Γ, δ, q 0, q accept,

More information

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

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 15 Ana Bove May 17th 2018 Recap: Context-free Languages Chomsky hierarchy: Regular languages are also context-free; Pumping lemma

More information

problem X reduces to Problem Y solving X would be easy, if we knew how to solve Y

problem X reduces to Problem Y solving X would be easy, if we knew how to solve Y CPS220 Reducibility A reduction is a procedure to convert one problem to another problem, in such a way that a solution to the second problem can be used to solve the first problem. The conversion itself

More information

Reducability. Sipser, pages

Reducability. Sipser, pages Reducability Sipser, pages 187-214 Reduction Reduction encodes (transforms) one problem as a second problem. A solution to the second, can be transformed into a solution to the first. We expect both transformations

More information

CSE 105 Theory of Computation

CSE 105 Theory of Computation CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Undecidability Today s Agenda Review and More Problems A Non-TR Language Reminders and announcements: HW 7 (Last!!)

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 28 Alexis Maciel Department of Computer Science Clarkson University Copyright c 28 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

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

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

Turing Machines (TM) The Turing machine is the ultimate model of computation.

Turing Machines (TM) The Turing machine is the ultimate model of computation. TURING MACHINES Turing Machines (TM) The Turing machine is the ultimate model of computation. Alan Turing (92 954), British mathematician/engineer and one of the most influential scientists of the last

More information

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

CS 125 Section #10 (Un)decidability and Probability November 1, 2016 CS 125 Section #10 (Un)decidability and Probability November 1, 2016 1 Countability Recall that a set S is countable (either finite or countably infinite) if and only if there exists a surjective mapping

More information

Turing Machines Decidability

Turing Machines Decidability Turing Machines Decidability Master Informatique 2016 Some General Knowledge Alan Mathison Turing UK, 1912 1954 Mathematician, computer scientist, cryptanalyst Most famous works: Computation model («Turing

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Decidability, Undecidability and Reducibility; Codes, Algorithms and Languages CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario,

More information

CSCI3390-Lecture 6: An Undecidable Problem

CSCI3390-Lecture 6: An Undecidable Problem CSCI3390-Lecture 6: An Undecidable Problem September 21, 2018 1 Summary The language L T M recognized by the universal Turing machine is not decidable. Thus there is no algorithm that determines, yes or

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4 Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

More information

Chapter 8. Turing Machine (TMs)

Chapter 8. Turing Machine (TMs) Chapter 8 Turing Machine (TMs) Turing Machines (TMs) Accepts the languages that can be generated by unrestricted (phrase-structured) grammars No computational machine (i.e., computational language recognition

More information

Decidability. William Chan

Decidability. William Chan Decidability William Chan Preface : In 1928, David Hilbert gave a challenge known as the Entscheidungsproblem, which is German for Decision Problem. Hilbert s problem asked for some purely mechanical procedure

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Spring 27 Alexis Maciel Department of Computer Science Clarkson University Copyright c 27 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand

More information

Variants of Turing Machine (intro)

Variants of Turing Machine (intro) CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples, Turing-recognizable and Turing-decidable languages Variants of Turing Machine Multi-tape Turing machines, non-deterministic

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2012 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/2001 11/13/2012 CSE

More information

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

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff Decidability Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff 1 A property P of strings is said to be decidable if the set of all strings having property P is a recursive set; that

More information