Fall 2006Costas Busch - RPI1 A Universal Turing Machine.

Slides:



Advertisements
Similar presentations
Fall 2006Costas Busch - RPI1 Reductions. Fall 2006Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Advertisements

Fall 2006Costas Busch - RPI1 Time Complexity. Fall 2006Costas Busch - RPI2 Consider a deterministic Turing Machine which decides a language.
Fall 2006Costas Busch - RPI1 Turing Machines. Fall 2006Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Linear Bounded Automata LBAs
Fall 2003Costas Busch - RPI1 Properties of Context-Free languages.
Fall 2006Costas Buch - RPI1 Simplifications of Context-Free Grammars.
Context-Free Languages
Fall 2006Costas Busch - RPI1 Decidable Languages.
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
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.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
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.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
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.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
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.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
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.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
A Universal Turing Machine
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)
Recursively Enumerable and Recursive Languages
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
1 Recursively Enumerable and Recursive Languages.
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.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
The Acceptance Problem for TMs
A Universal Turing Machine
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Recursively Enumerable and Recursive Languages
Undecidable Problems Costas Busch - LSU.
Lecture12 The Halting Problem
Reductions Costas Busch - LSU.
Turing’s Thesis Costas Busch - RPI.
Counting Sets.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Turing acceptable languages and Enumerators
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
A Universal Turing Machine
Elementary Questions about Regular Languages
Non-regular languages
The Off-Line Machine Input File read-only (once) Input string
Turing acceptable languages and Enumerators
Undecidable problems:
Formal Languages, Automata and Models of Computation
More Applications of the Pumping Lemma
Recall last lecture and Nondeterministic TMs
CS21 Decidability and Tractability
Cpt S 317: Spring 2009 Reading: Chapter 8 & 9
Instructor: Aaron Roth
Formal Definitions for Turing Machines
MA/CSSE 474 Theory of Computation
Presentation transcript:

Fall 2006Costas Busch - RPI1 A Universal Turing Machine

Fall 2006Costas Busch - RPI2 Turing Machines are hardwired they execute only one program A limitation of Turing Machines: Real Computers are re-programmable

Fall 2006Costas Busch - RPI3 Solution: Universal Turing Machine Reprogrammable machine Simulates any other Turing Machine Attributes:

Fall 2006Costas Busch - RPI4 Universal Turing Machine simulates any Turing Machine Input of Universal Turing Machine: Description of transitions of Input string of

Fall 2006Costas Busch - RPI5 Universal Turing Machine Description of Tape Contents of State of Three tapes Tape 2 Tape 3 Tape 1

Fall 2006Costas Busch - RPI6 We describe Turing machine as a string of symbols: We encode as a string of symbols Description of Tape 1

Fall 2006Costas Busch - RPI7 Alphabet Encoding Symbols: Encoding:

Fall 2006Costas Busch - RPI8 State Encoding States: Encoding: Head Move Encoding Move: Encoding:

Fall 2006Costas Busch - RPI9 Transition Encoding Transition: Encoding: separator

Fall 2006Costas Busch - RPI10 Turing Machine Encoding Transitions: Encoding: separator

Fall 2006Costas Busch - RPI11 Tape 1 contents of Universal Turing Machine: binary encoding of the simulated machine Tape 1

Fall 2006Costas Busch - RPI12 A Turing Machine is described with a binary string of 0s and 1s The set of Turing machines forms a language: each string of this language is the binary encoding of a Turing Machine Therefore:

Fall 2006Costas Busch - RPI13 Language of Turing Machines L = { , , , …… } (Turing Machine 1) (Turing Machine 2) ……

Fall 2006Costas Busch - RPI14 Countable Sets

Fall 2006Costas Busch - RPI15 Infinite sets are either: Countable or Uncountable

Fall 2006Costas Busch - RPI16 Countable set: There is a one to one correspondence of elements of the set to Natural numbers (Positive Integers) (every element of the set is mapped to a number such that no two elements are mapped to same number)

Fall 2006Costas Busch - RPI17 Example: Even integers: (positive) The set of even integers is countable Positive integers: Correspondence: corresponds to

Fall 2006Costas Busch - RPI18 Example:The set of rational numbers is countable Rational numbers:

Fall 2006Costas Busch - RPI19 Naïve Approach Rational numbers: Positive integers: Correspondence: Doesnt work: we will never count numbers with nominator 2: Nominator 1

Fall 2006Costas Busch - RPI20 Better Approach

Fall 2006Costas Busch - RPI21

Fall 2006Costas Busch - RPI22

Fall 2006Costas Busch - RPI23

Fall 2006Costas Busch - RPI24

Fall 2006Costas Busch - RPI25

Fall 2006Costas Busch - RPI26 Rational Numbers: Correspondence: Positive Integers:

