## 13.2.Turing Machine

A Turing machine is an abstract representation of a computing device. It consists of a read/write head that scans a (possibly infinite) two-dimensional tape divided into squares, each of which is inscribed with a 0 or 1. Computation begins with the machine, in a given "state", scanning a square. It erases what it finds there, prints a 0 or 1, moves to an adjacent square, and goes into a new state. This behavior is completely determined by three parameters:

```1.   the state the machine is in,
2.   the number on the square it is scanning, and
3.   a table of instructions, i.e. write a square.
```

The table of instructions specifies, for each state and binary input, what the machine should write, which direction it should move in, and which state it should go into. (E.g., "If in State 1 scanning a 0: print 1, move left, and go into State 3".) The table can list only finitely many states, each of which becomes implicitly defined by the role it plays in the table of instructions. These states are often referred to as the "functional states" of the machine.

A Turing machine, therefore, is more like a computer program (software) than a computer (hardware). Any given Turing machine can be realized or implemented on an infinite number of different physical computing devices. Computer scientists and logicians have shown that Turing machines

-- given enough time and tape -- can compute any function that any conventional digital computers can compute.

Also, a `probabilistic automaton' can be defined as a Turing machine in which the transition from input and state to output and state takes place with a certain probability (E.g. "If in State 1 scanning a 0: (a) there is a 60% probability that the machine will print 1, move left, and go into State 3, and (b) there is a 40% probability that the machine will print 0, move left, and go into State 2".)

Definition 11.1 (Turing Machines (Hopcroft and Ullman))

A Turing machine (TM) is a 7-tuple, where Q is a finite set of states, S is a finite input alphabet, G (which contains S and has B, the blank tape symbol, as an element) is a finite tape alphabet, q0 in Q is the distinguished start state and F contained in Q is the set of accepting (final) states. The transition function,

d:Q X G -> Q X G X {L,R}

takes the TM from a current (state, tape cell contents) pair to a new state, new cell contents and head move (left or right). The TM has accepts its input by making a move into a state of F, and it is assumed that there are no moves from any state of F.

As a comment, the restriction to only left and right moves is not difficult to overcome (i.e., adding the S move is easy by increasing Q), and since there should be no moves from F, it is reasonable to make F a singleton set and exclude it from consideration in the transition function. Not including the blank symbol seem mainly to be done for convenience when talking about the size of G, since the blank is always included in G.