{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Files 3 - The University of Nottingham School of Computer...

This preview shows pages 1–4. Sign up to view the full content.

The University of Nottingham School of Computer Science and IT Dr. Natalio Krasnogor 1 LECTURE 5 – TURING MACHINES PART 1 Overview The Turing Machine Model Examples of Turing Machine The Turing Machine Model The Turing machine (TM) is a simple and powerful mathematical model of computation that can be used as language acceptor, language translator, function evaluator. The languages that the Turing machine can compute are recursively enumerable. The graphical model of the Turing machine is as follows: # # # x 1 x 2 x 3 -- X n # # -3 -2 -1 0 1 2 3 n q Head A move in the Turing machine depends on the current input symbol (x 1 in the above illustration) and the current state (q in the above illustration). A step in a Turing machine program is an action which is specified as a 5-tuple of the form: (current state, current tape symbol, new state, new symbol, direction of move) For example, the action (q,x 1 ,p,r,R) in the above illustration means that x 1 is replaced by r, q changes to p, and the head moves to the right and then points to the symbol x 2 .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The University of Nottingham School of Computer Science and IT Dr. Natalio Krasnogor 2 The formal model of the Turing machine is: TM = ( Q , Σ , Γ , δ , q 0 , F ) with: Q is the set of states Σ is the set of input symbols Γ is the set of tape symbols including Σ and #. δ is the transition (partial) function δ = Q x Γ Q x Γ x { L , R } q 0 is the initial state F is the set of final states Turing machines can also be represented graphically using a state diagram which is a labelled directed graph. Examples of Turing Machines Simple Eraser . This Turing machine reads strings in the language given by the expression (0,1)* and replaces the right-most symbol by a blanc (#). TM = ({q 0 ,q 1 ,q 2 ,q 3 },{0,1},{0,1,#}, δ ,q 0 ,{p}) where δ is given by: Σ Q 0 1 # q 0 ( q 1 , 0 , R ) ( q 1 , 1 , R ) q 1 ( q 1 , 0 , R ) ( q 1 , 1 , R ) ( q 2 , # , L ) q 2 ( q 3 , # , L ) ( q 3 , # , L ) q 3 ( q 3 , 0 , L ) ( q 3 , 1 , L ) ( p , # , L ) Then, the above Turing machine processes the input string “1110” as follows: #q 0 1110# #1q 1 110# #11q 1 10# #111q 1 0# #1110q 1 # #111q 2 0# #11q 3 1## #1q 3 11## #q 3 111## q 3 #111## p##111## q0 q1 q3 p q2 1,1,R 0,0,R 0,0,R 1,1,R #,#,L 0,#,L 1,#,L 0,0,L 1,1,L #,#,L
The University of Nottingham School of Computer Science and IT Dr. Natalio Krasnogor 3 Parity Counter . Design a Turing machine that reads binary strings and counts the number of 1’s in the sequence. The output is 0 if the number of 1’s in the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

Files 3 - The University of Nottingham School of Computer...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online