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

Introduction to Computability Theory
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
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 ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
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 ? ?
Turing Machines Recursive and Recursively Enumerable Languages
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
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.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
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.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
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 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 ? ?
Theory of Computation Automata Theory Dr. Ayman Srour.
Cpt S 317: Spring 2009 Reading: Chapter 8
8. Introduction to Turing Machines
More variants of Turing Machines
Complexity and Computability Theory I
Busch Complexity Lectures: Turing Machines
CS21 Decidability and Tractability
Context Sensitive Languages and Linear Bounded Automata
Cpt S 317: Spring 2009 Reading: Chapter 8
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Chapter 3: The CHURCH-Turing thesis
Jaya Krishna, M.Tech, Assistant Professor
فصل سوم The Church-Turing Thesis
Jaya Krishna, M.Tech, Assistant Professor
Intro to Theory of Computation
CSE 105 theory of computation
Decidable Languages Costas Busch - LSU.
8. Introduction to Turing Machines
Decidability Turing Machines Coded as Binary Strings
Decidability Turing Machines Coded as Binary Strings
CS21 Decidability and Tractability
More undecidable languages
Decidability and Tractability
CSE 105 theory of computation
CSE 105 theory of computation
Instructor: Aaron Roth
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Hopcroft, Motawi, Ullman, Chap 8
Turing Machines Everything is an Integer
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Turing Machines

Turing-Machine Theory The purpose of the theory of Turing machines is to prove that certain specific languages have no algorithm. Reductions are used to prove more common questions are undecidable.

