Sei sulla pagina 1di 17

TURING MACHINE

Presented by: Gagan Virk

Informal def.
Alan Turing invented TM in 1936. A Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algo , and is particularly useful in explaining the functions of a CPU inside a computer. A model that can compute anything that a human can compute. Before invention of electronic computers the term computer actually referred to a person whos line of work is to calculate numerical quantities. Turings Thesis: Any algorithm can be carried out by one of his machines Turings machine is actually easily programmable, if you really get into it. Not practically useful.. Infinite storage coz tape is of infinite length.

TM model

Formal definition
A Turing Machine is a 7-tuple, M = (Q, , , , q0, B, F), where Q = Finite non-empty set of states. q0 = initial state F = set of Final states (if M ever enters a final state, M accepts its input) = input alphabet; B is blank. = tape alphabet; {B} : fxn mapping Q x Q y {D} where x,y:tape alphabets,D is direction L or R.

Working
If read 1, write 0, go right, repeat. If read 0, write 1, HALT!

1 1

If read 1, write 0, go right, repeat. If read 0, write 1, HALT!

If read 1, write 0, go right, repeat. If read 0, write 1, HALT!

If read 1, write 0, go right, repeat. If read 0, write 1, HALT!

0 0

If read 1, write 0, go right, repeat. If read 0, write 1, HALT!

If read 1, write 0, go right, repeat. If read 0, write 1, HALT!

0 0

Comparison with Previous Models


Device
FA PDA Separate Input? Yes Yes Read/Write Data Structure None LIFO Stack Infinite tape. 1 cell access per step. Deterministic by default? Yes No Yes (but will also allow crashes)

TM

No

Why TM?/ Differences


Cells of tape of FA and PDA are read/scanned bt are never changed,whereas cells of TM may read/writen into. The tape head of FA or PDA always moves from left to right whereas in TM,both left or right. In FA,PDA information already scanned donot play any role in deciding future moves of automation but in TM,the info contents scanned earlier also play role.

Representation of TM
By instantaneous descriptions By transition table By transition diagram

Instantaneous description using


Configuration or ID of TM: A configuration is string u q v
q is Current state uv Current tape contents Current head location is at v A Turing machine accepts input w if a sequence of configurations C1,C2,...,Ck exists where
1. C1 is the start configuration of M on input w 2. Each Ci yields Ci+1 3. Ck is an accepting configuration

By TT
Consider M where Q ={ q1,q2,q3,q4,q5 } = { 0, 1,b } b = 0 = "blank" =see state-table q1= initial state q4= final state
P.S B Tape symbol 0 1

q1
q2 q3 q4 q5

1Lq2
BRq3

0Rq1
0Lq2 BRq4 1Lq2 BRq5 1Rq4

0Rq5 0Lq2

0Rq4

By TD
Let the move of TM: (q,a) = (q1,,R) (a, ,R)
q
q1

Language acceptabilty by TM
Let M=(Q, , , , q0, b, F). L(M) = {w /w * and q0w qf} Where , * When we start TM on an input, three outcomes are possible: 1. ACCEPT: TM accepts I/P if starting from initial state and halts on final state after reading last symbol of I/P string. 2. REJECT: TM rejects I/P if starting from initial state and halts on non- final state after reading last symbol of I/P string. 3. LOOP: if m/c does not Halt .

Potrebbero piacerti anche