Powerpoint on different types of turing machines

© All Rights Reserved

8 views

Powerpoint on different types of turing machines

© All Rights Reserved

- Pegasus – First Steps Toward a Naturalistic Programming
- Libri Da Leggere
- Computational Complexity
- ProDeo 2.9 Info
- Z_del_agr (Nota 313587 )
- Maths 4 Comp
- Geometry Assignments 2012-13
- Coding Temple Opens Boston Office
- Avr Compiler (1)
- Curriculum Vitae
- Tutorial for First Order Predicate Logic I -Lecture6
- 8_Boolean
- 116830_Assignment Question 1 EME3156
- 1203.3170
- Metodo Simplex QMWINDOWS
- Module 40 Task UI Creating a Task
- PayRollManagement
- تعلم صنع الالعاب بواسطة برنامج 3D Game Studio
- Chapter+2
- Keywords

You are on page 1of 54

Zeph Grunschlag

2

Announcement

Midterms not graded yet

Will get them back Tuesday

3

Agenda

Turing Machine Variants

Non-deterministic TMs

Multi-Tape

4

Input-Output Turing Machines

Input/output (or IO or transducing) Turing

Machines, differ from TM recognizers in that

they have a neutral halt state q

halt

instead of

the accept and reject halt states. The TM is

then viewed as a string-function which takes

initial tape contents u to whatever the non

blank portion of the tape is when reaching

q

halt

. If v is the tape content upon halting,

the notation f

M

(u) = v is used.

If M crashes during the computation, or enters

into an infinite loop, M is said to be

undefined on u.

5

Input-Output Turing Machines

When f

M

crashes or goes into an infinite

loop for some contents, f

M

is a partial

function

If M always halts properly for any

possible input, its function f is total

(i.e. always defined).

6

TM Notations

There are three ways that Sipser uses to

describe TM algorithms.

1) High level pseudocode which explains how

algorithm works without the technical

snafoos of TM notation

2) Implementation level describe how the TM

operates on its tape. No need to mention

states explicitly.

3) Low-level description. One of:

Set of complete goto style instructions

State diagram

Formal description: spell out the 7-tuple

7

High-Level TM

Example

Let's for example describe a Turing

Machine M which multiplies numbers

by 2 in unary:

M = "On input w = 1

n

For each character c in w

copy c onto the next available b

blank space"

8

Implementation-Level TM

Example

The idea is to carry out the high level

description by copying each character

to the end. We also need to keep track

of which characters have already been

copied (or were copies themselves) by

distinguishing these characters. One

way is to use a different character, say

X.

EG: Lets see how 11111 is transformed.

9

Implementation-Level TM

Example

So round by round, tape transformed as

follows:

11111

X1111X

XX111XX

XXX11XXX

XXXX1XXXX

XXXXXXXXXX

1111111111

10

Implementation-Level TM

Example

Implementation level describes what

algorithm actually looks like on the Turing

machine in a way that can be easily turned

into a state-diagram

Some useful subroutines:

fast forward

move to the right while the given condition holds

rewind

move to the left while the given condition holds

May need to add extra functionality

Add $ if need to tell when end of tape is

11

Implementation-Level TM

Example

M = "On input w = 1

n

1. HALT if no input

2. Write $ in left-most position

3. Sweep right and write X in first blank

4. Sweep left through X-streak and 1-streak

5. Go right

6. If read X, go right and goto 9.

Else, replace 1 by X, move right.

7. If read X [[finished original w]] goto 8

Else, goto 3

8. Sweep to the right until reach blank, replace by X

9. Sweep left replacing everything non-blank by 1

10. HALT

12

Implementation-Level TM

Example

At the low level the Turing Machine is

completely described, usually using a

state diagram:

0

halt

R

2

1$,R

$|XR

1|XR

3 4

1L

1X,R

1,L

X,L

XL 1L

5 6

8

1R

XR

XR

9

X1,L

$1,L

$R

9

X1,L

13

Non-Deterministic TMs

A non-Deterministic Turing Machine N allows

more than one possible action per given

state-tape symbol pair.

A string w is accepted by N if after being put

on the tape and letting N run, N eventually

enters q

acc

on some computation branch.

If, on the other hand, given any branch, N

eventually enters q

rej

or crashes or enters an

infinite loop on, w is not accepted.

Symbolically as before:

L(N) = { x S* | accepting config. y, q

0

x * y }

(No change needed as need not be function)

14

Non-Deterministic TMs

Recognizers vs. Deciders

N is always called a non-deterministic

recognizer and is said to recognize

L(N); furthermore, if in addition for all

inputs and all computation branches, N

always halts, then N is called a non-

deterministic decider and is said to

decide L(N).

15

Non-Deterministic TM

Example

Consider the non-deterministic method:

void nonDeterministicCrossOut(char c)

while()

if (read blank) go left

else

if (read c)

cross out, go right, return

OR go right // even when reading c

OR go left // even when reading c

16

Non-Deterministic TM

Example

