Automata and Formal Languages - CM0081 Turing Machines

Similar documents
Turing Machines: An Introduction

3515ICT Theory of Computation Turing Machines

24 Uses of Turing Machines

Introduction to Turing Machines

Turing Machines, Part I

Notes on Complexity Theory Last updated: August, Lecture 1

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Computability Theory

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Universal Turing Machine: A Model for all Computational Problems

Properties of Stabilizing Computations

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Computer Science Theory. From the course description:

Computational Models Lecture 8, Spring 2009

Lecture 2: Universality

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Automata and Computability. Solutions to Exercises

Deterministic Finite Automata

Theory of Computation Chapter 2: Turing Machines

How To Compare A Markov Algorithm To A Turing Machine

1 Definition of a Turing machine

Introduction to Theory of Computation

Introduction to Automata Theory. Reading: Chapter 1

Regular Languages and Finite State Machines

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.

CAs and Turing Machines. The Basis for Universal Computation

Pushdown Automata. International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain

Chapter 7 Uncomputability

CS 3719 (Theory of Computation and Algorithms) Lecture 4

The Halting Problem is Undecidable

4.6 The Primitive Recursive Functions

THEORY of COMPUTATION

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

Introduction to Finite Automata

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

How To Understand The Theory Of Computer Science

Reading 13 : Finite State Automata and Regular Expressions

Outline 2. 1 Turing Machines. 2 Coding and Universality. 3 The Busy Beaver Problem. 4 Wolfram Prize. 5 Church-Turing Thesis.

Complexity Classes P and NP

Properties of Real Numbers

FINITE STATE AND TURING MACHINES

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

Finite Automata and Formal Languages

Regular Languages and Finite Automata

The Classes P and NP

Composability of Infinite-State Activity Automata*

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

CS 301 Course Information

Notes on Complexity Theory Last updated: August, Lecture 1

2.3. Finding polynomial functions. An Introduction:

Two-dimensional Languages

WE write string to mean a finite binary string. Other. Information Distance

THE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES

Wang s B machines are efficiently universal, as is Hasenjaeger s small universal electromechanical toy

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

Theoretical Computer Science (Bridging Course) Complexity

Regular Expressions and Automata using Haskell

Finite Automata. Reading: Chapter 2

Lecture 36: Turing Machines [Fa 14]

Informatique Fondamentale IMA S8

Prime Numbers. Difficulties in Factoring a Number: from the Perspective of Computation. Computation Theory. Turing Machine 電 腦 安 全

6.080/6.089 GITCS Feb 12, Lecture 3

Lecture summary for Theory of Computation

Universality in the theory of algorithms and computer science

ALGEBRA 2 CRA 2 REVIEW - Chapters 1-6 Answer Section

Complexity of Algorithms

Formal Grammars and Languages

Automata and Formal Languages

Computer Architecture Syllabus of Qualifying Examination

Quantum Computing. Robert Sizemore

Simulation-Based Security with Inexhaustible Interactive Turing Machines

Computationally Complete Spiking Neural P Systems Without Delay: Two Types of Neurons Are Enough

On the complexity of some computational problems in the Turing model

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Computability Classes for Enforcement Mechanisms*

On the Structure of Turing Universe: The Non-Linear Ordering of Turing Degrees

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

The Little Man Computer

2.1 Complexity Classes

Lecture 1: Oracle Turing Machines

Models of Sequential Computation

Lecture I FINITE AUTOMATA

Syntaktická analýza. Ján Šturc. Zima 208

FRACTIONS OPERATIONS

Turing Machines and Understanding Computational Complexity

Chapter 1. Computation theory

Hypercomputation: computing more than the Turing machine

NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions

Remarks on the computational complexity of small universal Turing machines

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

CLASSES, STRONG MINIMAL COVERS AND HYPERIMMUNE-FREE DEGREES

Notes on NP Completeness

NP-Completeness and Cook s Theorem

Automata on Infinite Words and Trees

Transcription:

