6.1Introduction to Turing Machines
6.1.1Turing Machines, Informally¶
Recall the view of finite automata as a finite-state machine whose input is on a tape and controls a tape head (High Level Framework for Automata).

Schematic diagram of a finite automata. The finite control box represents the various states and state transitions of the finite automata.
The finite automata can:
move its tape head to the right by one cell
read the symbol under the tape head
the tape contains only its input
accepts or rejects once it has reached the end of the tape
A Turing machine (TM) on the other hand can in addition:
move the tape head to the left by one cell
write a symbol to the tape cell under the tape head (overwriting whatever is in the tape cell)
has an infinite tape (the input appears first and is followed by an infinite number of blanks, denoted by the blank symbol “˽”)
can accept or reject at any time (not only at the end of the input)
6.1.2Formal Definition¶
The transition function can also be represented using a state transition diagram as was done for finite and pushdown automata. The transition is represented by . For transitions that do not overwrite the symbol under the tape head with a different symbol, i.e. , we use .
Let be a Turing machine. Consider an input string where each is a symbol of the alphabet. The TM processes as follows:
Initially, the first tape cells of the tape contain the symbols of , with the remaining cells containing the blank symbol ˽
Start at the start state and with the tape head at the start (i.e. left end) of the tape
Repeat the following:
Let be the current state and be the symbol under the tape head
If , halts and accepts
If , halts and rejects
Else:
let
write to the cell under the tape head, move tape head in direction , and move to state
Configurations¶
We now explain in more detail exactly what a single step of computation in a Turing machine looks like.
Let and be two configurations. We say that yields iff applying to results in and write .
The initial configuration of on is : the state is the initial state, the tape contains the input and the tape head is at the start of the tape.
With these definitions, it is now clear that:
halts and accepts on input if after applying the transition function to the initial configuration a finite number of times, we obtain a configuration whose state is .
halts and rejects on input if after applying the transition function to the initial configuration a finite number of times, we obtain a configuration whose state is .
never halts if it is not possible to obtain a configuration whose state is either or after applying the transition function to the initial configuration a finite number of times.
Also called semi-decidable.