A Universal Turing Machine

Slides:



Advertisements
Similar presentations
Fall 2006Costas Busch - RPI1 A Universal Turing Machine.
Advertisements

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.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
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.
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 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.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
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 Lecture 6 Topics –Proof of the existence of unsolvable problems Problems/languages not in REC Proof Technique –There are more problems/languages than.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Cardinality of Sets Section 2.5.
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.
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
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
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
Non-regular languages
Busch Complexity Lectures: Turing Machines
Busch Complexity Lectures: Reductions
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
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
A Universal Turing Machine
Elementary Questions about 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:

A Universal Turing Machine Costas Busch - LSU

A limitation of Turing Machines: Turing Machines are “hardwired” they execute only one program Real Computers are re-programmable Costas Busch - LSU

Universal Turing Machine Solution: Universal Turing Machine Attributes: Reprogrammable machine Simulates any other Turing Machine Costas Busch - LSU

Universal Turing Machine simulates any Turing Machine Input of Universal Turing Machine: Description of transitions of Input string of Costas Busch - LSU

Three tapes Description of Universal Turing Machine Tape Contents of State of Costas Busch - LSU

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

Alphabet Encoding Symbols: Encoding: Costas Busch - LSU

State Encoding States: Encoding: Head Move Encoding Move: Encoding: Costas Busch - LSU

Transition Encoding Transition: Encoding: separator Costas Busch - LSU

Turing Machine Encoding Transitions: Encoding: separator Costas Busch - LSU

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

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

Language of Turing Machines 00100100101111, 111010011110010101, …… } (Turing Machine 2) …… Costas Busch - LSU

Countable Sets Costas Busch - LSU

Infinite sets are either: Countable or Uncountable Costas Busch - LSU

Countable set: There is a one to one correspondence (injection) of elements of the set to Positive integers (1,2,3,…) Every element of the set is mapped to a positive number such that no two elements are mapped to same number Costas Busch - LSU

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

The set of rational numbers is countable Example: The set of rational numbers is countable Rational numbers: Costas Busch - LSU

numbers with nominator 2: Naïve Approach Nominator 1 Rational numbers: Correspondence: Positive integers: Doesn’t work: we will never count numbers with nominator 2: Costas Busch - LSU

Better Approach Costas Busch - LSU

Costas Busch - LSU

Costas Busch - LSU

Costas Busch - LSU

Costas Busch - LSU

Costas Busch - LSU

Rational Numbers: Correspondence: Positive Integers: Costas Busch - LSU

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

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

strings Enumerator output Machine for (on tape) Finite time: Costas Busch - LSU

Enumerator Machine Configuration Time 0 prints Time Costas Busch - LSU

prints Time prints Time Costas Busch - LSU

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

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

Produce the strings in lexicographic order: Naive enumerator: Produce the strings in lexicographic order: Doesn’t work: strings starting with will never be produced Costas Busch - LSU

1. Produce all strings of length 1 2. Produce all strings of length 2 Better procedure: Proper Order (Canonical Order) 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 4 .......... Costas Busch - LSU

length 1 Produce strings in Proper Order: length 2 length 3 Costas Busch - LSU

The set of all Turing Machines is countable 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 0’s and 1’s Costas Busch - LSU

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

Binary strings Turing Machines End of Proof Costas Busch - LSU

Uncountable Sets Costas Busch - LSU

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) Costas Busch - LSU

If is an infinite countable set, then the powerset of is uncountable. 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 Example: Costas Busch - LSU

Since is countable, we can write Proof: Since is countable, we can write Element of Costas Busch - LSU

Elements of the powerset have the form: …… Costas Busch - LSU

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

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

Let’s assume (for contradiction) that the powerset is countable Then: we can enumerate the elements of the powerset Costas Busch - LSU

Powerset element Binary encoding suppose that this is the respective Costas Busch - LSU

Take the binary string whose bits are the complement of the diagonal (birary complement of diagonal) Costas Busch - LSU

The binary string corresponds to an element of the powerset : Costas Busch - LSU

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

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

An Application: Languages Consider Alphabet : The set of all strings: infinite and countable because we can enumerate the strings in proper order Costas Busch - LSU

infinite and countable Consider Alphabet : The set of all strings: infinite and countable Any language is a subset of : Costas Busch - LSU

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

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

Therefore: countable uncountable All possible languages: Languages accepted by Turing machines: countable All possible languages: uncountable Therefore: Costas Busch - LSU

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

Non Turing-Acceptable Languages Costas Busch - LSU

is a multi-set (elements may repeat) since a language may be accepted 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 Costas Busch - LSU