What is a multi-tape Turing machine?

A multiple tape Turing machine is a variant of the simple Turing machine. It consists of multiple tapes, each having its head pointer. It can be taken as a 2D array.

The heads of the multiple tapes can move in different directions independently. Initially, the input is placed in the first tape and is transferred to the other tapes as per convenience.

To learn more about the simple Turing machine, click here.

Formal theorem

The multi-tape Turing machine is a six tuple machine (Q,Σ,q0,Γ,δ,F)(Q, Σ, q_0, \Gamma, δ, F)

  • QQ - set of states
  • ΣΣ - set of input alphabets
  • q0q_0 - initial state
  • Γ\Gamma - set of tape alphabets
  • δδ - transition function that is Q ΓiQ Γi (Left,right,stationary)iQ \space * \Gamma^i \to Q \space * \Gamma^i \space *
    (Left, right, stationary)^i
  • FF - set of final states

Formation of the tapes

Initial multi-tapes are as follows:

Representation of a multiple tape

All the tapes involved are filled with the delta(Δ) symbols and grow infinitely to the right side. The first tape contains the input initially.

Example

Let's develop a two-tape Turing machine for a palindrome. Suppose our palindrome is abaaba. Initially, our tapes will be as follows:

Initial multiple tapes

The strategy we wish to use is that we copy the input into the second tape and compare the two tapes; the first from the beginning and the second backward.

A representation of how elements will be compared

Now for the Turing machine, each transition will be of the type:

(x,y)/(x,y),(D1,D2)(x,y) / (x',y'), (D_1,D_2)where xxand yyare the elements where the heads are pointing, xx'and yy'are the changes made in the pointed element, and D1D_1and D2D_2are the directions (L, R, S) to be made by both heads, respectively.

The Turing machine for abaaba palindrome will be:

g ENTRY q0 q0 ENTRY->q0 Ha Ha q1 q1 q0->q1 (Δ,Δ)/(Δ,Δ),(R,R) q1->q1 (a,Δ)/(a,a),(R,R) (b,Δ)/(b,b),(R,R) q2 q2 q1->q2 (Δ,Δ)/(Δ,Δ),(L,S) q2->q2 (a,Δ)/(a,Δ),(L,S) (b,Δ)/(b,Δ),(L,S) q3 q3 q2->q3 (Δ,Δ)/(Δ,Δ),(R,L) q3->Ha (Δ,Δ)/(Δ,Δ),(S,S) q3->q3 (a,a)/(a,a),(R,L) (b,b)/(b,b),(R,L)
Turing machine of a palindrome

Explanation

  • q0q1q_0 \to q_1: The first delta in both tapes is skipped, and the heads move to the right.
  • q1q1q_1 \to q_1 : The first tape's input is skipped but copied into the second.
  • q1q2q_1 \to q_2 : When the input is exhausted, the head pointer of the first tape is moved left so that it can reach the starting of the input, whereas the pointer of the second tape is kept stationary as we want to compare the second tape backwardly.
  • q2q2q_2\to q_2: The pointer keeps on skipping elements and moves to the leftmost element.
  • q2q3q_2\to q_3: As both the pointers are at the opposite sides, they are moved towards right and left, respectively.
  • q3q3q_3\to q_3: Here, both the tapes are compared.
  • q3Haq_3 \to H_a: The Turing machine reaches the final state if the string is a palindrome.

Multi-tape Turing machines are beneficial in solving complex problems and limit the amount of work, unlike a simple Turing machine.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved