Decidable A problem P is decidable if it can be solved by a Turing machine T that always halt. (We say that P has an effective algorithm.) Note that the.

Slides:



Advertisements
Similar presentations
Variants of Turing machines
Advertisements

CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
February 6, 2015CS21 Lecture 141 CS21 Decidability and Tractability Lecture 14 February 6, 2015.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Lecture 8 Recursively enumerable (r.e.) languages
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Linear Bounded Automata LBAs
Homework #9 Solutions.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
1 Decidability Turing Machines Coded as Binary Strings Diagonalizing over Turing Machines Problems as Languages Undecidable Problems.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
CS21 Decidability and Tractability
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
A Universal Turing Machine
ATM, Halting Problem, P vs. NP Chapter 4, 5 & 7. Russel’s Paradox An Index is a book that lists other books in.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
THE HALTING PROBLEM - PROOF. Review  What makes a problem decidable?  3 properties of an efficient algorithm?  What is the meaning of “complete”, “mechanistic”,
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Chapters 11 and 12 Decision Problems and Undecidability.
The Acceptance Problem for TMs
A Universal Turing Machine
Linear Bounded Automata LBAs
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
LIMITS OF ALGORITHMIC COMPUTATION
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Decidable Languages Costas Busch - LSU.
Decidability Turing Machines Coded as Binary Strings
Decidability Turing Machines Coded as Binary Strings
CS21 Decidability and Tractability
Formal Languages, Automata and Models of Computation
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Decidability continued….
More Undecidable Problems
Turing Machines Everything is an Integer
CIS Automata and Formal Languages – Pei Wang
Presentation transcript:

Decidable A problem P is decidable if it can be solved by a Turing machine T that always halt. (We say that P has an effective algorithm.) Note that the corresponding language of a decidable problem is recursive.

Undecidable A problem is undecidable if it cannot be solved by any Turing machine that halts on all inputs. Note that the corresponding language of an undecidable problem is non-recursive.

Complements of Recursive Languages Theorem: If L is a recursive language, L is also recursive. Proof: Let M be a TM for L that always halt. We can construct another TM M from M for L that always halts as follows: Accept Reject Accept Reject M M Input

Complements of RE Languages Theorem: If both a language L and its complement L are RE, L is recursive. Proof: Let M 1 and M 2 be TM for L and L respectively. We can construct a TM M from M 1 and M 2 for L that always halt as follows: Accept Reject M1M1 M Input M2M2

A Non-recursive RE Language We are going to give an example of a RE language that is not recursive, i.e., a language L that can be accepted by a TM, but there is no TM for L that always halt. Again, we need to make use of the binary encoding of a TM.

Recursive Recursively Enumerable (RE) Non-recursively Enumerable (Non-RE) LdLd We will now look at an example in this region.

A Non-recursive RE Language Recall that we can encode each TM uniquely as a binary number and enumerate all TM’s as T 1, T 2, …, T k, … where the encoded value of the k th TM, i.e., T k, is k. Consider the language L u : L u = {(k, w) | T k accepts input w} This is called the universal language.

Universal Language Note that designing a TM to recognize L u is the same as solving the problem of given k and w, decide whether T k accepts w as its input. We are going to show that L u is RE but non- recursive, i.e., L u can be accepted by a TM, but there is no TM for L u that always halt.

Universal Turing Machine To show that L u is RE, we construct a TM U, called the universal Turing machine, such that L u = L(U). U is designed in such a way that given k and w, it will mimic the operation of T k on input w: kw U will move back and forth to mimic T k on input w. separator

Universal Turing Machine (k, w) TkTk w Accept U Why cannot we use a similar method to construct a TM for L d ? i.e., k w

Universal Language Since there is a TM that accepts L u, L u is RE. We are going to show that L u is non- recursive. If L u is recursive, there is a TM M for L u that always halt. Then, we can construct a TM M’ for L d as follows: kCopy k k M Accept Reject Accept M’

A Non-recursive RE Language Since we have already shown that L d is non- recursively enumerable, so M’ does not exist and there is no such M. Therefore the universal language is recursively enumerable but non-recursive.

Halting Problem Consider the halting problem: Given (k,w), determine if T k halts on w. It’s corresponding language is: L h = { (k, w) | T k halts on input w} The halting problem is also undecidable, i.e., L h is non-recursive. To show this, we can make use of the universal language problem.

Halting Problem We want to show that if the halting problem can be solved (decidable), the universal language problem can also be solved. So we will try to reduce an instance (a particular problem) in L u to an instance in L h in such a way that if we know the answer for the latter, we will know the answer for the former.

Class Discussion Consider a particular instance (k,w) in L u, i.e., we want to determine if T k will accept w. Construct an instance I=(k’,w’) in L h from (k,w) so that if we know whether T k’ will halt on w’, we will know whether T k will accept w.

Halting Problem Therefore, if we have a method to solve the halting problem, we can also solve the universal language problem. (Since for any particular instance I of the universal language problem, we can construct an instance of the halting problem, solve it and get the answer for I.) However, since the universal problem is undecidable, we can conclude that the halting problem is also undecidable.

Modified Post Correspondence Problem We have seen an undecidable problem, that is, given a Turing machine M and an input w, determine whether M will accept w (universal language problem). We will study another undecidable problem that is not related to Turing machine directly.

