Computability and Complexity

Size: px
Start display at page:

Download "Computability and Complexity"

Transcription

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

2 Some Denitions The problem is decidable if there is an algorithm that takes an instance of the problem and determines in a nite number of steps that instance is YES or NO. The problem is undecidable is such an algorithm does not exist. Formally, a problem is decidable if the language associated with problem is recursive. Why, and what does it mean? Ryszard Janicki Computability and Complexity 2 / 34

3 Decidable Problems Let L be a regular or context-free language. 1 The problem if x L is decidable. 2 The problem if L = is decidable. 3 The problem if L = is decidable. 4 The problem if 0 < L < is decidable. Ryszard Janicki Computability and Complexity 3 / 34

4 Reducibility How to show that a problem is undecidable? How to show that an algorithm does not exists? Maybe it just has not been invented yet? Suppose that somehow it was proven that a problem A is not decidable. I have a problem B to consider and I suspect B is not decidable. I try to prove the following result: Any algorithm that solves B can be modied in such a way that it solves A. But A is undecidable, so no algorithm to solve A do exist! Hence B is also undecidable. A is reduced to B! B is decidable = A is decidable. A is undecidable = B is undecidable. Ryszard Janicki Computability and Complexity 4 / 34

5 Denition (Post Correspondence Problem) Let Σ be an alphabet and A, B are two lists of sequences over Σ, i.e. A = w 1,..., w k, B = x 1,..., x k, x i, w i Σ. Does there exist any sequence of integers i 1, i 2,..., i m, m 1, such that w i1 w i2... w im = x i1 x i2... x im? The above part is blue is called `Post Property'. Theorem The Post Correspondence Problem is undecidable if Σ 2. Example w 1 = a, w 2 = abaaa, w 3 = ab x 1 = aaa, x 2 = ab, x 3 = b m = 4, i 1 = 2, i 2 = 1, i 3 = 1, i 4 = 3 w 2 w 1 w 1 w 3 = abaaaaaab = x 2 x 1 x 1 x 3 so these two lists have the Post property. Ryszard Janicki Computability and Complexity 5 / 34

6 The trick is to nd some problem that is undecidable, at least one, then we can use REDUCTION. Theorem Let L 1, L 2 be context-free grammars over Σ such that Σ 2. Then the? problem L 1 L 2 = is undecidable. Proof. Assume it is decidable. Consider A = x 1,..., x n, B = y 1,..., y n, x i, w i Σ, c, d, e / Σ. Dene f : {1,..., } de as: f (i) = de i = d e... e. }{{} i times Dene G x = ({σ x }, Σ, σ x, P x ), where Σ = Σ {d, c, e}, and σ x f (1)σ x x 1 f (2)σ x x 2... f (n)σ x x n c and dene G y = ({σ y }, Σ, σ y, P y ), σ y f (1)σ y y 1 f (2)σ y y 2... f (n)σ y y n c. Note that L(G x ) L(G y ) = lists A and B have Post property. Hence any algorithm for nding L 1 L 2 = will solve the Post Correspondence Problem, which is undecidable! Ryszard Janicki Computability and Complexity 6 / 34

7 How to nd this rst undecidable problem? How should we think? Some ideas: Every nite entity can be described as a string. Every book is a string. Jorge Luis Borges, Babel Library, 1941 Each book consists of 409 pages; each page 40 lines; each line about 80 letters of black colour... There is no two identical books in the library Library is total... It describes everything and in all languages. Everything: detailed history of the past... Every book in Borges library is a string. L = all books in Borges library, L is nite! Ryszard Janicki Computability and Complexity 7 / 34

8 All Turing machines may be coded as strings. All congurations of a given Turing machines can be coded as strings. We just need to code the current state, current state position, perhaps current tape number, etc. Each primitive recursive or recursive function is fully described by its derivation which can be coded as a string. For example: add(x, 0) = x add(x, y + 1) = s(sdd(x, y)) can be coded as: #add(x, 0) = x#add(x, y + 1) = s(sdd(x, y)), which is a string over Σ, where Σ = {,, #, a, d, x, 0, (, ), y, +, 1, s}. Algorithm does not exist if its code does not exists! Ryszard Janicki Computability and Complexity 8 / 34

9 Languages Dened by Problems For any concept C (i.e. graph, primitive recursive function, Turing machine, etc.), C denotes a code of C. Details of coding are not important, but we assume its existence, and one coding technique for a given concept. C is a string of symbols, i.e. C Σ for some nite Σ. A = { G G is a connected undirected graph } B = { PR PR is a primitive recursive function} Both A and B are languages, i.e. A Σ A, B Σ B, where Σ A, Σ B are alphabets of codings. Ryszard Janicki Computability and Complexity 9 / 34

10 Denition (Another Decidability) Problem P is decidable i the language A P = { P P} is Turing-decidable. Example Assumption Turing machines understand codings A DFA = { B, w B is deterministic automaton that accepts w } B, w is a code of deterministic nite state automaton that accepts input strings w. Proposition A DFA is Turing-decidable. Proof. Turing machine simulate B on w, if B ends in its nal state, Turing machine accepts, otherwise Turing machine rejects. Ryszard Janicki Computability and Complexity 10 / 34

11 A REX = { R, w R is a regular expression that generates w } Proposition A REX is Turing-decidable. Proof. Using standard vocabulary: the problem: `if a given regular expression R generates a string w is decidable. Turing machine takes R and w as input. It converts R into non-deterministic automaton and next into deterministic automaton. Then it simulates the obtained deterministic automaton on w. If simulations ends in nal state, it accepts, otherwise it rejects. Decidability of problems Turing Decidability of languages of their codings. Ryszard Janicki Computability and Complexity 11 / 34

