36-TM Encoding, Universal TM-22-04-2024
36-TM Encoding, Universal TM-22-04-2024
36-TM Encoding, Universal TM-22-04-2024
Theory of Computation
Lecture 28
Dr. Saritha Murali
(SCOPE, VIT Vellore)
22-04-2024
Encoding of Turing machine
Let M = (Q, Σ, Γ, d, q1, B, F) where Q = {q1 , q2 , q3 , . . . , qn }, q1 – initial state,
Γ = { 0, 1, B} , Σ = { 0, 1}
2. Direction encoding:
L -> D1
R -> D2
Encoding of Turing machine
Consider the transition function:
d(qi , Xj ) = (qk , Xl , Dm )
01 1 01 1 02 1 01 1 02 1102 1 01 1 03 1 01 1 02 11 03 1 01 1 04 1 02 1 02 11
03 1 02 1 04 1 02 1 01 11 03 1 03 1 04 1 02 1 02 11 04 1 01 1 03 1 02 1 01 11
04 1 02 1 05 1 02 1 02 11 04 1 03 1 03 1 02 1 01
Enumeration of Turing machine
111m111m2 11 m3 11 m411 m5 11 m611m711m8111
Each mi is of the form 0i 1 0j 1 0k 1 0l 1 0m
ith integer in binary represents ith Turing machine, say Ti
1 - T1
10 - T2 If the binary integer is not proper encoding, then the
11 - T3 respective TM will have no moves.
100 - T4
101 - T5
110 - T6
111 - T7
.....
Enumeration of Turing machine
• ith integer in binary represents ith TM
Recursively-enumerable
Recursive
Context-sensitive
Context-free
Regular