Using randomCross() put together a non-

deterministic program:

1. while(some character not crossed out)

nonDeterministicCrossOut(0)

nonDeterministicCrossOut(1)

nonDeterministicCrossOut(2)

2. ACCEPT

Q: What language does this non-deterministic

program recognize ?

17

Non-Deterministic TM

Example

A: {x {0,1,2}* | x has the same no.

of 0s as 1s as 2s }

Q: Suppose q is the state of the TM while running

inside nonDeterministicCrossOut(1) and q is

the state of the TM inside

nonDeterministicCrossOut(2).

Suppose that current configuration is

u = 0XX1Xq12X2

For which v do we have u v ?

18

Non-Deterministic TM

Example

A: 0XX1Xq12X2

0XX1qX12X2 | 0XX1X1q2X2 | 0XX1XXq 2X2

These define 3 branches of computation

tree:

Q: Is this a non-deterministic TM decider?

0XX1XXq 2X2

0XX1Xq12X2

0XX1X1q2X2 0XX1qX12X2

19

Non-Deterministic TM

Example

A: No. This is a TM recognizer, but not a decider.

nonDeterministicCrossOut() often enters an

infinite branch of computation since can see-

saw from right to left to right, etc. ad infinitum

without ever crossing out anything. I.e.,

computation tree is infinite!

Note: If you draw out state-diagrams, you will see

that the NTM is more compact, than TM

version so there are some advantages to non-

determinism! Later, will encounter examples

of efficient nondeterministic programs for

practically important problems, with no known

efficient counterpart: The P vs. NP Problem.

20

NTMs

Konigs Infinity Lemma

For Problem 3.3 in Sipser the following fact is

important:

If a NTM is a decider then given any input,

there is a number h such that all computation

branches involve at most h basic steps. I.e.,

computation tree has height h. Follows from:

Konigs Infinity Lemma: An infinite tree with

finite branching at each node must contain an

infinitely long path from the root.

Or really, the contrapositive is used: A tree

with no infinite paths, and with finite

branching must itself be finite.

21

Konigs Infinity Lemma

Proof Idea

Idea is to smell-out where the infinite

part of the tree is and go in that

direction:

22

Konigs Infinity Lemma

Proof Idea

Idea is to smell-out where the infinite

part of the tree is and go in that

direction:

23

Konigs Infinity Lemma

Proof Idea

Idea is to smell-out where the infinite

part of the tree is and go in that

direction:

24

Konigs Infinity Lemma

Proof Idea

Idea is to smell-out where the infinite

part of the tree is and go in that

direction:

25

Konigs Infinity Lemma

Proof Idea

Idea is to smell-out where the infinite

part of the tree is and go in that

direction:

26

Konigs Infinity Lemma

Proof

Proof. Given an infinite tree with finite

branching construct an infinite path

inductively:

Vertex v

0

: Take the root.

Edge v

n

v

n+1

: Suppose v

0

v

1

v

n-1

v

n

has been constructed and that the

subtree from v

n

is infinite. Then one of

v

n

s finite no. of children, call it v

n+1

,

must have an infinite subtree, so add

the edge v

n

v

n+1.

27

Multi-tape TMs

Often its useful to have several tapes

when carrying out a computations. For

example, consider a two tape I/O TM

for adding numbers (we show only how

it acts on a typical input)

28

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

Input string

29

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

30

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

31

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

32

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

33

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

$

34

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

$ 1

35

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

$ 1 0

36

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

$ 1 0 1

37

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

$ 1 0 1 1

38

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1 1

$ 1 0 1 1

39

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0 1

$ 1 0 1 1

40

Multi Tape TM

Addition Example

$ 1 0 1 $ 1 0

$ 1 0 1 1

41

Multi Tape TM

Addition Example

$ 1 0 1 $ 1

$ 1 0 1 1

42

Multi Tape TM

Addition Example

$ 1 0 1 $

$ 1 0 1 1

43

Multi Tape TM

Addition Example

$ 1 0 1

$ 1 0 1 1

44

Multi Tape TM

Addition Example

$ 1 0 0

$ 1 0 1 0

45

Multi Tape TM

Addition Example

$ 1 0 0

$ 1 0 0 0

46

Multi Tape TM

Addition Example

$ 0 0 0

$ 1 0 0 0

47

Multi Tape TM

Addition Example

0 0 0 0

$ 0 0 0 0

48

Multi Tape TM

Addition Example

1 0 0 0

1 0 0 0 0

49

Multi Tape TM

Addition Example

1 0 0 0

1 0 0 0 0

50

Multi Tape TM

Addition Example

1 0 0 0

1 0 0 0 0

51

Multi Tape TM

Addition Example

1 0 0 0

1 0 0 0 0

52

Multi Tape TM

Addition Example

1 0 0 0 0

1 0 0 0 0

Output

string

HALT!

53

Multitape TMs

Formal Notation

NOTE: Sipsers multitape machines cannot

pause on one of the tapes as above example.

