Module 5 Turing Machines
Module 5 Turing Machines
Chapter 6
TURING MACHINE
Turing machine was invented by Alan Turing in 1936. It is a mathematical model of computer. Turing
machines prove fundamental limitations on the power of mechanical computation. While they can express
arbitrary computations, their minimalistic design makes them unsuitable for computation in practice: real-
world computers are based on different designs that, unlike Turing machines, use random-access memory.
Turing completeness is the ability for a system of instructions to simulate a Turing machine. A
programming language that is Turing complete is theoretically capable of expressing all tasks
accomplishable by computers; nearly all programming languages are Turing complete if the limitations of
finite memory are ignored.
The pictorial representation of Turing machine is shown in the figure 6.1. The machine consists of a finite
control, which can be in any of a finite set of states. It has an input tape divided into finite cells; each can
hold one symbol. Initially an input string over alphabet is stored in the tape. Default value of tape is blank
symbol called B, it is a tape symbol it is not an input symbol. There is a tape head always pointing at the
leftmost cell of the tape. A move of the Turing machine is a function of the state of the finite control and
the tape symbol scanned. In one move Turing machine will:
i. Change state. The next state optionally may be the same as the current state.
ii. Write a tape symbol in the cell scanned. This tape symbol replaces whatever symbol was in
that cell.
Turing machine can be defined with 5-tuples
MT= (Q, ∑, δ, B, ┌, IS, FS)
Q= Number of states used in the Turing machine.
∑= {a, b}
┌ = Tape symbol {a, b, B}
B = Blank symbol.
δ:
Q x ∑=Q, ┌, D where, D is direction
For example if the input string is aabb, it is stored in the input tape shown in figure 6.1.
Page 6.1
TURING MACHINE
δ(q0, a)=q1, X, R;
δ(q1, a)=q1, a, R;
δ(q1, b)=q2, Y, L;
δ(q2, a)=q2, a, L;
δ(q2, X)=q0, X, R;
δ(q2, Y)=q2, Y, L;
δ(q0, Y)=q0, Y, R;
δ(q0, B)=q3, B, R;
Example 6.1: Design a Turing machine for the language L={anbncn : n≥1}
The processing of string aabbcc is shown below.
δ(q0, a)=q1, X, R;
δ(q1, a)=q1, a, R;
Page 6.2
TURING MACHINE
δ(q1, b)=q2, Y, R;
δ(q2, b)=q2, b, R;
δ(q2, c)=q3, Z, L;
δ(q3, Z)=q3, Z, L;
δ(q3, b)=q3, b, L;
δ(q3, Y)=q3, Y, L;
δ(q3, a)=q3, a, L;
δ(q3, X)=q0, X, R;
δ(q1, Y)=q1, Y, R;
δ(q2, Z)=q2, Z, R;
δ(q0, Y)=q0, Y, R;
δ(q0, Z)=q0, Z, R;
δ(q0, B)=q4, B, R;
δ(q0, B)=q3, B, R;
Page 6.3
TURING MACHINE
δ(q1, 0)=q1, 0, R;
δ(q2, X)=q0, X, R;
δ(q2, 0)=q2, 0, L;
δ(q2, 1)=q2, 1, L;
δ(q0, Y)=q0, Y, R;
δ(q0, B)=q3, B, R;
Page 6.4
TURING MACHINE
δ : Q × Γ→ Q × Γ ×{L, R, U, D},
Where U and D specifies movement of the read-write head up and down.
Page 6.5
TURING MACHINE
Figure 6.9: Multi-dimensional Turing machine in the form of multi-tape Turing machines.
Page 6.6