documenttm

26

Upload: hafeez-khan

Post on 02-Jul-2015

99 views

Category:

Education


4 download

DESCRIPTION

Turing Machines and Computability

TRANSCRIPT

Page 1: DocumentTm
Page 2: DocumentTm
Page 3: DocumentTm

),,,,,,( 0 FqQM

States Input

alphabe

t

Tape

alphabet

Transition

function Initial

stateblank

The

Tape

Halt

Page 4: DocumentTm

No boundaries -- infinite

length............

Read-Write head

The head moves Left or

Right

Page 5: DocumentTm

............

Read-Write

headThe head at each transition (time

step):

1. Reads a symbol

2. Writes a symbol

3. Moves Left or Right

Page 6: DocumentTm

............

Time 2

a b k c

............

a a cb

Time 1

1. Reads

2. Writes

a

k

3. Moves Left

Page 7: DocumentTm

............

Time 2

a b k c

Time 3............

a k cf

1. Reads

2. Writes

b

f

3. Moves Right

Page 8: DocumentTm

............

head

a b ca

Head starts at the leftmost position of the input string

Input stringBlank

symbol

Page 9: DocumentTm

1q 2qLba ,

Read WriteMove Left

1q 2qRba ,

Move Right

Page 10: DocumentTm

1q 2qRba ,

............

a b ca

Time 1

1q

current state

Example:

Page 11: DocumentTm

............

a b ca

Time 1

1q 2qRg,

............

ga b cb

Time 2

1q

2q

Example:

Page 12: DocumentTm

1q

2qRba ,

Allowe

d

Not Allowed

3qLdb ,

1q

2qRba ,

3qLda ,

No lambda transitions

allowed

Page 13: DocumentTm

The machine halts in a state if there is

no transition to follow

Page 14: DocumentTm

............

a b ca

1q

1q

2qRba ,

3qLdb , HALT !!!

Halting Example

No possible

transition

from and symbol1q c

Page 15: DocumentTm

1q 2q Allowed

1q 2q Not Allowed

Accepting States

•Accepting states have no outgoing transitions

•The machine halts and accepts

Page 16: DocumentTm

Accepts the language: *a

0q

Raa ,

L,1q

Input alphabet },{ ba

Turing Machine

Example

Page 17: DocumentTm

aaTime 1

0q

a

0q

Raa ,

L,1q

Page 18: DocumentTm

aaTime 2

0q

a

0q

Raa ,

L,1q

Page 19: DocumentTm

aaTime 3

0q

a

0q

Raa ,

L,1q

Page 20: DocumentTm

aaTime 4

0q

a

0q

Raa ,

L,1q

Page 21: DocumentTm

aaTime 5

1q

a

0q

Raa ,

L,1q

Halt & Accept

Page 22: DocumentTm

Rejection Example

0q

Raa ,

L,1q

baTime 1

0q

a

Page 23: DocumentTm

0q

Raa ,

L,1q

baTime 2

0q

a

No possible Transition

Halt & Reject

Page 24: DocumentTm

Transition Function

1q 2qRba ,

),,(),( 21 Rbqaq

1q 2qLdc ,

),,(),( 21 Ldqcq

Page 25: DocumentTm

For any Turing Machine

M

}:{)( 210 xqxwqwML f

Initial state Accept state

Page 26: DocumentTm

If a language is accepted

by a Turing machine

then we say that is: M

L

L

•Turing Recognizable