A Turing machine is a mathematical model of computation that consists of an infinite tape divided into cells, a head that reads and writes symbols on the tape, finite states, and transition rules. It was invented by Alan Turing in 1936 to formalize the idea of an algorithm. A Turing machine operates by reading a symbol on the tape, updating its state and writing a new symbol based on transition rules, then moving the head left or right. If it reaches an accepting state, the input is accepted. A language is recursively enumerable if it is accepted by a Turing machine.
2. 2
A Turing Machine is an accepting device
which accepts the languages (recursively
enumerable set) generated by type 0
grammars. It was invented in 1936 by Alan
Turing
3. A Turing Machine (TM) is a mathematical model
which consists of an infinite length tape divided
into cells on which input is given.
It consists of a head which reads the input tape. A
state register stores the state of the Turing
machine.
After reading an input symbol, it is replaced with
another symbol, its internal state is changed, and
it moves from one cell to the right or left.
If the TM reaches the final state, the input string is
accepted, otherwise rejected.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19. 19
…….. ……..
• Two-way, infinite tape, broken into cells, each containing one symbol.
• Two-way, read/write tape head.
• An input string is placed on the tape, padded to the left and right infinitely with
blanks, read/write head is positioned at the left end of input string.
• Finite control, i.e., a program, containing the position of the read head, current
symbol being scanned, and the current state.
• In one move, depending on the current state and the current symbol being
scanned, the TM 1) changes state, 2) prints a symbol over the cell being scanned,
and 3) moves its’ tape head one cell left or right.
Finite
Control
B B 0 1 1 0 0 B B
20. 20
A DTM is a seven-tuple:
M = (Q, Σ, Γ, δ, q0, B, F)
Q A finite set of states
Σ A finite input alphabet, which is a subset of Γ– {B}
Γ A finite tape alphabet, which is a strict superset of Σ
B A distinguished blank symbol, which is in Γ
q0 The initial/starting state, q0 is in Q
F A set of final/accepting states, which is a subset of Q
δ A next-move function, which is a mapping (i.e., may be undefined) from
Q x Γ –> Q x Γ x {L,R}
Intuitively, δ(q,s) specifies the next state, symbol to be written, and the
direction of tape head movement by M after reading symbol s while in state q.
21. • A TM accepts a language if it enters into a final state
for any input string w. A language is recursively
enumerable (generated by Type-0 grammar) if it is
accepted by a Turing machine.
• A TM decides a language if it accepts it and enters
into a rejecting state for any input not in the
language. A language is recursive if it is decided by
a Turing machine.
• There may be some cases where a TM does not stop.
Such TM accepts the language, but it does not decide
it.
22. 22
Let M = (Q, Σ, Г, δ, q0, B, F) be a TM.
Definition: An instantaneous description (ID) is a triple α1qα2, where:
– q, the current state, is in Q
– α1α2, is in Г*, and is the current tape contents up to the rightmost non-
blank symbol, or the symbol to the left of the tape head, whichever is
rightmost
– The tape head is currently scanning the first symbol of α2
– At the start of a computation α1= ε
– If α2= ε then a blank is being scanned
Example: (for TM #1)
q00011 Xq1011 X0q111 Xq20Y1 q2X0Y1
Xq00Y1 XXq1Y1 XXYq11 XXq2YY Xq2XYY
XXq0YY XXYq3Y XXYYq3 XXYYBq4