Chapter 6: Turing Machines

Similar documents
Introduction to Turing Machines

Turing Machines. Wolfgang Schreiner

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

Computability and Complexity

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

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Chapter 8. Turing Machine (TMs)

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

Introduction to Turing Machines. Reading: Chapters 8 & 9

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

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

CS21 Decidability and Tractability

Turing Machines (TM) The Turing machine is the ultimate model of computation.

ECS 120 Lesson 15 Turing Machines, Pt. 1

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Theory of Computer Science. Theory of Computer Science. D7.1 Introduction. D7.2 Turing Machines as Words. D7.3 Special Halting Problem

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

Computability Theory. CS215, Lecture 6,

Further discussion of Turing machines

1 Showing Recognizability

CS20a: Turing Machines (Oct 29, 2002)

Theory of Computation

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Turing Machines Part III

Chapter 2: Finite Automata

CSCC63 Worksheet Turing Machines

Turing machine. Turing Machine Model. Turing Machines. 1. Turing Machines. Wolfgang Schreiner 2. Recognizing Languages

UNRESTRICTED GRAMMARS

CS4026 Formal Models of Computation

Lecture 1: Introduction

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Lecture 14: Recursive Languages

Two Way Deterministic Finite Automata

The Turing machine model of computation

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Automata Theory (2A) Young Won Lim 5/31/18

1 The decision problem for First order logic

TURING MAHINES

The Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines

UNIT 1 TURING MACHINE

Turing Machines Decidability

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

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

The Church-Turing Thesis

Finite Automata. Mahesh Viswanathan

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

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

V Honors Theory of Computation

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

1 Unrestricted Computation

On Rice s theorem. Hans Hüttel. October 2001

Theory of Computer Science

Turing Machines Part II

Lecture notes on Turing machines

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

The tape of M. Figure 3: Simulation of a Turing machine with doubly infinite tape

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Computation Histories

Chapter 3: The Church-Turing Thesis

COMPARATIVE ANALYSIS ON TURING MACHINE AND QUANTUM TURING MACHINE

Part I: Definitions and Properties

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

CpSc 421 Homework 9 Solution

Review of Complexity Theory

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Limits of Computability

Lecture 12: Mapping Reductions

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Mapping Reductions. Mapping Reductions. Introduction to Computability. Theory. Mapping Reductions. Lecture13: Mapping. Reductions

Undecidable Problems and Reducibility

CSE 105 THEORY OF COMPUTATION

Homework 8. a b b a b a b. two-way, read/write

CSE 105 THEORY OF COMPUTATION

SCHEME FOR INTERNAL ASSESSMENT TEST 3

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Reducability. Sipser, pages

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

Computability Crib Sheet

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Designing 1-tape Deterministic Turing Machines

CS 7220 Computational Complexity and Algorithm Analysis

Lecture 13: Turing Machine

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

CSCI3390-Lecture 6: An Undecidable Problem

Homework Assignment 6 Answers

Post s Correspondence Problem (PCP) Is Undecidable. Presented By Bharath Bhushan Reddy Goulla

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

Fundamentals of Computer Science

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Rumination on the Formal Definition of DPDA

Most General computer?

Turing Machines and Time Complexity

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

ACS2: Decidability Decidability

Turing Machines, diagonalization, the halting problem, reducibility

Transcription:

Chapter 6: Turing Machines 6.1 The Turing Machine Definition A deterministic Turing machine (DTM) M is specified by a sextuple (Q, Σ, Γ, δ, s, f), where Q is a finite set of states; Σ is an alphabet of input symbols; Γ is an alphabet of tape symbols, where (Σ {B}) Γ; δ is a transition function δ : Q Γ Q Γ {L, R, λ}, where L, R, and λ denote move left, move right, and do not move, respectively; s in Q is a start state; and f in Q is a final state. 1

Input/work tape Read-write head Cells Finite control 2

A DTM is initialized by 1. resetting the read-write head over the first cell of the tape; 2. letting the state of the DTM be s; 3. placing an input word x over Σ into the first x cells, one symbol to a cell; and 4. assuming B is in all other cells. 3

