turing machines lecture 26 naveen z quazilbash. overview introduction turing machine notation turing...

13
Turing Machines Lecture 26 Naveen Z Quazilbash

Upload: garey-wright

Post on 18-Jan-2018

228 views

Category:

Documents


1 download

DESCRIPTION

Introduction Notion for “any possible computation.” Predicate calculus—declarative rather than being computational. Partial recursive functions—programming- language-like-notation. Turing Machine—computer-like model of computation rather than program-like.

TRANSCRIPT

Page 1: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machines

Lecture 26Naveen Z Quazilbash

Page 2: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Overview

• Introduction• Turing Machine Notation• Turing Machine Formal Notation• Transition Function• Instantaneous Descriptions (IDs)• Moves of a Turing Machine• Example from Handout

Page 3: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Introduction

• Notion for “any possible computation.”• Predicate calculus—declarative rather than

being computational.• Partial recursive functions—programming-

language-like-notation.• Turing Machine—computer-like model of

computation rather than program-like.

Page 4: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Introduction -(2)

• Turing Machines:– A mathematical model of a general-purpose

computer (with infinite memory)– Mainly used to study the notion of computation

(what computers can and can’t do)• The Church-Turing Thesis:

Every function which would naturally be regarded as ‘computable’ can be computed by a Turing Machine.

Page 5: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machine-Notation

• We may visualize a Turing Machine as in above figure.• The machine consists of a finite control, which can be in

any of a finite set of states.• There is a tape divided into squares or cells; each cell can

hold any one of a finite number of symbols.

Page 6: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machine-Notation-(2)

• Initially, the input, which is a finite-length string of symbols chosen from the input alphabet, is placed on the tape.

• All other tape cells, extending infinitely to the left and right, initially hold a special symbol called the blank.

Page 7: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machine-Notation-(3)

• The blank is a tape symbol, but not an input symbol, and there may be other tape symbols besides the input symbols and the blank, as well.

• There is a tape head that is always positioned at one of the tape cells.

• Turing machine is said to be scanning that cell. Initially, the tape head is at the leftmost cell that holds the input.

Page 8: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machine-Notation-(4)

• A move of a Turing machine (TM) is a function of the state of the finite control and the tape symbol just scanned.

• In one move, the Turing machine will:1. Change state.2. Write a tape symbol in the cell scanned.3. Move the tape head left or right.

Page 9: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machine-Formal Notation

• Formally, a Turing machine is a 7-tupleM = (Q, ∑, Γ, δ, q0,B, F)where:1. Q : The finite set of states of the finite control.2. ∑ : The finite set of input symbols.3. Γ : The finite set of tape symbols; ∑ Γ.4. δ : The transition function.5. q0 ϵ Q is the start state.6. B ϵ Γ is the blank symbol; B ϵ ∑.7. F µ Q is the set of final or accepting states.

Page 10: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

The transition function

• The arguments of δ(q, X) are a state q and a tape symbol X. The value of δ(q, X), if it is defined, is a triple (p, Y, D), where,

• p is the next state in Q.• Y is the symbol, in Γ, written in the cell being

scanned, replacing whatever symbol was there.• D is a direction, either L or R, standing for “left”

or “right”, respectively, and telling us the direction in which the head moves.

Page 11: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Turing Machine-Instantaneous Descriptions (IDs)

• A Turing machine changes its configuration upon each move.

• We use instantaneous descriptions (IDs) for describing such configurations.

• An instantaneous description is a string of the formX1X2 · · ·Xi−1qXiXi+1 · · ·Xn

where,1. q is the state of the Turing machine.2. The tape head is scanning the ith symbol from the left.3. X1X2 · · ·Xn is the portion of the tape between the leftmost and

rightmost nonblanks.

Page 12: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Moves of a Turing Machine

• We use |-- M to designate a move of a Turing machine M from one ID to another.

• If δ(q, Xi) = (p, Y, L), then:X1X2 · · ·Xi−1qXiXi+1 · · ·Xn |-- M

X1X2 · · ·Xi−2pXi−1Y Xi+1 · · ·Xn

• If δ(q, Xi) = (p, Y, R), then:X1X2 · · ·Xi−1qXiXi+1 · · ·Xn |-- M

X1X2 · · ·Xi−1Y pXi+1 · · ·Xn

Page 13: Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous

Moves of a Turing Machine

• The reflexive-transitive closure of |-- M is denoted by |--*M.