8. Introduction to Turing Machines

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

CS2303-THEORY OF COMPUTATION
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Lecture 5 Turing Machines
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.

Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
AUTOMATA THEORY VIII.
Turing Machines A more powerful computation model than a PDA ?
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Turing Machines. Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Cpt S 317: Spring 2009 Reading: Chapter 8
8. Introduction to Turing Machines
Non Deterministic Automata
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
CIS Automata and Formal Languages – Pei Wang
Pumping Lemma Revisited
CSE 105 theory of computation
Cpt S 317: Spring 2009 Reading: Chapter 8
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Jaya Krishna, M.Tech, Assistant Professor
Intro to Theory of Computation
Turing Machines (TM) Deterministic Turing Machine (DTM)
Non Deterministic Automata
Decidable Languages A language L is decidable if there is a Turing machine ML such that given any word w  0*, then: Input of ML: a  b  … w Output of.
Pushdown automata a_introduction.htm.
CS21 Decidability and Tractability
Decidability and Tractability
CSE 105 theory of computation
Instructor: Aaron Roth
Hopcroft, Motawi, Ullman, Chap 8
Turing Machines Everything is an Integer
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

8. Introduction to Turing Machines CIS 5513 - Automata and Formal Languages – Pei Wang

Extending PDA PDA cannot accept {0n1n2n} or {ww} The restrictions in the power of PDA are in using the memory as a stack, and processing the input string character by character Extensions: The memory allows access at any position The memory contains the input, the intermediate results, and the output

Turing machine Input: a finite string on an infinite tape Tape head: can move and access a cell Transition: from (state, symbol) to (state, symbol, move)

TM definition A (deterministic) Turing machine (TM) M = (Q, Σ, Γ, δ, q0, B, F) where Γ: A finite tape alphabet, and Σ  Γ B: The blank symbol on tape, in Γ – Σ δ: A partial function from (Q – F) × Γ to Q × Γ × {L,R}, specifying the next state, the changed symbol, and the moving direction The other components are like those of a DFA

Instantaneous descriptions of TM The ID of a TM: X1X2…Xi-1qXiXi+1…Xn The current state is q The current symbol under head is Xi X1 and Xn are the leftmost and rightmost non- blank symbols on tape, respectively Order of changes: (1) tape symbol, (2) head location, (3) current state

˫M X1X2…Xi-2pXi-1YXi+1…Xn Moves of TM: to left If δ(q, Xi) = (p, Y, L), then X1X2…Xi-2Xi-1qXiXi+1…Xn ˫M X1X2…Xi-2pXi-1YXi+1…Xn If i = 1, then a blank is added: qX1X2…Xn ˫M pBYX2…Xn If i = n and Y = B, then a blank is omitted: X1X2…Xn-1qXn ˫M X1X2…Xn-2pXn-1

˫M X1X2…Xi-1YpXi+1…Xn Moves of TM: to right If δ(q, Xi) = (p, Y, R), then X1X2…Xi-1qXiXi+1…Xn ˫M X1X2…Xi-1YpXi+1…Xn If i = n, then a blank is added: X1X2…Xn-1qXn ˫M X1X2…Xn-1YpB If i = 1 and Y = B, then a blank is omitted: qX1X2…Xn ˫M pX2…Xn

TM Example 1: TM definition

TM Example 1: transition diagram

TM Example 1: ID derivations

TM Example 2: TM definition Proper subtraction: max(m – n, 0) M = ({q0, …,q6}, {0,1}, {0,1,B}, δ, q0, B) It does not accept any input (0m10n), but stops at q6 with an output (0m–n or blank) on the tape

TM Example 2: transition diagram

TM Example 2: ID derivations q0000100 ˫ q100100 ˫ 0q10100 ˫ 00q1100 ˫ 001q200 ˫ 00q3110 ˫ 0q30110 ˫ q300110 ˫ q3B00110 ˫ q000110 ˫ q10110 ˫ 0q1110 ˫ 01q210 ˫ 011q20 ˫ 01q311 ˫ 0q3111 ˫ q30111 ˫ q3B0111 ˫ q00111 ˫ q1111 ˫ 1q211 ˫ 11q21 ˫ 111q2B ˫ 11q41 ˫ 1q41 ˫ q41 ˫ q4B ˫ q60 q00100 ˫ q1100 ˫ 1q200 ˫ q3110 ˫ q3B110 ˫ q0110 ˫ q510 ˫ q50 ˫ q5B ˫ q6B

The language of a TM The language a TM M accepts: L(M) = { w | q0w ˫*M αpβ } where pF, wΣ*, and α, βΓ* L(M) belongs to recursively enumerable (RE) languages A TM halts where the next move is undefined, like an NFA or PDA, while a DFA stops only when the input is exhausted

TM and algorithm Those languages with TM’s that do halt (accepting or not) are called recursive A TM that halts for all input is an algorithm, which consists of executable operations, and is both deterministic and finite A problem is decidable if and only if it has an algorithm A DFA/NFA/PDA always stops

TM programming Some techniques in TM programming States can be used as limited storage The input/output tape can be split into multiple tracks that can be processed separately A TM can contain another TM as a “subroutine” These ideas do not change the definition of TM, nor its capability, but simplify the description

TM extensions The definition of TM can be further extended with multiple tapes and heads that can be used independently with a nondeterministic transition function that specifies multiple possible moves These extensions do not change the languages accepted by TM

Restricted TM The following automata have the same capability as a TM: A TM with a tape that is infinite in one direction but finite in the other direction A multi-stack PDA A counter machine with finite states and two or more counters, each can do ++, --, and =0? A 1-counter machine is equivalent to a DPDA

Universal TM A Universal Turing Machine (UTM) is a TM that can simulate an arbitrary Turing Machine on arbitrary input The universal machine essentially achieves this by reading both the description of the machine to be simulated as well as the input, then simulating the former on the latter So a “program” can become the “data” of another program

Use a TM to simulate a computer

Simulating a program in a TM Get the instruction from the memory Interpret the instruction Get the memory address of data Execute the instruction, which may lead to changes in the content of the tapes Update the instruction counter, and repeat the process

Computer and TM A TM can be simulated by a computer program An instruction cycle in a computer can be simulated by a TM A computer program can be simulated by a TM as a sequence of instruction cycles A computer system can be simulated by a TM as a set of programs

Church–Turing Thesis Every function which would naturally be regarded as computable is computable by a TM Many other computational models are TM equivalents, including Lambda calculus Computation can be implemented in unconventional ways