Turing Machines Regular and CF languages are both recognized by a particular type of machine. Regular: Finite Automata (Deterministic, Nondeterministic). Context Free: Pushdown Automata, CFG. Both types of machine are limited. Regular: No memory. Context Free: A restricted type of memory (first-in, last-out). Neither model is acceptable as a general model of computation Clearly some machine should be able to recognize strings in {w#w|w ∈ {0, 1}* } (which is not a CFL). Turing Machines (TMs) are. They are the canonical model for computation. To be computable means to be computable by a Turing Machine

Picture of a Turing Machine Action: based on the state and the tape symbol under the head: change state, rewrite the symbol and move the head one square. State . . . . . . A B C A D Infinite tape with squares containing tape symbols chosen from a finite alphabet

Why Turing Machines? Why not deal with C programs or something like that? Answer: You can, but it is easier to prove things about TM’s, because they are so simple. And yet they are as powerful as any computer. More so, in fact, since they have infinite memory.

Finite automata to Turing Machines A Turing machine can both write on the tape and read from it The read write head can move both to left and right The tape is infinite Once accept/reject states are reached, the computation terminates at once

Turing-Machine Formalism A TM is described by: A finite set of states (Q, typically). An input alphabet (Σ, typically). A tape alphabet (Γ, typically; contains Σ). A transition function (δ, typically). A start state (q0, in Q, typically). A blank symbol (B, in Γ- Σ, typically). All tape except for the input is blank initially. A set of final states (F ⊆ Q, typically).

The Transition Function Takes two arguments: A state, in Q. A tape symbol in Γ. δ(q, Z) is either undefined or a triple of the form (p, Y, D). p is a state. Y is the new tape symbol. D is a direction, L or R.

Actions of the TM If δ(q, Z) = (p, Y, D) then, in state q, scanning Z under its tape head, the TM: Changes the state to p. Replaces Z by Y on the tape. Moves the head one square in direction D. D = L: move left; D = R; move right.

Example: Turing Machine This TM scans its input right, looking for a 1. If it finds one, it changes it to a 0, goes to final state f, and halts. If it reaches a blank, it changes it to a 1 and moves left.

Example: Turing Machine – (2) States = {q (start), f (final)}. Input symbols = {0, 1}. Tape symbols = {0, 1, B}. δ(q, 0) = (q, 0, R). δ(q, 1) = (f, 0, R). δ(q, B) = (q, 1, L).

Simulation of TM δ(q, 0) = (q, 0, R) δ(q, 1) = (f, 0, R) δ(q, B) = (q, 1, L) q . . . B B 0 0 B B . . .

Simulation of TM δ(q, 0) = (q, 0, R) δ(q, 1) = (f, 0, R) δ(q, B) = (q, 1, L) q . . . B B 0 0 B B . . .

Simulation of TM δ(q, 0) = (q, 0, R) δ(q, 1) = (f, 0, R) δ(q, B) = (q, 1, L) q . . . B B 0 0 B B . . .

Simulation of TM δ(q, 0) = (q, 0, R) δ(q, 1) = (f, 0, R) δ(q, B) = (q, 1, L) q . . . B B 0 0 1 B . . .

Simulation of TM δ(q, 0) = (q, 0, R) δ(q, 1) = (f, 0, R) δ(q, B) = (q, 1, L) q . . . B B 0 0 1 B . . .

Simulation of TM δ(q, 0) = (q, 0, R) δ(q, 1) = (f, 0, R) δ(q, B) = (q, 1, L) f No move is possible. The TM halts and accepts. . . . B B 0 0 0 B . . .

Example 2 B = {w#w | w Є {0,1}* Repeatedly do: Mark the first “unmarked” symbol from the beginning and zig-zag across the tape to its corresponding position on the other side of the # to check if they are same (need to remember what you see). If so mark, otherwise reject Stop when there are no unmarked symbols remaining to the left of #. If there are still symbols left on the right, reject. Else accept.

δ 1 # B x q0 (start) (q1,x,R) (q2,x,R) (q3,#,R) q_rej (q0,x,R) q1 (see 0) (q1,0,R) (q1,1,R) (q4,#,R) q2 (see 1) (q2,0,R) (q2,1,R) (q5,#,R) q3 (left input finished) q_acc (q3,x,R) q4 (match 0) (q6,x,L) (q4,x,R) q5 (match 1) (q5,x,R) q6 (go back) (q6,0,L) (q6,1,L) (q6,#,L) (q0,B,R)

Instantaneous Descriptions of a Turing Machine Initially, a TM has a tape consisting of a string of input symbols surrounded by an infinity of blanks in both directions. The TM is in the start state, and the head is at the leftmost input symbol.

TM ID’s – (2) An ID is a string q,x, where x is the tape between the leftmost and rightmost nonblanks (inclusive). The current state is q x is the tape symbol scanned (marked with an arrow). If arrow is at the right end, it is scanning B.

TM ID’s – (3) As for PDA’s we may use symbols ⊦ and ⊦* to represent “becomes in one move” and “becomes in zero or more moves,” respectively, on ID’s. Example: The moves of the previous TM are q,00⊦q,00⊦q,00 ⊦q,001⊦q,001⊦f,000

ID’s for w#w Initial tape: …BB01#01BB… q0,01#01 ⊦ q1, x1#01 ⊦* q4,x1#01 ⊦q6,x1#x1 ⊦* q0,x1#x1 ⊦* q2,xx#x1 ⊦* q5,xx#x1 ⊦q6,x1#xx ⊦* q0,xx#xx ⊦* q3,xx#xx ⊦* qacc,xx#xx

Languages of a TM A Turing Machine M defines a language by final state, as usual. L(M) = {w | q0w⊦*I, where I is an ID with a final state}. L(M), language of M (the language recognized by M), is the set of strings accepted by M

Recursive vs Recursively Enumerable Turing recognizable or Recursively enumerable A language is Turing recognizable or Recursively Enumerable if there is a Turing machine accepting it Turing decidable or recursive A language is decidable (or recursive) if there is a Turing machine accepting it, which has the additional property that it halts on all possible inputs

Recursive vs Recursively Enumerable It is possible for a TM to never reach a halting configuration. It might instead infinitely loop there are 3 outcomes: accept, reject, loop If TM accepts or rejects for all inputs then it is a decidable (recursive) language. Every decidable lang. is R.E. but not the converse

decidable  RE  all languages Decidability regular languages context free languages all languages decidable RE decidable  RE  all languages undecidable

Extentions to Turing Machine Multitape TM Nondeterministic TM Multihead TM Multistack PDA All are equivalent, any language accepted by a TM is accepted by any of them and vice versa