lec17 - PowerPoint by honeytech

VIEWS: 320 PAGES: 12

									TURING MACHINES AS TRANSDUCERS
Turing machine also provides us with a simple abstract model for digital computers in general. Since the primary purpose of a computer is to transform input into output, i.e. it acts as a transducer.

TURING MACHINES AS TRANSDUCERS
•Input - nonblank symbols on the tape at initial time •output- whatever is then on the tape at end
A function f with domain D is said to be Turing -computable or just computable if there exists some Turing machine .
M  (Q ,  ,  ,  , q 0 , B , F )
such that q 0w   M q f f ( w ), q f  F ,  w  D .


Example Given two positive integers x and y, design a Turing machine that computes xy

Assume w(x) and w(y) are on the tape in unary notation, separated by single blank, with read-write head on the leftmost symbol of w(x).

After the computation, w(x+y) will be on the tape followed by blank and the read-write head will be positioned at the left end of the result.

q 0 w ( x ) Bw ( y )   q f w ( x  y ) B , q f  final state



q 0 111 B 11

1q 0 11 B 11

11 q 0 1 B 11

111 q 0 B 11

1111 q 1 11

11111 q 1 1

111111 q 1 B

11111 q 2 1 B

1111 q 3 1 BB 1q 3 1111 BB
q 4 11111 B

111 q 3 11 BB q 3 11111 BB

11 q 3 111 BB q 3 B 11111 BB

Q  {q 0 , q 1 , q 2 , q 3 , q 4 } F  {q 4 }  ( q 0 ,1 )  ( q 0 ,1 , R ),  ( q 0 , B )  ( q 1 ,1 , R ),  ( q 1 ,1 )  ( q 1 ,1 , R ),  ( q 1 , B )  ( q 2 , B , L ),  ( q 2 ,1 )  ( q 3 , B , L ),  ( q 3 ,1 )  ( q 3 ,1 , L ),  ( q 3 , B )  ( q 4 , B , R ).

Design a Turing machine that copies strings of 1’s. More precisely, find a machine that performs the computation

q 0w   q f ww , for any w  {1} .





1. Replace every 1 by an x. 2. Find the rightmost x and replace it with 1.
3. Travel to the right end of the current nonblank region and create a 1 there.

4. Repeat Steps 2 and 3 until there are no more x’s.

In computer programming , we use pseudocode (way of outlining a computation using descriptive phrases whose meaning we claim to understand) We use psedocode in Turing Machine also. Macroinstructions.
Example : if a then q 0 else q k. In Turing  q i , a   q j 0 , a , R  q i  Q ,  q j0 , c   q j , c , L  c   , Machine we write as

 q i , b   q k 0 , b , R  q i  Q & all b   - {a},  q k0 , c   q k , c , L  c   ,

Replace macroinstructions with subprograms. Before A calls B, it writes the information needed by B on the tape in some region T. T
#
Workspace for A Region separator #

Workspace for B

A then passes control to B by making a transition to the start state of B.
After transfer, B will use T to find its input. The workspace for B is separate from T and from the work space for A, so no interference can occur. When B is finished , it will return relevant results to region T, where A will expect to find it.

Class Discussion

Design a Turing machine to check whether a given Unary no. is divisible by “3” or not.

Church/Turing Thesis - expanded
1. Any language that an algorithm can decide can be decided by a Turing machine and vicaa-versa. 2. Any language that an algorithm can recognize can be recognized by a Turing machine and vica-a-versa. 3 Any function that an algorithm can compute can be computed by a Turing machine and vica-a-versa 4. Time bounds, non-determinism also apply

1. Anything that can be done on any existing digital computer can also by done by a TM.
2. No one has yet been able to suggest a problem, solvable by what we intuitively consider an algorithm, for which a TM program cannot be written.

3. Alternative models have been proposed for mechanical computation, but none of them are more powerful than the TM model.

Definition f : D  R is a Turing

An algorithm

for a function

machine

M,

which given as input any d  D on its tape, eventually the correct answer f(d)  R on its tape. Specifical ly, we can require


halts with

that

q 0d   M q f f ( d ), q f  F  d  D .


								
To top