Fall 2006Costas Busch - RPI27 We proved: the set of rational numbers is countable by describing an enumeration procedure (enumerator) for the correspondence to natural numbers

Fall 2006Costas Busch - RPI28 Definition An enumerator for is a Turing Machine that generates (prints on tape) all the strings of one by one Let be a set of strings (Language) and each string is generated in finite time

Fall 2006Costas Busch - RPI29 Enumerator Machine for Finite time: strings output (on tape)

Fall 2006Costas Busch - RPI30 Enumerator Machine Configuration Time 0 Time prints

Fall 2006Costas Busch - RPI31 Time prints

Fall 2006Costas Busch - RPI32 If for a set there is an enumerator, then the set is countable Observation: The enumerator describes the correspondence of to natural numbers

Fall 2006Costas Busch - RPI33 Example: The set of strings is countable We will describe an enumerator for Approach:

Fall 2006Costas Busch - RPI34 Naive enumerator: Produce the strings in lexicographic order: Doesnt work: strings starting with will never be produced

Fall 2006Costas Busch - RPI35 Better procedure: 1. Produce all strings of length 1 2. Produce all strings of length 2 3. Produce all strings of length 3 4. Produce all strings of length Proper Order (Canonical Order)

Fall 2006Costas Busch - RPI36 Produce strings in Proper Order: length 2 length 3 length 1

Fall 2006Costas Busch - RPI37 Theorem: The set of all Turing Machines is countable Proof: Find an enumeration procedure for the set of Turing Machine strings Any Turing Machine can be encoded with a binary string of 0s and 1s

Fall 2006Costas Busch - RPI38 1. Generate the next binary string of 0s and 1s in proper order 2. Check if the string describes a Turing Machine YES: if YES: print string on output tape NO: if NO: ignore string Enumerator: Repeat

Fall 2006Costas Busch - RPI39 Binary stringsTuring Machines End of Proof

Fall 2006Costas Busch - RPI40 Uncountable Sets

Fall 2006Costas Busch - RPI41 We will prove that there is a language which is not accepted by any Turing machine Technique: Turing machines are countable Languages are uncountable (there are more languages than Turing Machines)

Fall 2006Costas Busch - RPI42 A set is uncountable if it is not countable Definition: We will prove that there is a language which is not accepted by any Turing machine

Fall 2006Costas Busch - RPI43 Theorem: If is an infinite countable set, then the powerset of is uncountable. (the powerset is the set whose elements are all possible sets made from the elements of )

Fall 2006Costas Busch - RPI44 Proof: Since is countable, we can write Elements of

Fall 2006Costas Busch - RPI45 Elements of the powerset have the form: ……

Fall 2006Costas Busch - RPI46 We encode each element of the powerset with a binary string of 0s and 1s Powerset element Binary encoding (in arbitrary order)

Fall 2006Costas Busch - RPI47 Observation: Every infinite binary string corresponds to an element of the powerset: Example: Corresponds to:

Fall 2006Costas Busch - RPI48 Lets assume (for contradiction) that the powerset is countable Then: we can enumerate the elements of the powerset

Fall 2006Costas Busch - RPI49 Powerset element Binary encoding suppose that this is the respective

Fall 2006Costas Busch - RPI50 Binary string: (birary complement of diagonal) Take the binary string whose bits are the complement of the diagonal

Fall 2006Costas Busch - RPI51 The binary string corresponds to an element of the powerset :

Fall 2006Costas Busch - RPI52 Thus, must be equal to some However, the i-th bit in the encoding of is the complement of the bit of, thus: Contradiction!!! i-th

Fall 2006Costas Busch - RPI53 Since we have a contradiction: The powerset of is uncountable End of proof

Fall 2006Costas Busch - RPI54 An Application: Languages The set of all Strings: infinite and countable Consider Alphabet : (we can enumerate the strings in proper order)

Fall 2006Costas Busch - RPI55 The set of all Strings: infinite and countable Any language is a subset of : Consider Alphabet :

Fall 2006Costas Busch - RPI56 Consider Alphabet : The set of all Strings: infinite and countable The powerset of contains all languages: uncountable

Fall 2006Costas Busch - RPI57 Turing machines: Languages accepted By Turing Machines: accepts Denote: countable Note: countable Consider Alphabet :

Fall 2006Costas Busch - RPI58 countable uncountable Languages accepted by Turing machines: All possible languages: Therefore:

Fall 2006Costas Busch - RPI59 There is a language not accepted by any Turing Machine: (Language cannot be described by any algorithm) Conclusion:

Fall 2006Costas Busch - RPI60 Turing-Acceptable Languages Non Turing-Acceptable Languages

Fall 2006Costas Busch - RPI61 Note that: is a multi-set (elements may repeat) since a language may be accepted by more than one Turing machine However, if we remove the repeated elements, the resulting set is again countable since every element still corresponds to a positive integer