12 A CFG = { G, w G is a context-free grammar that generates w } Proposition A CFG is Turing-decidable. Proof. Turing machine takes G and w as input. It converts G into Chomsky normal form (with ε here). Next Turing machine list all derivations with 2n 1 steps, where n = w, unless n = 0, where all derivations with one step are given. Now Turing machine checks all these derivations, if one of them deriver w, then accept, otherwise reject. Ryszard Janicki Computability and Complexity 12 / 34

13 ? - maybe A L1 L 1 = { L 1, L 2 L 1, L 2 are context-free and L 1 L 2 = }? Ryszard Janicki Computability and Complexity 13 / 34

14 A TM = { M, w M is a Turing Machine and M accepts w } Theorem A TM is undecidable. Theorem A TM is recognizable. Proof. Let U be a Turing machine (called universal Turing machine), that takes M and w as input. Next U simulates M on w, and, if M accepts, the U accepts, if M rejects, then U rejects. But U loops when M loops, so U cannot decide A TM The construction of universal Turing machine is intuitively obvious: rst copy, then execute. Ryszard Janicki Computability and Complexity 14 / 34

15 Problem: We know that A B. How can we show that A B? Method 1 (explicit) We just construct x such that x B but x / A. Method 2 (implicit) Suppose that A and B are nite and suppose that we can calculate A and B. Then, B > A = B A. What if A and B are innite? Ryszard Janicki Computability and Complexity 15 / 34

