Automata and Formal Languages - CM0081 Turing Machines

Similar documents
Computability. What can be computed?

CITS2211 Discrete Structures Turing Machines

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

Technical framework of Operating System using Turing Machines

of the hypothesis, but it would not lead to a proof. P 1

Implementation of Recursively Enumerable Languages in Universal Turing Machine

Turing Machines (TM)

CSCI3390-Lecture 8: Undecidability of a special case of the tiling problem

Introduction To Automata Theory Languages And Computation Addison Wesley Series In Computer Science

Multiplayer Pushdown Games. Anil Seth IIT Kanpur

Tiling Problems. This document supersedes the earlier notes posted about the tiling problem. 1 An Undecidable Problem about Tilings of the Plane

Computing Permutations with Stacks and Deques

Pin-Permutations and Structure in Permutation Classes

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY

THE ENUMERATION OF PERMUTATIONS SORTABLE BY POP STACKS IN PARALLEL

CDT314 FABER Formal Languages, Automata and Models of Computation MARK BURGIN INDUCTIVE TURING MACHINES

Membrane Computing as Multi Turing Machines

Honors Algebra 2 Assignment Sheet - Chapter 1

CSCI 1590 Intro to Computational Complexity

Outline. In One Slide. LR Parsing. LR Parsing. No Stopping The Parsing! Bottom-Up Parsing. LR(1) Parsing Tables #2

Some algorithmic and combinatorial problems on permutation classes

Computer Science 1001.py. Lecture 25 : Intro to Error Correction and Detection Codes

PUZZLES ON GRAPHS: THE TOWERS OF HANOI, THE SPIN-OUT PUZZLE, AND THE COMBINATION PUZZLE

The Tiling Problem. Nikhil Gopalkrishnan. December 08, 2008

Independence of Path and Conservative Vector Fields

RE-DESIGNING THE PACMAN GAME USING PUSH DOWN AUTOMATA

DVA325 Formal Languages, Automata and Models of Computation (FABER)

Modeling Supervisory Control of Autonomous Mobile Robots using Graph Theory, Automata and Z Notation

2.1 Partial Derivatives

Basic Science for Software Developers

14.4. Tangent Planes. Tangent Planes. Tangent Planes. Tangent Planes. Partial Derivatives. Tangent Planes and Linear Approximations

COSE312: Compilers. Lecture 5 Lexical Analysis (4)

Oracle Turing Machine. Kaixiang Wang

Sensors, Signals and Noise

Tile Complexity of Assembly of Length N Arrays and N x N Squares. by John Reif and Harish Chandran

Section 15.3 Partial Derivatives

Experiments #6. Convolution and Linear Time Invariant Systems

Logical Agents (AIMA - Chapter 7)

11/18/2015. Outline. Logical Agents. The Wumpus World. 1. Automating Hunt the Wumpus : A different kind of problem

Math 233. Extrema of Functions of Two Variables Basics

CSCI 2570 Introduction to Nanocomputing

MAT 115: Finite Math for Computer Science Problem Set 5

International Journal of Combinatorial Optimization Problems and Informatics. E-ISSN:

Automaten und Formale Sprachen alias Theoretische Informatik. Sommersemester 2014

Automatic Enumeration and Random Generation for pattern-avoiding Permutation Classes

Enhanced Turing Machines

132-avoiding Two-stack Sortable Permutations, Fibonacci Numbers, and Pell Numbers

Prolog - 3. Prolog Nomenclature

Examples: Find the domain and range of the function f(x, y) = 1 x y 2.

Logic and the Sizes of Sets

FORMAL DEFINITION OF ARTIFICIAL INTELLIGENCE 1

Dynamic Games: Backward Induction and Subgame Perfection

Similarly, the point marked in red below is a local minimum for the function, since there are no points nearby that are lower than it:

You could identify a point on the graph of a function as (x,y) or (x, f(x)). You may have only one function value for each x number.

Permutations of a Multiset Avoiding Permutations of Length 3

Simple permutations: decidability and unavoidable substructures

Formal Verification. Lecture 5: Computation Tree Logic (CTL)

Reading 14 : Counting

code V(n,k) := words module

An Aperiodic Tiling from a Dynamical System: An Exposition of An Example of Culik and Kari. S. Eigen J. Navarro V. Prasad

Advanced Automata Theory 4 Games

THE GAME CREATION OPERATOR

Sequential program, state machine, Concurrent process models

Lecture 19 - Partial Derivatives and Extrema of Functions of Two Variables

Connected Permutations, Hypermaps and Weighted Dyck Words. Robert Cori Mini course, Maps Hypermaps february 2008

2359 (i.e. 11:59:00 pm) on 4/16/18 via Blackboard

Reflector A Dynamic Manifestation of Turing Machines with Time and Space Complexity Analysis

Constructing Simple Nonograms of Varying Difficulty

