1. Gyanastra
  2. Theory of Computation
  3. Turing Machines
  4. Introduction to Turing Machines and Tape with Read/Write Head
Free lesson, no account needed 5 min read 11 practice questions after it
Asked in past papers5 times
  • GATE CSE20082003
  • ISRO2016
  • UGC NET20182016

Theory of Computation · Turing Machines

Introduction to Turing Machines and Tape with Read/Write Head

Overview

A Turing machine is a model of computation built from a tape holding the input, a read/write head, and a finite control that directs the head.
It matters because it differs from finite automata and pushdown automata in two decisive ways: the head moves in both directions, and it can write on the tape as well as read from it.

Key concepts

  • Turing machine: a model of computation whose behaviour is best understood through examples before the formal theory.
  • Two-way movement: finite automata and pushdown automata move only in one direction, left to right; a Turing machine can move in both directions (left and right).
  • Read and write: a Turing machine can both read a symbol from the tape and write a symbol onto it.
  • Tape: holds the input on which the machine operates.
  • Read/write head: reads the symbol under it and can also write on the tape.
  • Finite control: directs the head.
  • Language of the example: L={anbn∣n≥1}L = \{ a^n b^n \mid n \ge 1 \}. It is not regular but is context-free; a context-free grammar and a pushdown automaton for it have already been seen.
    The restriction n≥1n \ge 1 is just the usual form of the example language; a Turing machine can accept epsilon (for example, if the start state is a final state).

How it works

  1. The input string is written on the tape.
  2. The finite control positions the read/write head over a tape cell.
  3. The head reads the symbol in that cell.
  4. Based on the finite control's state and the symbol read, the machine may write a symbol into that cell.
  5. The head then moves left or right (unlike FA/PDA, which only move left to right).
  6. The read–write–move cycle repeats; acceptance or rejection is decided by the finite control.

Formulas

  • L={anbn∣n≥1}L = \{ a^n b^n \mid n \ge 1 \} — the language to be accepted by the Turing machine; nn is the number of aa's, equal to the number of bb's (the restriction n≥1n \ge 1 is just the standard form of the example; a TM can accept epsilon).

Worked examples

Design a Turing machine that accepts anbna^n b^n

  • Goal: design a Turing machine that accepts anbna^n b^n with n≥1n \ge 1.
  • Given language: L={anbn∣n≥1}L = \{ a^n b^n \mid n \ge 1 \}.
  • Is LL regular? No, it is not regular.
  • Is LL context-free? Yes, it is context-free — a context-free grammar for it has already been seen, and a pushdown automaton for it has already been designed.
  • Next step: see how a Turing machine works on this language (the construction follows).

Comparison

FeatureFinite Automata / Pushdown AutomataTuring Machine
Head movementOne direction only (left to right)Both directions (left and right)
Tape accessRead onlyRead and write
Storage structureFinite states / stackTape with read/write head

Revision summary

  • A Turing machine moves its head in both directions; FA and PDA move only left to right.
  • A Turing machine can read from and write on the tape.
  • Components: tape (holds the input), read/write head, finite control.
  • L={anbn∣n≥1}L = \{ a^n b^n \mid n \ge 1 \} is not regular but is context-free.
  • The example language uses n≥1n \ge 1 by convention; a Turing machine can accept epsilon if its start state is a final state.

Previous-year exam insights

  • A non-deterministic Turing machine can always be converted to an equivalent deterministic Turing machine (both accept exactly the recursively enumerable languages); non-determinism adds no power to a TM.
    Asked inGATE 2008
  • The Chomsky hierarchy of recognisers: regular languages — finite automata; context-free languages — pushdown automata; context-sensitive languages — linear bounded automata (LBA); recursively enumerable languages — Turing machines.
    Asked inUGC NET 2018
  • A PDA behaves like a Turing machine only when it has two or more stacks (auxiliary memory); with one stack it recognises exactly the context-free languages, and with zero stacks only regular languages.
    Asked inUGC NET 2018
  • A finite state machine is a Turing machine with a finite (read-only) tape, without rewinding capability and with unidirectional tape movement.
    Asked inISRO 2016
  • To find the language accepted by a given TM: start at the start state on the leftmost input symbol, follow the transition table (state, symbol) → (new state, written symbol, L/R), and collect exactly the strings that reach a final state; a string is rejected if the machine halts in a non-final state or the transition is undefined.
    Asked inUGC NET 2016GATE 2003
  • A TM configuration is written as u q v (tape contents with the head on the first symbol of v and current state q); the initial configuration is q0 w and acceptance means reaching a final state, so halting in a non-final state or looping means rejection.
    Asked inGATE 2003UGC NET 2016
Pages 1–2 of 2