0% found this document useful (0 votes)
46 views13 pages

Turing Machine Notes

The document discusses Universal Turing Machines and provides details on their construction and implementation. It explains that a UTM can simulate any Turing machine when provided with an encoding of that machine and its input. It also gives the encoding scheme used to represent machine configurations, states, symbols, and directions. Finally, it provides examples of designing Turing machines to check for palindromes, equal numbers of symbols, and properly matched parentheses.

Uploaded by

221nicole0006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views13 pages

Turing Machine Notes

The document discusses Universal Turing Machines and provides details on their construction and implementation. It explains that a UTM can simulate any Turing machine when provided with an encoding of that machine and its input. It also gives the encoding scheme used to represent machine configurations, states, symbols, and directions. Finally, it provides examples of designing Turing machines to check for palindromes, equal numbers of symbols, and properly matched parentheses.

Uploaded by

221nicole0006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Universal Turing Machine

A Universal Turing Machine is a Turing Machine which when supplied with an


appropriate description of a Turing Machine M and an input string w, can simulate the
computation of w.

Construction of UTM
M
Without loss of generality, we assume the following for M:
 Q = {q1, q2, ….qn} where q1=initial state and q2=Final State
 τ = {σ1, σ2,,…σn} where σ represent blanks
 Select an encoding on which q1 is representable by 1, q2 by 11, and so on.
 Similarly, σ1 is encoded as 1, σ2 as 11, etc.
 Finally, let us represent R/W head directions by 1 for L (Left) and 11 for R(Right).
 The symbol 0 will be used as a separator between 1s.
With this scheme, any transition of M can be given as :

Implementation of UTM
A UTM Mu then has an input alphabet = {0, 1} and the structure of a multi-tape
multi TM.
 Mu looks first at the contents of Tape 2 and Tape 3 to determine the instantaneous
description (ID) of M.
 It then consults Tape1 to see what M would do with this ID.
 Finally, Tape 2 and Tape 3 will be modified to reflect the result of the move.
If no transition for a given ID is formed, Mu halts as M must :
 In either case, Mu behaves as M would.
 If M halts, when presented with string w then Mu will halt when ppresented
resented with the
encoded M and the encoded string on its tape.
 Moreover, the final string Mu .s tape will be the encoding of the string.
 When M halts, Mu can tell if it is in the single accepting state and so moves to an
accepting state of its own ( or no
not).
TURING MACHINE NOTES:

1] Design a TM which recognizes palindromes , input valid over {a,b}

Solution :

Step 1: Definition- A Turing machine is a finite automaton that can read, write, and erase
symbols on an infinitely long tape

Step 2: Tuple

 Q is a finite set of states


 X is the tape alphabet
 ∑ is the input alphabet
 δ is a transition function; δ : Q × X → Q × X × {Left_shift, Right_shift}.
 q0 is the initial state
 B is the blank symbol
 F is the set of final states

Step 3: Logic

Types of palindromes:

 wwR
 wawR
 wbwR

where w is string containing a, b where |w| >=1

Step 4 : Transition diagram


2] Design a TM to check equal no. of b’s and a’s , input valid over {a,b}

Solution :

Step 1: Definition- A Turing machine is a finite automaton that can read, write, and erase
symbols on an infinitely long tape

Step 2: Tuple

Step 3 : Logic

 Scan and find the first a or first b


 Find first ‘a’ convert to X , find first b convert to X
 Repeat till all inputs become X .
Step 4: Transition diagram

Step 5 : Transition table


3] Design a TM for well formed parathesis (( )) ( )
 Repeat steps 1,2,3, 5 as previous problem
 Find the leftmost first ) and convert to X
 Then move left and find the first ( and convert to X

You might also like