16 Countable and Uncountable sets Let N = {1, 2, 3,...} be the set of `natural numbers'. Denition A set X is countable i it is nite or there is a one-to-one function f : N X. Proposition (Basic Properties) Assume A, B are countable. Then A B is countable. A B is countable. A B is countable. If A B and B is countable, then A is countable. Denition A set X is uncountable i it is not countable. Ryszard Janicki Computability and Complexity 16 / 34

17 Uncountable sets are so big that they cannot uniquely be labeled by natural numbers. The set of real numbers is uncountable. If X is countable but innite 2 X = {y Y X } is uncountable. Now, if A B, A and B are not nite; if A is countable and B is not countable, then A B. Ryszard Janicki Computability and Complexity 17 / 34

18 Theorem Some languages are not Turing-recognizable. Proof. Let Σ be any (nite) alphabet. Then the set Σ is countable. For example the lexicographical enumeration (just rst order arbitrarily Σ from 1 to Σ ) is a possible mapping from N. We will show that the set of all Turing machines working on languages over Σ is countable. We assume that each M, a code for the machine M, is built from Σ = Σ Σ s, where Σ s is a set of special symbols that make coding easier. Hence for each M, M (Σ ). This means { M M is Turing machine } (Σ ). Since (Σ ) is countable, { M M is Turing machine } is countable too. However the set 2 Σ is not countable, hence there is L 2 Σ, i.e. L Σ which is not recognizable by any Turing machine. Ryszard Janicki Computability and Complexity 18 / 34

19 Simply, there is much more languages than Turing machines (as Turing machines correspond to strings). In fact, there is much more languages that are not Turing-recognizable, than that are Turing-recognizable. We just cannot explicitly dene them. One example will be given later. Ryszard Janicki Computability and Complexity 19 / 34

20 Theorem The language: A TM = { M, w M is Turing Machine and M accepts w } is not Turing-decidable (i.e. the problem is undecidable). Proof. Suppose A TM is decidable. Let H be a Turing machine that decides A TM, i.e. for any input M, w, H accepts M, w if M accepts w, and H rejects M, w if M either rejects w or loops. In other words: { accept M accepts w H( M, w ) = reject M does not accept w Note that the question: `Does M accept M?' is a valid question. We do not have any assumption about w, it is just a string. M is also just a string (a code of M). So we can call H( M, M ) for any Turing machine M. Ryszard Janicki Computability and Complexity 20 / 34

