1 Decidability Turing Machines Coded as Binary Strings Diagonalizing over Turing Machines Problems as Languages Undecidable Problems.

Slides:



Advertisements
Similar presentations
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Advertisements

1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
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.
1 More Undecidable Problems Rice’s Theorem Post’s Correspondence Problem Some Real Problems.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…
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.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Costas Busch - RPI1 Undecidable problems for Recursively enumerable languages continued…
1 Intractable Problems Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
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.
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.
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.
CS 310 – Fall 2006 Pacific University CS310 The Halting Problem Section 4.2 November 15, 2006.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
Decision Properties of Regular Languages
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Section 11.4 Language Classes Based On Randomization
Undecidability Everything is an Integer Countable and Uncountable Sets
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
Decidability A decision problem is a problem with a YES/NO answer. We have seen decision problems for - regular languages: - context free languages: [Sections.
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
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
Computability Chapter 5. Overview  Turing Machine (TM) considered to be the most general computational model that can be devised (Church-Turing thesis)
CS 3813: Introduction to Formal Languages and Automata Chapter 12 Limits of Algorithmic Computation These class notes are based on material from our textbook,
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
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.
1 Undecidability Everything is an Integer Countable and Uncountable Sets Turing Machines Recursive and Recursively Enumerable Languages.
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.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Universal Turing Machine
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
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.
The Acceptance Problem for TMs
A Universal Turing Machine
CSE 311 Foundations of Computing I
LIMITS OF ALGORITHMIC COMPUTATION
Turing Machines Acceptors; Enumerators
Decidable Languages Costas Busch - LSU.
Decidability Turing Machines Coded as Binary Strings
Decidability Turing Machines Coded as Binary Strings
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
Presentation transcript:

1 Decidability Turing Machines Coded as Binary Strings Diagonalizing over Turing Machines Problems as Languages Undecidable Problems

2 Binary-Strings from TM’s uWe shall restrict ourselves to TM’s with input alphabet {0, 1}. uAssign positive integers to the three classes of elements involved in moves: 1.States: q 1 (start state), q 2 (final state), q 3, … 2.Symbols X 1 (0), X 2 (1), X 3 (blank), X 4, … 3.Directions D 1 (L) and D 2 (R).

3 Binary Strings from TM’s – (2)  Suppose δ (q i, X j ) = (q k, X l, D m ). uRepresent this rule by string 0 i 10 j 10 k 10 l 10 m. uKey point: since integers i, j, … are all > 0, there cannot be two consecutive 1’s in these strings.

4 Binary Strings from TM’s – (2) uRepresent a TM by concatenating the codes for each of its moves, separated by 11 as punctuation. wThat is: Code 1 11Code 2 11Code 3 11 …

5 Enumerating TM’s and Binary Strings uRecall we can convert binary strings to integers by prepending a 1 and treating the resulting string as a base-2 integer. uThus, it makes sense to talk about “the i-th binary string” and about “the i-th Turing machine.” uNote: if i makes no sense as a TM, assume the i-th TM accepts nothing.

6 Table of Acceptance TM i String j x x = 0 means the i-th TM does not accept the j-th string; 1 means it does.

7 Diagonalization Again uWhenever we have a table like the one on the previous slide, we can diagonalize it. wThat is, construct a sequence D by complementing each bit along the major diagonal. uFormally, D = a 1 a 2 …, where a i = 0 if the (i, i) table entry is 1, and vice-versa.

8 The Diagonalization Argument uCould D be a row (representing the language accepted by a TM) of the table? uSuppose it were the j-th row. uBut D disagrees with the j-th row at the j-th column. uThus D is not a row.

9 Diagonalization – (2) uConsider the diagonalization language L d = {w | w is the i-th string, and the i-th TM does not accept w}. uWe have shown that L d is not a recursively enumerable language; i.e., it has no TM.

10 Problems uInformally, a “problem” is a yes/no question about an infinite set of possible instances. uExample: “Does graph G have a Hamilton cycle (cycle that touches each node exactly once)? wEach undirected graph is an instance of the “Hamilton-cycle problem.”

11 Problems – (2) uFormally, a problem is a language. uEach string encodes some instance. uThe string is in the language if and only if the answer to this instance of the problem is “yes.”

12 Example: A Problem About Turing Machines uWe can think of the language L d as a problem. u“Does this TM not accept its own code?” uAside: We could also think of it as a problem about binary strings. wDo you see how to phrase it?

13 Decidable Problems uA problem is decidable if there is an algorithm to answer it. wRecall: An “algorithm,” formally, is a TM that halts on all inputs, accepted or not. wPut another way, “decidable problem” = “recursive language.” uOtherwise, the problem is undecidable.

14 Bullseye Picture Decidable problems = Recursive languages Recursively enumerable languages Not recursively enumerable languages LdLd Are there any languages here?

15 From the Abstract to the Real uWhile the fact that L d is undecidable is interesting intellectually, it doesn’t impact the real world directly. uWe first shall develop some TM-related problems that are undecidable, but our goal is to use the theory to show some real problems are undecidable.

16 Examples: Undecidable Problems uCan a particular line of code in a program ever be executed? uIs a given context-free grammar ambiguous? uDo two given CFG’s generate the same language?

17 The Universal Language uAn example of a recursively enumerable, but not recursive language is the language L u of a universal Turing machine. uThat is, the UTM takes as input the code for some TM M and some binary string w and accepts if and only if M accepts w.

18 Designing the UTM uInputs are of the form: Code for M 111 w uNote: A valid TM code never has 111, so we can split M from w. uThe UTM must accept its input if and only if M is a valid TM code and that TM accepts w.

19 The UTM – (2) uThe UTM will have several tapes. uTape 1 holds the input M111w uTape 2 holds the tape of M. wMark the current head position of M. uTape 3 holds the state of M.

20 The UTM – (3) uStep 1: The UTM checks that M is a valid code for a TM. wE.g., all moves have five components, no two moves have the same state/symbol as first two components. uIf M is not valid, its language is empty, so the UTM immediately halts without accepting.

21 The UTM – (4) uStep 2: The UTM examines M to see how many of its own tape squares it needs to represent one symbol of M. uStep 3: Initialize Tape 2 to represent the tape of M with input w, and initialize Tape 3 to hold the start state.

22 The UTM – (5) uStep 4: Simulate M. wLook for a move on Tape 1 that matches the state on Tape 3 and the tape symbol under the head on Tape 2. wIf found, change the symbol and move the head marker on Tape 2 and change the State on Tape 3. wIf M accepts, the UTM also accepts.

23 A Question uDo we see anything like universal Turing machines in real life?

24 Proof That L u is Recursively Enumerable, but not Recursive uWe designed a TM for L u, so it is surely RE. uSuppose it were recursive; that is, we could design a UTM U that always halted. uThen we could also design an algorithm for L d, as follows.

25 Proof – (2) uGiven input w, we can decide if it is in L d by the following steps. 1.Check that w is a valid TM code. uIf not, then its language is empty, so w is in L d. 2.If valid, use the hypothetical algorithm to decide whether w111w is in L u. 3.If so, then w is not in L d ; else it is.

26 Proof – (3) uBut we already know there is no algorithm for L d. uThus, our assumption that there was an algorithm for L u is wrong. uL u is RE, but not recursive.

27 Bullseye Picture Decidable problems = Recursive languages Recursively enumerable languages Not recursively enumerable languages LdLd LuLu All these are undecidable