Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

2014

2013
FOUNDATIONS OF COMPUTATION 2009
2013
LECTURE NOTES 12
ISSUED 28
23 NOVEMBER
NOVEMBER2014
2009

1.

Turing machines

A Turing machine consists of a control module, a tape infinite in one direction


and a working head. The tape is divided into cells in each of which a letter can be
written. The working head at each moment of time observes one cell on the tape.

control

Figure 1. A scheme of a Turing machine


Definition. Turing machine (TM) is a system (Q, , s, , H) where
Q is set of states;
is an alphabet containing t (blank), . (left end symbol), and not containing and ;
s is the initial state;
H is the set of halting states;
is the transition function,
: (Q \ H) Q ( {, })
such that
(a) for all q Q \ H if (q, .) = (p, b) then b =;
(b) for all q Q \ H and a if (q, a) = (p, b) then b 6= ..
How it works:
1

ISSUED 23
2009
20 NOVEMBER
NOVEMBER 2013

Let (q, a) = (p, b). Then TM, when in the state q and reading the letter a, will
adopt the state p and
if b then will replace a by b;
if b {, } then will move the head in the direction b.
TM will stop only when it adopts a halting state. If TM observes ., it must
move to the right (by (a)). In this way . is never erased, and TM never falls off its
left end.
By (b) TM never writes . so this symbol is unique on the tape.
2.

Examples
The following machine erases any input and then halts:
({s, q, h}, {a, t, .}, , s, {h}),

where is defined by the following table.


state
s
s
s
q
q
q

letter
a
t
.
a
t
.

(state, letter)
(q, t)
(h, t)
(s, )
(s, a)
(s, )
(q, )

Note that some of the transitions in the table, e.g., the fourth, are not used in any
computation, but the function is defined at every element of the set (Q \ H) .

Another example, a Turing machine that does not halt on any input, but runs
from its beginning to its end, then back to the beginning and so forth.:
state
s
s
s
q
q
q
3.

letter
a
t
.
a
.
t

(state, letter)
(s, )
(q, )
(s, .)
(q, )
(s, )
(h, t)

Computations

Definition. A configuration of TM is an object of the kind (q, .w, a, v), where


q Q,
.w is a word starting with . and w ,
a ,
v .
The configuration is a snapshot of TM at a given moment of its work, indicating
(1) the state,
(2) what is on the tape,

LECTURE NOTES 12

(3) position of the head (the head it is observing the letter a between .w and
v).
We will abbreviate the notation (q, .w, a, v) to just a pair (q, .wav).
Definition.
A configuration (q, .wav) is called halting if q H.
A configuration (q1 , w1 a1 v1 ) yields a configuration q2 , w2 a2 v2 ) in one step
if the second is obtained from the thirst by one application of the transition
function.
A configuration C1 yields a configuration Cn if there is a sequence of configurations C2 , . . . , Cn1 such that Ci yields Ci+1 for all i = 1, . . . , n 1.
In what follows we assume that inputs of TM are words over an alphabet 0
\ {t, .}. The initial configuration is (s, .tw) where w 0 is an input word.
TM halts on w 0 if the initial configuration yields a halting configuration.
4.

Semidecidable and decidable sets

Definition. Let L 0 . L is called semidecidable (or recursively enumerable) if


there is TM such that for every w 0 the following is true: w L if and only
if TM halts on w. L is called decidable (or recursive) if both L and 0 \ L are
semidecidable.
Here is another characterization of decidable sets.
Theorem. A language L is decidable if and only if there is a TM M with H =
{y, n} such that w L is equivalent to the initial configuration yielding a halting
configuration with y, and w 0 \L is equivalent to the initial configuration yielding
a halting configuration with n.
A proof in one direction is simple: given M we obtain TM halting exactly on L
by making in M the state n non-halting, and extending the transition function by
defining (n, a) = (n, a) for every a . In a similar way the machine halting on
0 \ L is defined. The proof of the existence of M if L is decidable is slightly more
complex and is not considered in detail in this course.

You might also like