0% found this document useful (0 votes)
14 views

Module 5 Turing Machines

The Turing machine, invented by Alan Turing in 1936, is a mathematical model that illustrates the limitations of mechanical computation despite its ability to express arbitrary computations. It operates using a finite control and an input tape, processing strings through defined state transitions. Various types of Turing machines, including multi-dimensional, multi-tape, and non-deterministic machines, expand on the basic model to handle more complex computations.

Uploaded by

Ambar Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Module 5 Turing Machines

The Turing machine, invented by Alan Turing in 1936, is a mathematical model that illustrates the limitations of mechanical computation despite its ability to express arbitrary computations. It operates using a finite control and an input tape, processing strings through defined state transitions. Various types of Turing machines, including multi-dimensional, multi-tape, and non-deterministic machines, expand on the basic model to handle more complex computations.

Uploaded by

Ambar Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

TURING MACHINE

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

IS= Initial State of TM.

FS= Final state of TM.

For example if the input string is aabb, it is stored in the input tape shown in figure 6.1.

Figure 6.1: Turing Machine.


Turing machine uses IDs to process string; the IDs consist of state and input string. The IDs for the
string aabb is shown below.

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;

Figure 6.2: Turing machine for the string aabb.


MT=(Q, ∑, δ, B, ┌, IS, FS)
Q={q0, q1, q2, q3}
∑={a, b, c}
┌ = Tape symbol {a, b, c, B, X, Y}
B = Blank symbol.
δ: is defined above
IS=q0
FS=q3

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;

Figure 6.3: Turing machine for the language L={anbncn : n≥1}


MT=(Q, ∑, δ, B, ┌, IS, FS)
Q={q0, q1, q2, q3, q4}
∑={a, b, c}
┌ = Tape symbol {a, b, c, B, X, Y, Z}
B = Blank symbol.
δ: is defined above
IS=q0
FS=q4
Example 6.2: Design a Turing machine for the language L={wwR : w=(0+1)*}
The IDs for the string is shown below.

δ(q0, 0)| δ(q0, 1)=q1, X, R;


δ(q1, 0)| δ(q1, 1)=q2, Y , L;
δ(q1, 1)=q1, 1, 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;

Figure 6.4: Turing machine for the language L={wwR : w=(0+1)*}.


Example 6.3: Design a Turing machine for the language L= {ww : w=(0+1)*}.
The IDs for the string is shown below.

δ(q0, 0)| δ(q0, 1)=q1, X, R;


δ(q1, 0)| δ(q1, 1)=q2, Y , L;
δ(q1, 1)=q1, 1, R;
δ(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;

Figure 6.5: Turing machine for the language L= {ww : w=(0+1)*}.


Different types of Turing Machines
The Turing machine studied so far has simple one to understand the basic operation. By making use of
this knowledge we can construct the complex Turing Machine. They are of
i. Multi-dimensional Turing Machines
ii. Multi-tape Turing Machines
iii. Non-deterministic Turing Machines
i. Multi-dimensional Turing Machines
In this case, Turing machine has multi-dimensional tape, with a read write head. It uses basic
concept of Turing machine with modification of transition function as shown in figure 6.6.

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.

Figure 6.6: Multi-dimensional Turing Machine.


The basic Turing machine resembles like multi-dimensional Turing machine. It treats
multiple symbols as single symbol, because all symbols are stored in a single cell as shown in
figure 6.7.

Figure 6.7: Turing machine in the form of multi-dimensional Turing Machines.

ii. Multi-tape Turing Machines


Turing machine has multiple tapes, each with its read write head. It uses basic concept of Turing
machine with the modification of transition function as follows.
Q x ∑n=Q , ┌n, {L, R}n
For example, if n = 2, with a current configuration shown in Figure 6.8, then
δ(q0, 0, 1) = (q1, X, Y, L, R)

Figure 6.8: Multi-tape Turing Machines.


The transition rule can be applied only if the machine is in state q0 and the first read-write head read an 0
and the second an 1. The symbol on the first tape will then be replaced with an X and its read-write head
will move to the left. At the same time, the symbol on the second tape is rewritten as Y and the read-write
head moves right. The control unit then changes its state to q1 and the machine goes into the new
configuration shown in Figure 6.8.
Multi-dimensional uses extra caps to work like a multi-tape. It scans first row from left to right, whenever
it comes across symbol which has a cap, it stop scanning and changes the particular symbol to tape
symbol and move right or left with the cap. Next it scans second row, same actions are repeated in the
second row too as shown in figure 6.9.

Page 6.5
TURING MACHINE

Figure 6.9: Multi-dimensional Turing machine in the form of multi-tape Turing machines.

iii. Non-deterministic Turing Machines


Non-deterministic Turing Machines is similar to deterministic Turing machine, except the
transition function. The transition function is defined as
δ : Q × Γ → 2Q×Γ×{L, R}
If a Turing machine has transitions specified by
δ (q0, t) = {(q1,X, R), (q2,Y, L)},
in NPDA, the moves and are possible.

Page 6.6

You might also like