We capture all information about the DTMs current situation with the notion of a configuration, as we did with FAs. A configuration is a word in Γ QΓ, which denotes the current state, the position of the read-write head, and also the currently written portion of the tape. In a configuration g 1 pg 2, the read-write head is assumed to be over the first symbol of g 2 if g 2 λ and over a blank cell otherwise. Strictly speaking, g 2 is either λ or a word in Γ (Γ {B}); there are no trailing blanks. If Γ and Q have elements in common, it is possible to have configuration that contain more than one state. Such a configuration does not identify a unique situation in the DTM, so we forbid this by assuming Γ Q =, throughout. 4

In any configuration g 1 pg 2, M proceeds in one of three ways: 1. If p = f, then M halts and, by definition, no move is possible. This is the reason we only require one final state. 2. If g 2 = λ, then the read-write head is over a blank cell. In this case, if δ(p, B) = (q, X, D), then M enters state q, rewriting the blank cell with X and moving one cell to the left or right or remaining where it is, depending on D. 3. If g 2 = ag 3, where a is in Γ, g 3 is in Γ, and δ(p, a) = (q, X, D), then a is rewritten as X, M enters state q, and the read-write head moves according to D. 4. In (2) and (3) if δ(p, B) or δ(p, a) is undefined, then M hands, that is, no move is possible. 5

Definition Let M = (Q, Σ, Γ, δ, s, f) be a DTM. Then for two configurations gph and g p h we write gph g p h if 1. either h = Ah 1, for some A in Γ and h 1 in Γ, or h = λ and by convention A = B and h 1 = λ; 2. δ(p, A) is defined, and p f; 3. δ(p, A) = (p, B, D) and one of the following holds (a) D = L, then g = g C for some C in Γ, and h = CBh 1 ; (b) D = λ, then g = g and h = Bh 1 ; (c) D = R, than g = gb and h = h 1. 6

Notice that condition (3)(a) implies that g λ, since a move left is impossible in this case; in other words, M hangs once more. We also write gph i g p h, for some i > 0, if either i = 1 and gph g p h or i > 1, gph g p h. form some g h in Γ and p in Q, and g p h i 1 g p h. We write gph + g p h if gph i g p h for some i > 0 and we write gph g p h if either gph = g p h or gph + g p h. 7

In an FA the finiteness of the input together with the absence of rewriting ensures that the reading head will eventually fall of the tape to the right. However, it is possible that a DTM may neither hang nor halt. Definition Let M = (Q, Σ, Γ, δ, s, f) be a DTM. A word x in Σ is accepted by M if M terminates in a configuration gfh, when given x as input, that is, sx gfh The corresponding configuration sequence is called an accepting configuration sequence. Otherwise, either x causes M to hang or M never terminates. 8

We say two DTMs, M 1 and M 2, are equivalent if L(M 1 ) = L(M 2 ). The family of languages specified by all DTMs is denoted by L DT M and defined by L DT M = {L : L = L(M) for some DTM M}. A language in L DT M is said to be a deterministic Turing machine language or a DTML. 9

Since DTMs were introduced as a general model for computation it is worthwhile seeing how we might program them to carry out some basic operations, rather than using them only as language recognizers. Definition Let M = (Q, Σ, Γ, δ, s, f) be a DTM. Then M computes the function f M : Σ (Γ {B}) that is defined by For all x in Σ f M (x) = y in (Γ {B}) iff sx y 1 fy 2, where y = y 1 y 2 10

Definition Let y and n be tape symbols representing yes and no. Then a DTM M = (Q, Σ, Γ, δ, s, f) is said to be a decision-making Turing machine if y and n are in Γ and not in Σ, and For all x in Σ, either sx fy or sx fn in M. The yes language of M, denoted by Y (M), is defined as Y (M) = {x : x is in Σ and sx fy} and the no language of M, denoted by N(M), is defined as N(M) = {x : x is in Σ and sx fn} 11

Such a DTM is a decision maker since for each word in Σ it always halts and gives either a yes or a no answer. Note that L(M) = Y (M) N(M) = Σ and Y (M) N(M) =. Definition Given an alphabet Σ and a language L Σ we say that L is decidable if there is a decision-making Turing machine M = (Q, Σ, Γ, δ, s, f) with Y (M) = L. The languages that are decidable by decision-making Turing machines form an important family the family of recursive languages. This is denoted by L REC and is defined by L REC = {Y (M) : M is a decision-making Turing machine} 12

6.2 Turing Machine Programming 13