text
stringlengths
0
8.13M
paper [17]. In fact, most modern informal descriptions are just rephrasings of
Turing’s own words. This is true also for what follows here.
The machine consists of a memory, a read-and-write head and a processing
unit.
Thememoryisatapewhichisdividedintodistinctsquares,alsocalledcells.
It is infinite to the left and to the right6. The memory tape is used for giving
inputtothe machine,forstoringintermediatedataduringcomputationandfor
writing output.
The read-and-write head can move along the tape. It can read symbols
written on the tape (this is called scanning) and it can write symbols on the
tape.
Thesymbolscanbeanysymbols,buttheymustcomefromafinitealphabet
Γ= S ,S ,...,S .
0 1 n
{ }
The machinehasafinite setofelementaryoperationsthatitcanperformat
each step in the computation. These are
move one step to the right
move one step to the left
write a symbol
erase a symbol
halt
This can symbolically be written as a set of operations
O= moveright,moveleft,write(S ),erase,halt
i
{ }
Note that reading a symbol need not be considered to be an operation. In
fact, the machine always reads the symbol written on the scanned square. In
some formulations, the operation erase is replaced by writing a special symbol
called a blank, i.e. by the operation write(blank).
The halt operation can be implemented in different ways.
The machine is controlled by a set of instructions. This is the program.
In order to distinguish the instructions, the machine is considered to be in a
set of different machine states. The states are numbered or given symbolic
names from a set Q= q ,q ,...,q . Each instruction consists of four symbols
0 1 n
{ }
(present state, scanned symbol on tape, operation, new state) or (q ,S,op,q )
i j
where q Q,S Σ,op O,q Q.
i j
∈ ∈ ∈ ∈
The program is executed by a control unit. Execution starts in a special
initial machine state q scanning the leftmost symbol on the tape. At the
0
6Forpracticalpurposes,ifonewouldliketowriteacomputerprogramemulatingaTuring
machine,itmightbeeasiertoconsideraone-waytapewithastartsquaretoleftandinfinite
totheright.
21
beginningofthecomputation,allbutafinite numberoftapesquaresareblank.
This is true throughout the computation. At each step of the execution, the
control unit checks through the list of instructions to find an instruction that
matches the present state of the machine and the scanned symbol. Each cycle
of the execution therefore consists of the following actions:
get present state q
present
get scanned symbol α
scanned
find matching instruction (q ,α ,op,q )
present scanned new
execute the instruction op
change to the new state q as given in the matching instruction
new
Some comments
Infinite memoryinthe formofaninfinite tape is ofcourseimpossible inreality.
But this is not a problem. At any stage of the computation, only a finite set of
squares is needed. Should the machine ever run out of tape, a finite amount of
newtapecanalwaysbeaddedtotherightortotheleft. Thenumberofsquares
on the tape thus need not be actually infinite, only potentially infinite.
As regards the symbols, the simplest choice is 0,1 where ’0’ serves the
{ }
purpose of a blank. Numbers are coded as strings of ’1’ separated by ’0’. The
number 0 itself must be coded as ’1’ in order to distinguish it from a blank,
and consequently 1 is coded as ”11” and so on. If one wants to use a more
efficientbinarycoding,onecanuseanalphabetconsistingof’0’,’1’andablank
separator ’#’.
In some formulations of Turing machines, the operations of writing and
movingarecombinedintoasingleoperation. Inthatcaseaninstructionconsists
of five symbols q S S q M, where M denotes a move.
i k l j
Furthermore,a specialhalt instruction is not needed. The machine stops or
halts when the control unit cannot find any matching instruction. In practice,
though, it is convenient to include an explicit halt instruction. In fact, when
discussing decision problems in terms of Turing machines, it is natural to have
two halting states, for example named by yes and no.
The names of the states are arbitrary, they can be named in any way that
serves the purpose of clarity.
In the next section, a formal definition of a Turing machine is given. It
does not entirely conform to the informal description given above. The reader
unfamiliar with Turing machines might benefit from comparing the details.