Automata and Formal Languages - CM0081 Turing Machines Andrés Sicard-Ramírez EAFIT University Semester 2017-1

Turing Machines Alan Mathison Turing (1912 1954) Automata and Formal Languages - CM0081. Turing Machines 2/43

Turing Machines (TM) Unbounded tape divided into discrete squares which contain symbols from a finite alphabet Automata and Formal Languages - CM0081. Turing Machines 3/43

Turing Machines (TM) Unbounded tape divided into discrete squares which contain symbols from a finite alphabet Read/Write head Automata and Formal Languages - CM0081. Turing Machines 4/43

Turing Machines (TM) Unbounded tape divided into discrete squares which contain symbols from a finite alphabet Read/Write head Finite set of instructions (transition function) Automata and Formal Languages - CM0081. Turing Machines 5/43

Turing Machines (TM) Unbounded tape divided into discrete squares which contain symbols from a finite alphabet Read/Write head Finite set of instructions (transition function) Move of a TM (tape symbol under the head, current state): change state, rewrite the symbol and move the head one square Automata and Formal Languages - CM0081. Turing Machines 6/43

Turing Machines A Turing machine is a 7-tuple M = (Q, Σ, Γ, δ, q 0, B, F ) where Q: A finite set of states Σ: An alphabet of input symbols Γ: An alphabet of tape symbols (Σ Γ) δ Q Γ Q Γ D: A transition (partial) function where D = {L, R} is the set of moves q 0 Q: A start state B: The blank symbol (B Γ, B Σ) F Q: A set of final or accepting states Automata and Formal Languages - CM0081. Turing Machines 7/43

Transition Diagrams for Turing Machines Example start Y /Y 0/0 Y /Y 0/0 q 0 0/X 1/Y q 1 q 2 Y /Y X/X Y /Y B/B q 3 q 4 where Σ = {0, 1} and Γ = {0, 1, X, Y, B}. Automata and Formal Languages - CM0081. Turing Machines 8/43

Transition Tables for Turing Machines Example The machine of the previous example is given by M = ({q 0, q 1, q 2.q 3, q 4 }, {0, 1}, {0, 1, X, Y, B}, δ, q 0, B, {q 4 }) where δ is given by state 0 1 X Y B q 0 (q 1, X, R) (q 3, Y, R) q 1 (q 1, 0, R) (q 2, Y, L) (q 1, Y, R) q 2 (q 2, 0, L) (q 0, X, R) (q 2, Y, L) q 3 (q 3, Y, R) (q 4, B, R) q 4 Automata and Formal Languages - CM0081. Turing Machines 9/43

Quintuples for Turing Machines Example The machine of the previous example is given by M = ({q 0, q 1, q 2.q 3, q 4 }, {0, 1}, {0, 1, X, Y, B}, δ, q 0, B, {q 4 }), where δ is given by q 0, 0, X, R, q 1 q 0, Y, Y, R, q 3 q 1, 0, 0, R, q 1 q 1, 1, Y, L, q 2 q 1, Y, Y, R, q 1 q 2, 0, 0, L, q 2 q 2, X, X, R, q 0 q 2, Y, Y, L, q 2 q 3, Y, Y, R, q 3 q 3, B, B, R, q 4 Automata and Formal Languages - CM0081. Turing Machines 10/43

Instantaneous Descriptions for Turing Machines Definition (Instantaneous descriptions) An instantaneous description of a TM is a string where 1. q is the state of the TM, X 1 X 2 X i 1 qx i X i+1 X n 2. the head is scanning the i-th symbol from the left and 3. X 1 X 2 X n is the portion of the tape between the leftmost and rightmost non-blank. Automata and Formal Languages - CM0081. Turing Machines 11/43

Instantaneous Descriptions for Turing Machines Notation : Move of the TM M from an instantaneous descriptions to another. M M : Zero o more moves of the TM M. Automata and Formal Languages - CM0081. Turing Machines 12/43

