Turing Machines

the transition function

/ delta: DEL-tah /

The transition function is the machine's complete rulebook: a lookup table that, given the situation the machine is in, tells it exactly what to do next. The situation is just two things: which state the finite control is in, and which symbol the head is reading. The instruction it returns is three things bundled together: a new state to switch to, a symbol to write into the current cell, and a direction (left or right) to move the head. There is no creativity here; for each possible situation the answer is fixed in advance.

Formally the transition function is written δ (delta), and it maps a (state, scanned symbol) pair to a (next state, symbol-to-write, move) triple: δ(q, a) = (p, b, R) reads as 'when in state q reading an a, switch to state p, write b over the a, and move the head right'. The move is L for left or R for right. Because both inputs and all three outputs are finite in number, δ is just a finite table you could print out. Running the machine means: read state and symbol, look up δ, perform the write-move-and-switch, repeat. This is deterministic: one situation, one instruction.

δ is where all the cleverness of a Turing machine lives; designing a machine IS designing its δ. A subtle point is that δ can be a partial function: for some (state, symbol) pairs there may be no instruction at all, and reaching such a pair is exactly how the machine halts (it has nothing more to do). Combined with designated accept and reject states, this is how the three outcomes arise: halt-and-accept, halt-and-reject, or, if δ keeps sending the machine onward forever, loop forever. The nondeterministic variant lets δ offer several instructions for one situation, but the basic model offers at most one.

A rule δ(q1, 0) = (q2, X, R) means: in state q1 reading 0, write X over it, move right, and enter q2. Compare a DFA's transition, which only picks a next state; the Turing rule also writes and chooses a direction, giving it far more to work with.

One Turing transition does three things at once: write, move, change state.

Unlike a total DFA transition, a Turing machine's δ may be undefined for some pairs; hitting an undefined case is one way the machine halts. The basic model is deterministic, so δ returns at most one instruction.

Also called
deltaδtransition rules轉移函數轉換函數