This isnt a problem since pausing 1-tape

machines can simulate pausing k-tape

machines, and non-pausing 1-tape machines

can simulate 1-tape pausing machines by

adding dummy R-L moves for each pause.

Formally, the d-function of a k-tape machine:

k k k

} R L, { : Q Q

54

Multitape TMs

Conventions

Input always put on the first tape

If I/O machine, output also on first

tape

Can consider machines as string-

vector generators. E.g., a 4 tape

machine could be considered as

outputting in (S*)

4

- Pegasus – First Steps Toward a Naturalistic ProgrammingUploaded byAhmad Pujianto
- Libri Da LeggereUploaded byalberoblu
- Computational ComplexityUploaded byigbboy
- ProDeo 2.9 InfoUploaded byCesar Martin Alonso
- Maths 4 CompUploaded byMd Rubaiyat Bhuiyan
- Z_del_agr (Nota 313587 )Uploaded bySnto Snto
- Geometry Assignments 2012-13Uploaded byajramroth
- Coding Temple Opens Boston OfficeUploaded byPR.com
- Avr Compiler (1)Uploaded byHairo Gutierrez Espinoza
- Curriculum VitaeUploaded bysharish_04
- Tutorial for First Order Predicate Logic I -Lecture6Uploaded bytheresa.painter
- 8_BooleanUploaded byVishal Gaur
- 116830_Assignment Question 1 EME3156Uploaded byVictor Loong
- 1203.3170Uploaded byRavindra Jagadale
- Metodo Simplex QMWINDOWSUploaded byMargarita Aguagallo Janeta
- Module 40 Task UI Creating a TaskUploaded byRealVasyaPupkin
- تعلم صنع الالعاب بواسطة برنامج 3D Game StudioUploaded byAhmed Sabry
- PayRollManagementUploaded bySuprasannaDikpati
- Chapter+2Uploaded bydiyana8894
- KeywordsUploaded byAnas
- P127 OrderForm_V20_062017Uploaded bySanjay Sarath
- WKS Logic Solver_Invensys_Fabrízio.pdfUploaded byLenice Bassetto
- Message TypesUploaded byjokest
- BLLUploaded bytbijle
- Reingold Tilford TreeUploaded byEmma Bells
- steven java.txtUploaded bySTEVEN ANDRES NOGUERA MOSQUERA
- Ivanova MatlabUploaded byMartin Nderitu
- Test Marzo12 Eng SolUploaded byAl VAro
- Butterfly codingUploaded bySuresh Manjini
- computer programmingUploaded byapi-286033529

- Skill Set for Competitive ProgrammingUploaded byPulkit Aggarwal
- practicle loss resilient codes.pdfUploaded bypathmakerpk
- Math Investigation Inverse FunctionsUploaded bysilvermalign
- Hybrid Domain based Face Recognition using DWT, FFT and Compressed CLBPUploaded byAI Coordinator - CSC Journals
- Calculus for Engineers: Chapter 16 - Laplace Transforms - SolutionsUploaded byscream
- Primes Pi and Irrationality MeasureUploaded byhumejias
- Glossary_ a Quick Guide to the Mathematical JargonUploaded byLeonardo Martins Freiria
- hw4solutions.pdfUploaded byNafiur Rahman
- Spring 2008 MTH301 2 SOLvedUploaded bycs619finalproject.com
- Activity06.pdfUploaded byJoseph Cedric Quirino
- Tuning Advanced PID Controllers via Direct H∞-Norm MinimizationUploaded byH.E. Musch
- Maths Package FDUploaded bykandebeach
- LectureSetIII_PartTwo_Laplace_Transforms.docUploaded byEdgar Mugarura
- RevisionUploaded byWan Hafiz
- Reinhold Burger, George Labahn and Mark van Hoeij- Closed Form Solutions of Linear Odes having Elliptic Function CoefficientsUploaded by23213m
- NM6_optim_s02 (1)Uploaded byJake Magdalas
- Exponential - MATLAB ExpUploaded byNur Azizah
- vdrfmemoUploaded byJorge Pachas
- Holzapfel-Uludag-Yoshida - Arithmetic and Geometry Around Hypergeometric FunctionsUploaded bychungsam19
- 6 Toward a CPFLOW-Based AlgorithmUploaded byJavier Eduardo Velarde Salas
- ee2209 viva questionsUploaded byAnirudhan Ravi
- Lineer_algebra VectorSpacesUploaded bythe nile
- A FEW OLD PROBLEMS.pdfUploaded bymoka0687
- FS GM Lesson PlanUploaded bycrisna
- 1 ESO - UNIT 03 - DIVISIBILITYUploaded byGoheim
- 01112007Uploaded byAvijeet Singh Jaswal
- First Prob SetUploaded byRavi Roy
- Bishop 1975Uploaded byDaniel Badiani
- NumCSE15.pdfUploaded byAnkit Shrivastava
- CBSE Class 12 Mathematics Integration Worksheet (5).pdfUploaded byKaran Pratap