Instantaneous Descriptions for Turing Machines Example 0 0 1 q 0 X 0 1 q 0 001 M Xq 1 01 M X0q 2 1 q 1 q 0 001 M X0q 2 1 X 0 1 q 2 Automata and Formal Languages - CM0081. Turing Machines 13/43

Recursively Enumerable Languages Definition (Language accepted by a TM) Let M = (Q, Σ, Γ, δ, q 0, B, F ) be a TM. The language accepted by M is L(M) = {w Σ q 0 w αpβ}, M where p F and α, β Γ. Automata and Formal Languages - CM0081. Turing Machines 14/43

Recursively Enumerable Languages Definition (Language accepted by a TM) Let M = (Q, Σ, Γ, δ, q 0, B, F ) be a TM. The language accepted by M is L(M) = {w Σ q 0 w αpβ}, M where p F and α, β Γ. Definition (Recursively enumerable language) A language L is recursively enumerable if exists a TM M such L = L(M). Automata and Formal Languages - CM0081. Turing Machines 15/43

Recursively Enumerable Languages Example Let M be the machine described by the previous diagram. Then L(M) = {0 n 1 n n 1}. See the simulation in the course website. Automata and Formal Languages - CM0081. Turing Machines 16/43

Recursive Languages Convention We assume that a TM halts if it accepts. Automata and Formal Languages - CM0081. Turing Machines 17/43

Recursive Languages Convention We assume that a TM halts if it accepts. What about if the TM does not accept? Automata and Formal Languages - CM0081. Turing Machines 18/43

Recursive Languages Convention We assume that a TM halts if it accepts. What about if the TM does not accept? Definition (Recursively enumerable (RE) language) A language L is RE if exists a TM M such that L = L(M). Definition (Recursive language) A language L is recursive if exists a TM M such that 1. L = L(M) and 2. M always halt (even if it does not accept) Automata and Formal Languages - CM0081. Turing Machines 19/43

Turing Machine Computable Functions Number-theoretical functions {f f N k N} Automata and Formal Languages - CM0081. Turing Machines 20/43

Turing Machine Computable Functions Number-theoretical functions {f f N k N} Codification n = 0 n = 0 0 n times (n 1, n 2,, n k ) = n 1 1 n 2 1 1 n k for n N for (n 1, n 2,, n k ) N k Automata and Formal Languages - CM0081. Turing Machines 21/43

Turing Machine Computable Functions Definition (Turing machine computable function) A function f N N is Turing machine computable iff exists a machine M = (Q, {0, 1}, Γ, δ, q 0, B) (there are not accepting states) such that for all n N: From the initial instantaneous description q 0 n the machine halts with f(n) on its tape, surrounded by blanks. Automata and Formal Languages - CM0081. Turing Machines 22/43

Turing Machine Computable Functions Definition (Turing machine computable function) A function f N N is Turing machine computable iff exists a machine M = (Q, {0, 1}, Γ, δ, q 0, B) (there are not accepting states) such that for all n N: From the initial instantaneous description q 0 n the machine halts with f(n) on its tape, surrounded by blanks. Remark: The definition extends to functions f N k N. Automata and Formal Languages - CM0081. Turing Machines 23/43

