3.1.3: Turing Machines
The formal definition of what constitutes a Turing machine looks abstract, but is actually simple: it merely packs into one mathematical structure all the information needed to specify the workings of a Turing machine. This includes (1) which states the machine can be in, (2) which symbols are allowed to be on the tape, (3) which state the machine should start in, and (4) what the instruction set of the machine is.
A Turing machine \(M\) is a tuple \(\langle Q, \Sigma, q_0, \delta\rangle\) consisting of
- a finite set of states \(Q\) ,
- a finite alphabet \(\Sigma\) which includes \(\TMendtape\) and \(\TMblank\) ,
- an initial state \(q_0 \in Q\) ,
- a finite instruction set \(\delta\colon Q \times \Sigma \pto Q \times \Sigma \times \{\TMleft, \TMright, \TMstay\}\) .
The partial function \(\delta\) is also called the transition function of \(M\) .
We assume that the tape is infinite in one direction only. For this reason it is useful to designate a special symbol \(\TMendtape\) as a marker for the left end of the tape. This makes it easier for Turing machine programs to tell when they’re “in danger” of running off the tape. We could assume that this symbol is never overwritten, i.e., that \(\delta(q,\TMendtape) = \tuple{q', \TMendtape, x}\) if \(\delta(q,\TMendtape)\) is defined. Some textbooks do this, we do not. You can simply be careful when constructing your Turing machine that it never overwrites \(\TMendtape\) . Moreover, there are cases where allowing such overwriting provides some convenient flexibility.
Even Machine: The even machine is formally the quadruple \(\tuple{Q, \Sigma, q_0, \delta}\) where \[\begin{aligned} Q & = \{ q_0, q_1 \} \\ \Sigma & = \{ \TMendtape, \TMblank, \TMstroke \}, \\ \delta(q_0, \TMstroke) & = \tuple{q_1, \TMstroke, \TMright},\\ \delta(q_1, \TMstroke) & = \tuple{q_0, \TMstroke, \TMright},\\ \delta(q_1, \TMblank) & = \tuple{q_1, \TMblank, \TMright}.\end{aligned}\]