A Universal Turing Machine

Similar documents
Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

1 Showing Recognizability

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Decidability: Church-Turing Thesis

Equivalent Variations of Turing Machines

Theory of Computation

Part I: Definitions and Properties

Computable Functions

CSE 311: Foundations of Computing. Lecture 26: More on Limits of FSMs, Cardinality

Lecture Notes: The Halting Problem; Reductions

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

CSE 311: Foundations of Computing. Lecture 26: Cardinality, Uncomputability

MATH 201 Solutions: TEST 3-A (in class)

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Computational Models Lecture 8 1

Computational Models Lecture 8 1

Computational Models Lecture 8 1

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

A non-turing-recognizable language

16.1 Countability. CS125 Lecture 16 Fall 2014

Most General computer?

Limits of Computability

From Fundamentele Informatica 1: inleverdatum 1 april 2014, 13:45 uur. A Set A of the Same Size as B or Larger Than B. A itself is not.

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

CITS2211 Discrete Structures (2017) Cardinality and Countability

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017

Introduction to Turing Machines. Reading: Chapters 8 & 9

Computational Theory

CSCI3390-Lecture 6: An Undecidable Problem

CS6902 Theory of Computation and Algorithms

CS6901: review of Theory of Computation and Algorithms

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Undecibability. Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not.

Decidability (What, stuff is unsolvable?)

CS3719 Theory of Computation and Algorithms

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

6.8 The Post Correspondence Problem

Models of Computation. by Costas Busch, LSU

Turing Machine Recap

Turing machine recap. Universal Turing Machines and Undecidability. Alphabet size doesn t matter. Robustness of TM

UNRESTRICTED GRAMMARS

TURING MAHINES

4.2 The Halting Problem

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

CS 21 Decidability and Tractability Winter Solution Set 3

1 Reals are Uncountable

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

CSCE 551: Chin-Tser Huang. University of South Carolina

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

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

CS 121, Section 2. Week of September 16, 2013

Turing Machines. Lecture 8

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions

CS Automata, Computability and Formal Languages

Chapter 8. Turing Machine (TMs)

CS 455/555: Mathematical preliminaries

Turing Machines and Time Complexity

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Notes for Lecture Notes 2

Variations of the Turing Machine

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

CSCC63 Worksheet Turing Machines

ACS2: Decidability Decidability

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CPSC 421: Tutorial #1

Theory of Computation

1 Alphabets and Languages

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

Reducability. Sipser, pages

CS 361 Meeting 26 11/10/17

Theory of Computation

ECS 120 Lesson 18 Decidable Problems, the Halting Problem

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Countable and uncountable sets. Matrices.

CS20a: Turing Machines (Oct 29, 2002)

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

CS 410/610, MTH 410/610 Theoretical Foundations of Computing

CSE 105 THEORY OF COMPUTATION

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

The Unsolvability of the Halting Problem. Chapter 19

1 Computational Problems

1 Definition of a Turing machine

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

1 Acceptance, Rejection, and I/O for Turing Machines

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Chapter 3. Regular grammars

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Today. Wrapup of Polynomials...and modular arithmetic. Coutability and Uncountability.

Theory of Computation - Module 4

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Kolmogorov complexity

Non-emptiness Testing for TMs

Warm-Up Problem. Please fill out your Teaching Evaluation Survey! Please comment on the warm-up problems if you haven t filled in your survey yet.

CSE 20 DISCRETE MATH. Fall

Transcription:

A Universal Turing Machine

A limitation of Turing Machines: Turing Machines are hardwired they execute only one program Real Computers are re-programmable

Solution: Universal Turing Machine Attributes: Reprogrammable machine Simulates any other Turing Machine

Universal Turing Machine simulates any other Turing Machine M Input of Universal Turing Machine: Description of transitions of M Initial tape contents of M 4

Three tapes Tape Description of M Universal Turing Machine Tape Tape Contents of M Tape State of M 5

Tape Description of M We describe Turing machine as a string of symbols: M We encode M as a string of symbols 6

Alphabet Encoding Symbols: a b c d Encoding: 7

State Encoding States: q q q q4 Encoding: Head Move Encoding Move: L R Encoding: 8

Transition Encoding Transition: ( q, a) ( q, b, L) Encoding: 0000 separator 9

Machine Encoding Transitions: ( q, a) ( q, b, L) ( q, b) ( q, c, R) Encoding: 0000 00 0000 separator 0