Turing Machine Computable Functions Example The proper subtraction function is Turing machine computable. m n m n = { Initial instantaneous description: q 0 0 m 10 n Final information on the tape: 0 m n if m n, 0 otherwise. See the simulation in the course homepage. Automata and Formal Languages - CM0081. Turing Machines 24/43

Equivalence between Function Computation and Language Recognition Example (Hopcroft, Motwani and Ullman [2007], Exercise 8.2.4) Define the graph of a function f N N to be the set of all strings of the form [ x, f(x)]. Automata and Formal Languages - CM0081. Turing Machines 25/43

Equivalence between Function Computation and Language Recognition Example (Hopcroft, Motwani and Ullman [2007], Exercise 8.2.4) Define the graph of a function f N N to be the set of all strings of the form [ x, f(x)]. A Turing machine is said to compute the function f N N if, started with x on its tape, it halts (in any state) with f(x) on its tape. Automata and Formal Languages - CM0081. Turing Machines 26/43

Equivalence between Function Computation and Language Recognition Example (Hopcroft, Motwani and Ullman [2007], Exercise 8.2.4) Define the graph of a function f N N to be the set of all strings of the form [ x, f(x)]. A Turing machine is said to compute the function f N N if, started with x on its tape, it halts (in any state) with f(x) on its tape. Answer the following, with informal, but clear constructions. Automata and Formal Languages - CM0081. Turing Machines 27/43

Equivalence between Function Computation and Language Recognition Example (cont.) 1. Show how, given a TM that computes f, you can construct a TM that accepts the graph of f as a language. Automata and Formal Languages - CM0081. Turing Machines 28/43

Equivalence between Function Computation and Language Recognition Example (cont.) 1. Show how, given a TM that computes f, you can construct a TM that accepts the graph of f as a language. 2. Show how, given a TM that accepts the graph of f, you can construct a TM that computes f. Automata and Formal Languages - CM0081. Turing Machines 29/43

Equivalence between Function Computation and Language Recognition Example (cont.) 1. Show how, given a TM that computes f, you can construct a TM that accepts the graph of f as a language. 2. Show how, given a TM that accepts the graph of f, you can construct a TM that computes f. 3. A function is said to partial if it may be undefined for some arguments. If we extend the ideas of this exercise to partial functions, then we do not require that the TM computing f halts if its input x is one of the natural numbers for which f(x) is not defined. Automata and Formal Languages - CM0081. Turing Machines 30/43

Equivalence between Function Computation and Language Recognition Example (cont.) 1. Show how, given a TM that computes f, you can construct a TM that accepts the graph of f as a language. 2. Show how, given a TM that accepts the graph of f, you can construct a TM that computes f. 3. A function is said to partial if it may be undefined for some arguments. If we extend the ideas of this exercise to partial functions, then we do not require that the TM computing f halts if its input x is one of the natural numbers for which f(x) is not defined. Do your constructions for parts (1) and (2) work if the function f is partial? If not, explain how you could modify the constructions to make it work. Automata and Formal Languages - CM0081. Turing Machines 31/43

Restrictions to the Turing Machines Automata and Formal Languages - CM0081. Turing Machines 32/43

Restrictions to the Turing Machines Restrictions Turing machines with semi-unbounded tapes Automata and Formal Languages - CM0081. Turing Machines 33/43

Restrictions to the Turing Machines Restrictions Turing machines with semi-unbounded tapes Multi-stack machines Automata and Formal Languages - CM0081. Turing Machines 34/43

Restrictions to the Turing Machines Restrictions Turing machines with semi-unbounded tapes Multi-stack machines Theorem The previous restrictions are equivalents to the Turing machines. Automata and Formal Languages - CM0081. Turing Machines 35/43

Extensions to the Turing Machines Automata and Formal Languages - CM0081. Turing Machines 36/43

Extensions to the Turing Machines Extensions Multi-tape Turing machines Automata and Formal Languages - CM0081. Turing Machines 37/43

Extensions to the Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Automata and Formal Languages - CM0081. Turing Machines 38/43

Extensions to the Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Multi-head Turing machines Automata and Formal Languages - CM0081. Turing Machines 39/43

Extensions to the Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Multi-head Turing machines Non-deterministic Turing machines Automata and Formal Languages - CM0081. Turing Machines 40/43

Extensions to the Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Multi-head Turing machines Non-deterministic Turing machines Subroutines Automata and Formal Languages - CM0081. Turing Machines 41/43

Extensions to the Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Multi-head Turing machines Non-deterministic Turing machines Subroutines Theorem The previous extensions are equivalents to the Turing machines. Automata and Formal Languages - CM0081. Turing Machines 42/43

References Hopcroft, J. E., Motwani, R. and Ullman, J. D. (2007). Introduction to Automata theory, Languages, and Computation. 3rd ed. Pearson Education. Automata and Formal Languages - CM0081. Turing Machines 43/43