Modular Arithmetic. claserken. July 2016

14.2 Limits and Continuity

Classes of permutations avoiding 231 or 321

Lesson 11: Linear and Exponential Investigations

RESTRICTED PERMUTATIONS AND POLYGONS. Ghassan Firro and Toufik Mansour Department of Mathematics, University of Haifa, Haifa, Israel

One-Dimensional Peg Solitaire, and Duotaire

Outline. Unlimited Register Machine. Intuitive Definition. What is Effective Procedure. Basic Concepts Computable Function

Simple Search Algorithms

Chapter 3 PRINCIPLE OF INCLUSION AND EXCLUSION

Ma/CS 6a Class 16: Permutations

Computability of Tilings

Avoiding consecutive patterns in permutations

arxiv: v1 [cs.et] 15 Mar 2014

Lecture 5: Pitch and Chord (1) Chord Recognition. Li Su

REVIEW SHEET FOR MIDTERM 2: ADVANCED

Solving Problems by Searching

Permutation Tableaux and the Dashed Permutation Pattern 32 1

Section 7.2 Logarithmic Functions

10703 Deep Reinforcement Learning and Control

Lecture 20 November 13, 2014

On game semantics of the affine and intuitionistic logics (Extended abstract)

Pinpointing Computation with Modular Queries in the Boolean Hierarchy

Game-playing AIs: Games and Adversarial Search I AIMA

Extensive Form Games: Backward Induction and Imperfect Information Games

Equivalence classes of length-changing replacements of size-3 patterns

PROPORTIONAL VERSUS NONPROPORTIONAL RELATIONSHIPS NOTES

From Fibonacci to Catalan permutations

arxiv: v2 [cs.ds] 5 Apr 2016

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

Sets. Gazihan Alankuş (Based on original slides by Brahim Hnich et al.) August 6, Outline Sets Equality Subset Empty Set Cardinality Power Set

JMG. Review Module 1 Lessons 1-20 for Mid-Module. Prepare for Endof-Unit Assessment. Assessment. Module 1. End-of-Unit Assessment.

Compulsory Exercise no. 1 Deadline: 1 May 2014

Transcription:

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

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

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

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/45

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/45

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/45

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/45

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/45

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/45

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/45

Instantaneous Descriptions for Turing Machines Definition An instantaneous description of a TM is a string where i) q is the state of the TM, X 1 X 2 X i 1 qx i X i+1 X n ii) the head is scanning the i-th symbol from the left and iii) 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/45

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/45

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/45

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

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

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/45

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

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/45

Recursive Languages Convention We assume that a TM halts if it accepts. What about if the TM does not accept? Recall Recall that a language L is recursively enumerable if exists a TM M such that L = L(M). Automata and Formal Languages - CM0081. Turing Machines 19/45

Recursive Languages Convention We assume that a TM halts if it accepts. What about if the TM does not accept? Recall Recall that a language L is recursively enumerable if exists a TM M such that L = L(M). Definition A language L is recursive if exists a TM M such that i) L = L(M) and ii) M always halt (even if it does not accept) Automata and Formal Languages - CM0081. Turing Machines 20/45

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

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 22/45

Turing Machine Computable Functions Definition 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 23/45

Turing Machine Computable Functions Definition 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 24/45

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 25/45

Turing Machine Computable Functions Examples The following functions are Turing machine computable: z(x) = 0 s(x) = x + 1 Ik n(x 1,, x n ) = x k i(x) = x f k (x) = k x + y, xy, x y (zero function) (successor function) (n-ary projection functions) (identity function) (k-constant function) (addition, multiplication and exponentiation) Automata and Formal Languages - CM0081. Turing Machines 26/45

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 27/45

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 28/45

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 29/45

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 30/45

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 31/45

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 32/45

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 33/45

Restrictions to Turing Machines Automata and Formal Languages - CM0081. Turing Machines 34/45

Restrictions to Turing Machines Restrictions Turing machines with semi-unbounded tapes Automata and Formal Languages - CM0081. Turing Machines 35/45

Restrictions to Turing Machines Restrictions Turing machines with semi-unbounded tapes Multi-stack machines Automata and Formal Languages - CM0081. Turing Machines 36/45

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

Extensions to Turing Machines Automata and Formal Languages - CM0081. Turing Machines 38/45

Extensions to Turing Machines Extensions Multi-tape Turing machines Automata and Formal Languages - CM0081. Turing Machines 39/45

Extensions to Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Automata and Formal Languages - CM0081. Turing Machines 40/45

Extensions to Turing Machines Extensions Multi-tape Turing machines Mutil-dimensional tape Turing machines Multi-head Turing machines Automata and Formal Languages - CM0081. Turing Machines 41/45

Extensions to 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 42/45

Extensions to 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 43/45

Extensions to 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 Turing machines. Automata and Formal Languages - CM0081. Turing Machines 44/45

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 45/45