Professional Documents
Culture Documents
Chapter Six: Turing Machine
Chapter Six: Turing Machine
Turing Machine
Read-write head
Tape
A secondary storage of unlimited capacity.
a1 a2 ak 1 a k ak 1 an
to be a1a2 ak 1qak an .
A move from one
If δ (q, ak ) ( p, b, L), then we write configuration to
another will be
a1a2 ak 1qak ak 1 an a1a2 pak 1bak 1 an denoted by |
If δ (q, ak ) ( p, b, R), then we write
a1a2 ak 1qak ak 1 an a1a2 ak 1bpak 1 an
Definition 9.3
Let M (Q,Σ,,δ , q0 , ,F ) be a Turing machine. Then the language
accepted by M is
L( M ) {w : q0 w
*
x1q f x2 for some q f F , x1 , x2 *} 15
Example 9.6 For Σ {0,1}, design a Turing machine that accepts the language
denoted by the regular expression 00*.
Solution
(1) Starting at the left end of the input and check if the first one is a 0.
(2) If we reach a blank without encountering anything but 0, we terminate and
accept the string. If the input contains a 1 anywhere, the string is not in L(00*),
and we halt in a non final state.
Q {q0 , q1}, δ(q0 ,0 ) (q0 ,0,R),
F {q1} δ(q0 , ) (q1, ,R).
Q {q0 , q1 , q2 , q3 , q4 },
F {q4 }
{a, b}
{a, b, x, y, }
δ(q0 ,a) (q1,x,R), δ(q 2 ,y) (q 2 ,y,L), δ(q0 ,y) (q3 ,y,R),
δ(q1, a) (q1,a,R), δ(q 2 , a) (q 2 ,a,L), δ(q3 , y ) (q3 ,y,R),
δ(q1, y ) (q1,y,R), δ(q 2 , x) (q0 ,x,R), δ(q3 , ) (q 4 , ,R).
δ(q1, b) (q 2 ,y,L),
a a b b blank
L=(a*b+a*bc)
Definition 9.4
A function f with domain D is said to be Turing - computable or just
computable if there exists some Turing machine M (Q,Σ,,q0 , ,F )
such that
q0 w *
M q f f ( w), q f F,
for all w D.
0:1,R
δ(q3 ,1) (q3 ,1,L),
δ(q3 , ) (q 4 , ,R). B:B,L
11111q21
1111q310 * q3 111110
5/11/2021 Formal Langauge and Automata 21
q4111110
TM to add 1 to a binary number
Blank/lambda
5/11/2021 23
5/11/2021 Formal Langauge and Automata 24
Universal Turing Machines
• Limitation of Turing machine
– Turing Machines are “hardwired”
• they execute only one program
• Real Computers are re-programmable
• Solution: Universal Turing Machine
• Attributes:
– Reprogrammable machine
– Simulates any other Turing Machine
5/11/2021 Formal Langauge and Automata 25
Cont…
• Universal Turing Machine simulates
– any Turing Machine M
• Input of Universal Turing Machine:
– Description of transitions of M
– Input string of M