218 Lecture 32
chosen for deletion, then some higher priority machine on the active list
must have been chosen; but this can happen only finitely many times. So
if M
i
halts within time f
n−i
(2) on 0
n
i.o., then eventually M
i
will be the
highest priority machine on the list and will be chosen for deletion, say
at stage n.Atthatpoint,0
n
will be put into A iff 0
n
∈ L(M
i
), ensuring
L(M
i
) = A. This establishes condition (i) above.
For condition (ii), we need to show that for all k, A is accepted by a
one-tape TM N
k
running in time f
n−k
(2) a.e. The key idea is to hard-code
the first m stages of the computation of N in the finite control of N
k
for
some sufficiently large m. Note that for each M
i
, either
(A) T
i
(0
n
) ≤ f
n−i
(2) i.o., in which case there is a stage m(i)atwhichN
deletes M
i
from the active list; or
(B) T
i
(0
n
) >f
n−i
(2) a.e., in which case there is a stage m(i)afterwhich
M
i
always exceeds its allotted time.
Let m =max
i≤k
m(i). We cannot determine the m(i)orm effectively
(Miscellaneous Exercise 105), but we do know that they exist. The machine
N
k
has a list of elements 0
n
∈ A for n ≤ m hard-coded in its finite control.
On such inputs, it simply does a table lookup to determine whether 0
n
∈ A
and accepts or rejects accordingly. On inputs 0
n
for n>m,itsimulatesthe
action of N on stages m +1,m+2,... ,nstarting with a certain active list,
which it also has hard-coded in its finite control. The active list it starts
with is N’s active list at stage m with all machines M
i
for i ≤ k deleted.
This does not change the status of 0
n
∈ A:foreachM
i
with i ≤ k,in
case A it has already been deleted from the active list by stage m,andin
case B it will always exceed its allotted time after stage m, so it will never
be a candidate for deletion. The simulation will therefore behave exactly
as N would at stage m and beyond. The machine N
k
can thus determine
whether 0
n
∈ A and accept or reject accordingly.
It remains to estimate the running time of N
k
on input 0
n
.Ifn ≤ m, N
k
takes linear time, enough time to read the input and do the table lookup. If
n>m, N
k
must simulate at most n−k machines on the active list on n−m
inputs, each for at most f
n−k−1
(2) steps. Under mild assumptions on the
encoding scheme, interpreting the binary representation of the index i as a
description of M
i
, M
i
has at most log i states, at most log i tape symbols,
and at most log i transitions in its finite control, and one step of M
i
can
be simulated in roughly c(log i)
2
steps of N
k
. Thus the total time needed
for all the simulations is at most cn
2
(log n)
2
f
n−k−1
(2). But
cn
2
(log n)
2
≤ 2
2
n−k−1
a.e.
≤ f
n−k−1
(2) because f(m) ≥ m
2
,