Tape contents of Universal Turing Machine: encoding of the simulated machine as a binary string of 0 s and s M

A Turing Machine is described with a binary string of 0 s and s Therefore: The set of Turing machines forms a language: each string of the language is the binary encoding of a Turing Machine

Language of Turing Machines L = { 00000, 0000000, 0000000, (Turing Machine ) (Turing Machine ) }

Countable Sets 4

Infinite sets are either: Countable or Uncountable 5

Countable set: There is a one to one correspondence between elements of the set and positive integers 6

Example: The set of even integers is countable Even integers: 0,, 4, 6, Correspondence: Positive integers:,,, 4, n corresponds to n 7

Example: The set of rational numbers is countable Rational numbers:,, 7, 4 8 8

Naïve Proof Rational numbers:,,, Correspondence: Positive integers:,,, Doesn t work: we will never count numbers with nominator :,,, 9

Better Approach 4 4 0

4 4

4 4

4 4

4 4 4

4 4 5

Rational Numbers:,,,,, Correspondence: Positive Integers:,,, 4, 5, 6

We proved: the set of rational numbers is countable by describing an enumeration procedure 7

Definition Let S be a set of strings An enumeration procedure for Turing Machine that generates all strings of S one by one S is a and Each string is generated in finite time 8

strings s, s, s, S Enumeration Machine for S output (on tape) s, s, s, Finite time: t, t, t, 9

Enumeration Machine Time 0 Configuration q 0 Time t x # s q s 0

Time t x # s q s Time t x # s q s

Observation: A set is countable if there is an enumeration procedure for it

Example: The set of all strings is countable { a, b, c } Proof: We will describe the enumeration procedure

Naive procedure: Produce the strings in lexicographic order: a aa aaa aaaa... Doesn t work: strings starting with will never be produced b 4

Better procedure: Proper Order. Produce all strings of length. Produce all strings of length. Produce all strings of length 4. Produce all strings of length 4... 5

a b c length Produce strings in Proper Order: aa ab ac ba bb bc ca cb cc aaa aab aac... length length 6

Theorem: The set of all Turing Machines is countable Proof: Any Turing Machine can be encoded with a binary string of 0 s and s Find an enumeration procedure for the set of Turing Machine strings 7

Enumeration Procedure: Repeat. Generate the next binary string of 0 s and s in proper order. Check if the string describes a Turing Machine if YES: print string on output tape if NO: ignore string 8

Uncountable Sets 9

Definition: A set is uncountable if it is not countable 40

Theorem: Let S be an infinite countable set S The powerset of S is uncountable 4

Proof: Since S is countable, we can write S { s, s, s, } Elements of S 4

Elements of the powerset have the form: { s, s } { s5, s7, s9, s 0 } 4

We encode each element of the power set with a binary string of 0 s and s Powerset element Encoding s s s s4 { s } 0 0 0 { s, s } 0 0 { s, s, s 4 } 0 44

Let s assume (for contradiction) that the powerset is countable. Then: we can enumerate the elements of the powerset 45

Powerset element t Encoding 0 0 0 0 t 0 0 0 t 0 0 t 4 0 0 46

Take the powerset element whose bits are the complements in the diagonal 47

t 0 0 0 0 t 0 0 0 t 0 0 t 4 0 0 New element: 00 (birary complement of diagonal) 48

The new element must be some of the powerset t i However, that s impossible: from definition of ti the i-th bit of t i must be the complement of itself Contradiction!!! 49

Since we have a contradiction: The powerset of is uncountable S S 50

An Application: Languages Example Alphabet : { a, b} The set of all Strings: S { a, b} * {, a, b, aa, ab, ba, bb, aaa, aab, } infinite and countable 5

Example Alphabet : { a, b} The set of all Strings: S { a, b} * {, a, b, aa, ab, ba, bb, aaa, aab, } infinite and countable A language is a subset of : S L { aa, ab, aab} 5

Example Alphabet : { a, b} The set of all Strings: S { a, b} * {, a, b, aa, ab, ba, bb, aaa, aab, } infinite and countable The powerset of S S contains all languages: {{ },{ a},{ a, b}{ aa, ab, aab}, } L L L L 4 uncountable 5

Languages: uncountable L L L Lk M M M? Turing machines: countable There are infinitely many more languages than Turing Machines 54

Conclusion: There are some languages not accepted by Turing Machines These languages cannot be described by algorithms 55