21 Let D be the following Turing machine: 1 D reads M 2 D calls H( M, M ) 3 If H return accept, D produces reject, if H return reject, D produces accept. In other words: { accept M does not accept M D( M ) = reject M accepts M Now consider D( D ). { We have accept D does not accept D D( D ) = reject D accepts D A contradiction, so such D does not exist. But if we have H, D does exist, so H does not exist either. Ryszard Janicki Computability and Complexity 21 / 34

22 This result is often formulated as: Theorem (self acceptance problem) The language: A STM = { M M is Turing machine and M accepts M } is undecidable. The proof is almost identical Then we can use reduction to show that A TM is also undecidable. Ryszard Janicki Computability and Complexity 22 / 34

23 Denition A language L Σ is co-turing-recognizable if Σ \ L is Turing recognizable, i.e. the there exists Turing machine M, such that L(M) = Σ \ L. Theorem L is decidable if it is Turing-recognizable and co-turing-recognizable. Proof. Let M 1, M 2 be Turing machines such that L(M 1 ) = L and L(M 2 ) = Σ \ L. Dene M as follows: 1 read w 2 run M 1 and M 2 on w in parallel (one step of M 1 followed by one step of M 2 ). 3 if M 1 accepts then accept, if M 2 accepts, reject. Ryszard Janicki Computability and Complexity 23 / 34

24 Corollary Σ \ A TM is not Turing recognizable. Proof. A TM is Turing recognizable. If Σ \ A TM were is Turing recognizable, then A TM would be decidable, but it is not. Ryszard Janicki Computability and Complexity 24 / 34

25 Reducibility Again If problem A reduces to B, we can use a solution to B to solve A. Reducibility says nothing about solving A or B alone, only about the solvability of A in the presence of a solution to B. When A is reducible to B: 1 solving A cannot be harder than solving B 2 if B is decidable, A is also decidable. 3 if A is not decidable, B is undecidable. Most of undecidability results have been obtain using (3) above. One can use reducibility either directly, or via languages and codings. Ryszard Janicki Computability and Complexity 25 / 34

26 Example While using coding and languages is essential to prove fundamental results as A TM is undecidable or A STM is undecidable, when using reducibility, it is often easier, and more intuitive, to switch back to the language of algorithms and problems. A TM = { M, w M is Turing Machine and M accepts w } is undecidable can alternatively be formulated as follows: Theorem (Acceptance Problem) Let M be a Turing machine and w Σ. The problem w? L(M) is undecidable. Note that we do not have such an alternative formulation for A STM = { M M is Turing machine and M accepts M } as here the use of M is essential not only for proofs but for the problem formulation as well. Ryszard Janicki Computability and Complexity 26 / 34

27 Halting Problem Theorem Let: HALT TM = { M, w M is a Turing machine and M halts on w } The language HALT TM is undecidable. Proof. We will show that A TM is reducible to HALT TM. Suppose that { a Turing machine R decides HALT TM, so accept M halts on w R( M, w ) = reject M loops on w Let S be a Turing machine that works as follows: 1 takes M, w as input 2 run R on M, w 3 if R rejects, reject 4 if R accepts, simulate M on w until it halts 5 if M accepts, accept; if M reject, reject. Ryszard Janicki Computability and Complexity 27 / 34

28 Proof. In other words: reject R( M, w ) = reject S( M, w ) = reject R( M, w ) = accept M(w) = reject accept R( M, w ) = accept M(w) = accept Note that S decides A TM, but A TM is undecidable, so such R does not exist. Hence HALT TM is undecidable. Using dierent language and approach might result in easier proofs. Theorem (Dierent formulation of Halting problem) Let T be a Turing machine and let w Σ. The problem:'does M halts on w?' is undecidable. Proof. Suppose that it is decidable. So we can decide if either w L(M) or w / L(M). Hence we can clearly decide if w L(M), when it w is really in L(M). But this problem is undecidable. Ryszard Janicki Computability and Complexity 28 / 34

29 Theorem The language E TM = { M M is Turing machine and L(M) = } is undecidable. Theorem (Alternative Formulation) The problem `if for a given Turing machine M, L(M) = ' is undecidable. Ryszard Janicki Computability and Complexity 29 / 34

30 Theorem (Alternative Formulation) The problem `if for a given Turing machine M, L(M) = ' is undecidable. Proof. Suppose we have an algorithm that can decide if L(M) =. We have such algorithms for regular and context-free languages. We may assume that L(M) Σ. Let w Σ. We construct a Turing machine M w as follows reject x w M w (x) = accept x = w M(w) = accept reject x = w M(w) = reject If M loops for w, so does M w. Note that: L(M w ) = {w} w L(M) L(M w ) = w / L(M). Suppose that we have w and M. We apply our algorithm to M w, and if L(M w ) = then w / L(M) and if L(M w ) then w L(M), so we can decide halting problem, which is not decidable. Ryszard Janicki Computability and Complexity 30 / 34

31 Theorem The language REGULAR TM = { M M is Turing machine and L(M) is regular} is undecidable. Theorem (Alternative Formulation) The problem `if a given language accepted by a Turing machine is regular' is undecidable. Ryszard Janicki Computability and Complexity 31 / 34

32 Theorem (Alternative Formulation) The problem `if a given language accepted by a Turing machine is regular' is undecidable. Proof. Suppose that this problem is decidable. We will show that we can the decide if M accepts w. Let M be a Turing machine and let w be a string. We dene M w such that M w (x) = accept x {a n b n n 0} accept x / {a n b n n 0} M accepts w reject x / {a n b n n 0} M rejects w If M loops{ for w, so does M w. Hence: {a L(M w ) = n b n n 0} M does not accept w Σ M accepts w Now, when we apply our algorithm to M w and if the answer is `yes', we know that M accepts w, which is undecidable. Ryszard Janicki Computability and Complexity 32 / 34

33 Rice's Theorem We can replace `regular' by `context-free', `decidable', `nite', etc. All proofs have the similar structure. Theorem (Rice's Theorem) Determining any nontrivial property of the languages recognized by Turing machines is undecidable. Ryszard Janicki Computability and Complexity 33 / 34

34 Theorem The language EQ TM = { M 1, M 2 M 1, M 2 are Turing machines and L(M 1 ) = L(M 2 )} is undecidable. Theorem (Alternative Formulation) The problem `if two Turing Machines recognize the same language' is undecidable. Proof. Suppose this problem is decidable. Let M be a Turing machine that accepts nothing, i.e. L(M ) =. Then, by using the decider for M 1 = M and M 2 = M, we can decide the problem `L(M)? = ', which is undecidable. Ryszard Janicki Computability and Complexity 34 / 34

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

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

Computability and Complexity

Computability and Complexity Computability and Complexity Push-Down Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Sequences and Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability

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

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

} 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

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

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

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

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

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

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

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

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable? } We ll now take a look at Turing Machines at a high level and consider what types of problems can be solved algorithmically and what types can t: What languages are Turing-decidable? What languages are

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

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

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

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

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

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) Objectives Recall that decidable languages are languages that can be decided by TM (that means,

More information

A non-turing-recognizable language

A non-turing-recognizable language CS 360: Introduction to the Theory of Computing John Watrous, University of Waterloo A non-turing-recognizable language 1 OVERVIEW Thus far in the course we have seen many examples of decidable languages

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

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

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

4.2 The Halting Problem

4.2 The Halting Problem 172 4.2 The Halting Problem The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the problem of measuring the sizes of infinite sets For finite sets we can simply

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

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

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

CSCE 551 Final Exam, Spring 2004 Answer Key

CSCE 551 Final Exam, Spring 2004 Answer Key CSCE 551 Final Exam, Spring 2004 Answer Key 1. (10 points) Using any method you like (including intuition), give the unique minimal DFA equivalent to the following NFA: 0 1 2 0 5 1 3 4 If your answer is

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

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

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

Decidable and undecidable languages

Decidable and undecidable languages The Chinese University of Hong Kong Fall 2011 CSCI 3130: Formal languages and automata theory Decidable and undecidable languages Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130 Problems about

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable Decidable Languages We use languages to represent various computational problems because we have a terminology for dealing with languages Definition: A language is decidable if there is an algorithm (i.e.

More information

Turing Machines. Lecture 8

Turing Machines. Lecture 8 Turing Machines Lecture 8 1 Course Trajectory We will see algorithms, what can be done. But what cannot be done? 2 Computation Problem: To compute a function F that maps each input (a string) to an output

More information

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY 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,

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

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

Chap. 4,5 Review. Algorithms created in proofs from prior chapters Chap. 4,5 Review Algorithms created in proofs from prior chapters (p. 55) Theorem 1.39: NFA to DFA (p. 67) Lemma 1.55: Regex to NFA (p. 69) Lemma 1.60: DFA to regex (through GNFA) (p. 112) Lemma 2.21:

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

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

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

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

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

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

Computational Models Lecture 9, Spring 2009

Computational Models Lecture 9, Spring 2009 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models Lecture 9, Spring 2009 Reducibility among languages Mapping reductions More undecidable

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

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

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

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

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages CS533 Class 04a: 1 c P. Heeman, 2017 Introduction: Decidability Overview Decidable Problems of Regular Languages Decidable Problems of Context-Free Languages Preliminaries to Halting Problem CS533 Class

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

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

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Non-determinism, Regular Expressions CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard

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

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

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

Decidability (intro.)

Decidability (intro.) CHAPTER 4 Decidability Contents Decidable Languages decidable problems concerning regular languages decidable problems concerning context-free languages The Halting Problem The diagonalization method The

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Rewriting Systems and Chomsky Grammars CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

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

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

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10 Decidability Andreas Karwath und Malte Helmert 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem : decide

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THURSDAY APRIL 3 REVIEW for Midterm TUESDAY April 8 Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, δ, q, q accept, q reject ), where: Q is a

More information

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

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability The Turing Machine Computability Motivating idea Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical provides a

More information

Decidability: Church-Turing Thesis

Decidability: Church-Turing Thesis Decidability: Church-Turing Thesis While there are a countably infinite number of languages that are described by TMs over some alphabet Σ, there are an uncountably infinite number that are not Are there

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

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

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

Automata Theory CS S-FR2 Final Review

Automata Theory CS S-FR2 Final Review Automata Theory CS411-2015S-FR2 Final Review David Galles Department of Computer Science University of San Francisco FR2-0: Halting Problem e(m) e(w) Halting Machine takes as input an encoding of a Turing

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013 Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction

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

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

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

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

CP405 Theory of Computation

CP405 Theory of Computation CP405 Theory of Computation BB(3) q 0 q 1 q 2 0 q 1 1R q 2 0R q 2 1L 1 H1R q 1 1R q 0 1L Growing Fast BB(3) = 6 BB(4) = 13 BB(5) = 4098 BB(6) = 3.515 x 10 18267 (known) (known) (possible) (possible) Language:

More information

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable SD & Turing Lecture 33: Reductions and Undecidability CSCI 81 Spring, 2012 Kim Bruce Theorem: A language is SD iff it is Turing enumerable. Proof: Spose L is Turing enumerable. Show L is SD. Let w be input.

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

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

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

More information

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page. 6.045J/18.400J: Automata, Computability and Complexity March 30, 2005 Quiz 2 Prof. Nancy Lynch Please write your name in the upper corner of each page. Problem Score 1 2 3 4 5 6 Total Q2-1 Problem 1: True

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

The Unsolvability of the Halting Problem. Chapter 19

The Unsolvability of the Halting Problem. Chapter 19 The Unsolvability of the Halting Problem Chapter 19 Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing Machines D and SD A TM M 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

6.8 The Post Correspondence Problem

6.8 The Post Correspondence Problem 6.8. THE POST CORRESPONDENCE PROBLEM 423 6.8 The Post Correspondence Problem The Post correspondence problem (due to Emil Post) is another undecidable problem that turns out to be a very helpful tool for

More information

Theory of Computation Turing Machine and Pushdown Automata

Theory of Computation Turing Machine and Pushdown Automata Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type

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

Theory of Computer Science

Theory of Computer Science Theory of Computer Science D6. Decidability and Semi-Decidability Malte Helmert University of Basel May 4, 2016 Overview: Computability Theory Computability Theory imperative models of computation: D1.

More information

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

There are two main techniques for showing that problems are undecidable: diagonalization and reduction Reducibility 1 There are two main techniques for showing that problems are undecidable: diagonalization and reduction 2 We say that a problem A is reduced to a problem B if the decidability of A follows

More information

Functions on languages:

Functions on languages: MA/CSSE 474 Final Exam Notation and Formulas page Name (turn this in with your exam) Unless specified otherwise, r,s,t,u,v,w,x,y,z are strings over alphabet Σ; while a, b, c, d are individual alphabet

More information

CS 361 Meeting 28 11/14/18

CS 361 Meeting 28 11/14/18 CS 361 Meeting 28 11/14/18 Announcements 1. Homework 9 due Friday Computation Histories 1. Some very interesting proos o undecidability rely on the technique o constructing a language that describes the

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

Limits of Computability

Limits of Computability Limits of Computability Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner

More information

CS481F01 Solutions 8

CS481F01 Solutions 8 CS481F01 Solutions 8 A. Demers 7 Dec 2001 1. Prob. 111 from p. 344 of the text. One of the following sets is r.e. and the other is not. Which is which? (a) { i L(M i ) contains at least 481 elements }

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

How to Pop a Deep PDA Matters

How to Pop a Deep PDA Matters How to Pop a Deep PDA Matters Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University Kyoto 603-8555, Japan email:leupold@cc.kyoto-su.ac.jp Abstract Deep PDA are push-down automata

More information

CSCE 551 Final Exam, April 28, 2016 Answer Key

CSCE 551 Final Exam, April 28, 2016 Answer Key CSCE 551 Final Exam, April 28, 2016 Answer Key 1. (15 points) Fix any alphabet Σ containing the symbol a. For any language L Σ, define the language a\l := {w Σ wa L}. Show that if L is regular, then a\l

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 15 Last time Decidable languages Designing deciders Today Designing deciders Undecidable languages Diagonalization Sofya Raskhodnikova 3/1/2016 Sofya Raskhodnikova;

More information

Turing Machine Recap

Turing Machine Recap Turing Machine Recap DFA with (infinite) tape. One move: read, write, move, change state. High-level Points Church-Turing thesis: TMs are the most general computing devices. So far no counter example Every

More information