




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to turing machines, an abstract model of a computer designed by alan turing. It covers the concept of a turing machine, its components, and the rules of transition. The document also includes examples of turing machines and their traces, as well as an explanation of how turing machines can be used as acceptors.
Typology: Study notes
1 / 8
This page cannot be seen from the preview
Don't miss anything!





415
416
0 1 2 3 4 5 6 ...
...
A quintuple M = (Q, Σ, Γ, δ, q0)
0 1 2 n
...
q
c1 c2 ... cn B B ...
...
B
Computation begins with
418
... ...
q
x ... y ...
q’
419
... ...
q
x
Machine to add 1 to a binary number
q0 B/B R q1 B/B L q
0/0 R 1/1 R
0/1 R q
1/0 L
B/1 R
q 0 B 001 B q 0 B 11 B Bq 1001 B Bq 111 B B 0 q 101 B B 1 q 11 B B 00 q 11 B B 11 q 1 B B 001 q 1 B B 1 q 21 B B 00 q 21 B Bq 210 B B 0 q 200 B q 2 B 00 B B 01 q 30 B 1 q 300 B
424
0 1 2 3 4 5 6 ...
...
A sextuple M = (Q, Σ, Γ, δ, q 0 , F )
425
q
0/0 R 1/1 R
B/B R (^) q1 0/B R
1/B R
0/0 R 1/1 R
q
q
q
q
B/B L
B/B L
0/B L (^) q
0/0 L 1/1 L
1/B L
B/B R
A machine that accepts a string which is an even length palindrome of 0’s and 1’s. e.g 00 , 0110 , 0001001000 ∈ L(M )
Modify the even length palendrome machine to accept odd length palindromes too e.g. 101
q
0/0 R 1/1 R
B/B R (^) q1 0/B R
1/B R
0/0 R 1/1 R
q
q
q
q
B/B L
B/B L
0/B L (^) q
0/0 L 1/1 L
1/B L
B/B R
427
initial(q0).
428
run(Input, Output, State) :- initial(State0), tape_list_position(Tape0, Input, 0), run(State0, Tape0, State, Tape), tape_list_position(Tape, Output, _).
recognize(Input) :- run(Input, _, State), accepting(State).
q0 B/B R^ q1 c/c R
c/c L
q
q
q
q
a/a R
b/b L
b/b R (^) q
a/a L
a/a R b/b R c/c R
A machine which accepts strings of a’s, b’s and c’s where there is a c followed by or preceded by ab.
433
q 0 BacabB 1 q 0 BacabB 1 q 0 BacabB 2 Bq 1 acabB 1 Bq 1 acabB 1 Bq 1 acabB 2 Baq 1 cabB 1 Baq 1 cabB 1 Baq 1 cabB 3 Bacq 1 abB 1 Bacq 2 abB 2 Bq 3 acabB Bacaq 1 bB 1 Bacaq 4 bB 1 Bacabq 1 B ` Bacabq 6 B
First and third do not accept, but second does That’s good enough: the machine accepts
434
436
437