Turing Machines are the next step in the evolution of automata. They are a theoretical model of computation that can simulate any algorithm.


Definitions

Before we get into the mathematical definition, let’s explore what a Turing Machine would look like in the physical world.

The simple idea of a turing machine is just a tape with a read/write head. The tape is infinite in both directions, and the read/write head can move left or right. The tape is divided into cells, each of which can hold a symbol from a finite set of symbols.

We can define a Turing Machine as a 7-tuple:

Where:

  • Q is a finite set of states
  • is a finite set of input symbols (input alphabet)
  • is a finite set of tape symbols (tape alphabet)
  • is the transition function
  • is the initial state
  • is the accept state
  • q_{reject} is the reject state

But we already know most of this from previous automata. The new part is the transition function, which is defined as:

There are also multiple Turing Machine Variants, but that is for another time.


Transition Function in Depth

The transition function takes the current state and the symbol under the read/write head as input, and produces a new state, a symbol to write on the tape, and a direction to move the read/write head (left or right).

We can represent the transition function as a table:

This table tells us that if the machine is in state and reads a 0, it will transition to state , write a 1 on the tape, and move the read/write head to the right.