Modified Post Correspondence Problem (MPCP) Given two lists A and B: A = w 1, w 2, …, w k B = x 1, x 2, …, x k The problem is to determine if there is a sequence of one or more integers i 1, i 2, …, i m such that: w 1 w i 1 w i 2 …w i m = x 1 x i 1 x i 2 …x i m (w i, x i ) is called a corresponding pair.

Example AB i wiwi xixi This MPCP instance has a solution: 3, 2, 2, 4: w 1 w 3 w 2 w 2 w 4 = x 1 x 3 x 2 x 2 x 4 =

Class Discussion AB i wiwi xixi Does this MPCP instance have a solution?

Undecidability of PCP To show that MPCP is undecidable, we will reduce the universal language problem (ULP) to MPCP: If MPCP can be solved, ULP can also be solved. Since we have already shown that ULP is un- decidable, MPCP must also be undecidable. Universal Language Problem (ULP) MPCP A mapping

Mapping ULP to MPCP Mapping a universal language problem instance to an MPCP instance is not as easy. In a ULP instance, we are given a Turing machine M and an input w, we want to determine if M will accept w. To map a ULP instance to an MPCP instance success- fully, the mapped MPCP instance should have a solution if and only if M accepts w.

Mapping ULP to MPCP Given: (T,w) Two lists: A and B Construct an MPCP instance If T accepts w, the two lists can be matched. Otherwise, the two lists cannot be matched. ULP instanceMPCP instance

Mapping ULP to MPCP We assume that the input Turing machine T: –Never prints a blank –Never moves left from its initial head position. These assumptions can be made because: –Theorem (p.346 in Textbook): Every language accepted by a TM M 2 will also be accepted by a TM M 1 with the following restrictions: (1) M 1 ’s head never moves left from its initial position. (2) M 1 never writes a blank.

Mapping ULP to MPCP Given T and w, the idea is to map the transition function of T to strings in the two lists in such a way that a matching of the two lists will correspond to a concatenation of the tape contents at each time step. We will illustrate this with an example first.

Example of ULP to MPCP Consider the following Turing machine: T = ({q 0, q 1 },{0,1},{0,1,#}, , q 0, #, {q 1 })  (q 0,1)=(q 0,0,R)  (q 0,0)=(q 1,0,L) Consider input w=110. 0/0, L 1/0, R q0q0 q1q1

Example of ULP to MPCP Now we will construct an MPCP instance from T and w. There are five types of strings in list A and B: Starting string (first pair): List AList B ##q 0 110#

Example of ULP to MPCP Strings from the transition function  : List AList B q 0 10q 0 (from  (q 0,1)=(q 0,0,R)) 0q 0 0q 1 00 (from  (q 0,0)=(q 1,0,L)) 1q 0 0q 1 10 (from  (q 0,0)=(q 1,0,L))

Example of ULP to MPCP Strings for copying: List AList B # 00 11

Example of ULP to MPCP Strings for consuming the tape symbols at the end: List AList B List AList B 0q 1 q 1 0q 1 1q 1 1q 1 q 1 1q 1 0q 1 q 1 0q 1 0q 1 0q 1 q 1 1q 1 1q 1 0q 1

Example of ULP to MPCP Ending string: List AList B q 1 ### Now, we have constructed an MPCP instance.

Example of ULP to MPCP List AList B 1. ##q 0 110#9. 0q 1 q 1 2. q 0 10q q 1 q q 0 0q q 1 0 q q 0 0q q 1 1 q 1 5. ##13. 0q 1 1 q q 1 0 q q 1 0 q 1 8. q 1 ###16. 1q 1 0 q 1

Example of ULP to MPCP This ULP instance has a solution: q  0q 0 10  00q 0 0  0q 1 00 (halt) Does this MPCP instance has a solution? List A: List B: # q # 0 q # 0 0 q 0 0 # 0 q # q 1 0 # q 1 # # The solution is the sequence of indices: 2, 7, 6, 5, 6, 2, 6, 5, 6, 3, 5, 15, 6, 5, 11, 5, 8

Class Discussion Consider the input w = 101. Construct the corresponding MPCP instance I and show that T will accept w by giving a solution to I.

Class Discussion (cont’d) List AList B 1. ##q 0 101#9. 0q 1 q 1 2. q 0 10q q 1 q q 0 0q q 1 0 q q 0 0q q 1 1 q 1 5. ##13. 0q 1 1 q q 1 0 q q 1 0 q 1 8. q 1 ###16. 1q 1 0 q 1

Mapping ULP to MPCP We summarize the mapping as follows. Given T and w, there are five types of strings in list A and B: Starting string (first pair): List AList B ##q 0 w# where q 0 is the starting state of T.

Mapping ULP to MPCP Strings from the transition function  : List AList B qXYp from  (q,X)=(p,Y,R) ZqXpZY from  (q,X)=(p,Y,L) q#Yp# from  (q,#)=(p,Y,R) Zq#pZY# from  (q,#)=(p,Y,L) where Z is any tape symbol except the blank.

Mapping ULP to MPCP Strings for copying: List AList B XX where X is any tape symbol (including the blank).

Mapping ULP to MPCP Strings for consuming the tape symbols at the end: List AList B Xqq qYq XqYq where q is an accepting state, and each X and Y is any tape symbol except the blank.

Mapping ULP to MPCP Ending string: List AList B q### where q is an accepting state. Using this mapping, we can prove that the original ULP instance has a solution if and only if the mapped MPCP instance has a solution. (Textbook, p.402, Theorem 9.19)