Turing Machine

What is a Turing machine?
TM - Formal Description
TM - Configuration
TM - Variants


What is a Turing machine?

Turing machines are basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm. They were described in 1936 by Alan Turing.

A Turing machine has a two-way infinite tape, made of cells.
In each cell, there is a symbol.
There is a finite number of symbols, denoted by 0, 1, ...
The symbol 0 is the blank symbol.
Initially, the Turing machine holds a finite input.
This input is a string of symbols, for example: 101001.
The other cells of the tape hold blank symbols.
In the kind of machine we consider, the input can contain the blank symbol 0.

 . . .    0     0     1     0     1     0     0     1     0     0    . . . 

A Turing machine has a tape head.
With this tape head, the machine can read and write on the tape.
The tape head moves one cell left or right at each step.
These directions are denoted by L and R.
In the kind of machine we consider, the tape head cannot keep still.
Initially, the tape head scans the leftmost symbol of the input.


A Turing machine has a finite number of states.
The states are denoted by A, B, C, ...
In addition to these states, there is a special state, the halting state, denoted by H.
Initially, the state is A, so A is called the initial state.
Below, you can see the initial configuration of a Turing machineon the input 101001:
The position of the tape head is indicated by writing the current state on the scanned cell.

 . . .    0     0   A 1   0     1     0     0     1     0     0    . . . 

A Turing machine has a next move function.
The next move function says that, when the machine is in state q and scans symbol a on a cell, then the machine writes a symbol b instead of a, moves one cell in the direction left or right, and enters state p.
We suppose that, when the machine stops, it writes a 1, moves right, and enters state H.




Turing Machine -- Formal Description


Turing machine is defined as a 7-tuple,

M = (Q, Γ , b, Σ, δ, q0, F) where,

Q is a finite set of states

Γ is a finite set of the tape alphabet/symbols

b is the blank symbol

Σ is the set of input symbols

δ : Q * Γ --> Q * Γ * {L,R} is the transition function where L is left shift, R is right shift.

q0 is the initial state

F is the set of final or accepting states.


A configuration of TM is given by :


Current state

Symbols on tape

Location of Head


TM Variants


Multitape TM

Nondeterministic TM

Enumerators