Time complexity of multidimensional Turing machines - Laboratory of ...

3 downloads 421 Views 451KB Size Report
time for simulating ITM of higher dimension on a machine of lower dimension. .... type the ITM M 1 (or M S) by the inductive assumption spends time not greaterĀ ...
TIME

COMPLEXITY

TURING D.

OF

MULTIDIMENSIONAL

MACHINES Yu.

Grigor'ev

UDC 510.52

It i s p r o v e d t h a t the w o r k of an i n d e t e r m i n a t e m - d i m e n s i o n a l

Turing machine with time com-

p l e x i t y t c a n b e s i m u l a t e d on an i n d e t e r m i n a t e k - d i m e n s i o n a l (k -< m) T u r i n g m a c h i n e with t i m e c o m p l e x i t y t 1 - ( ~ / m ) + ( l / k ) + e ffor any e > 0).

Moreover,

the f o l l o w i n g g e n e r a l i z a t i o n to the m u l t i -

d i m e n s i o n a l c a s e of the f a m i l i a r t h e o r e m of H o p c r o f t , P a u l , a n d V a l i a n t is p r o v e d : the w o r k of an m - d i m e n s i o n a l

Turing machine with time complexity t logi/mt

it(n) -> n] can be s i m u l a t e d on

an a d d r e s s m a c h i n e w o r k i n g w i t h t i m e c o m p l e x i t y t . In the p r e s e n t p a p e r it is p r o v e d t h a t the w o r k of an i n d e t e r m i n a t e m - d i m e n s i o n a l T u r i n g m a c h i n e w i t h t i m e c o m p l e x i t y t c a n be s i m u l a t e d on an i n d e t e r m i n a t e k - d i m e n s i o n a l (k -< m) T u r i n g m a c h i n e with t i m e c o m p l e x i t y t i + ( 1 / k ) ' f i / m ) + e (for a n y e > 0). In a d d i t i o n , i t is r e m a r k e d t h a t the f a m i l i a r r e s u l t [1] on the t i m e g a i n in p a s s i n g f r o m T u r i n g m a c h i n e s t o m a c h i n e s w i t h a r b i t r a r y a c c e s s to the m e m o r y

(in o t h e r w o r d s , r a n d o m a c c e s s m a c h i n e s , R A M , cf. [2]) c a n

b e g e n e r a l i z e d to t h e m u l t i d i m e n s i o n a l c a s e , m o r e p r e c i s e l y , to s i m u l a t e an m - d i m e n s i o n a l T u r i n g m a c h i n e working with time complexity ttogl/mt

it(n) ~ n f o r any n], on a RAM w i t h t i m e c o m p l e x i t y t.

M o r e o v e r , the

l a s t s i m u l a t i o n can be e f f e c t e d on the a p p a r a t u s i n t r o d u c e d b y S l i s e n k o a n d c a l l e d in [3] an a d d r e s s m a c h i n e (AM).

It i s a s p e c i f i c a t i o n of a RAM a n d i s c h a r a c t e r i z e d b y the f a c t t h a t in the c o u r s e of the e n t i r e w o r k to

i t s c o n c l u s i o n , the l e n g t h of t h e r e g i s t e r s u s e d d o e s n o t e x c e e d l o g 2 t + c , w h e r e t i s the t i m e of w o r k (the n u m b e r c is f i x e d f o r a g i v e n A M ) . By D T M (ITM) we s h a l l d e n o t e a d e t e r m i n a t e p r e c i s e d e f i n i t i o n , cf. [4]).

( i n d e t e r m i n a t e ) m u l t i d i m e n s i o n a l T u r i n g m a c h i n e (for the

In t h e c a s e when s o m e a s s e r t i o n i s t r u e b o t h f o r D T M and f o r I T M , we u s e the

n o t a t i o n T M , a n d h e r e it is u n d e r s t o o d t h a t e i t h e r a l l a p p a r a t u s e s c o n s i d e r e d in the g i v e n a s s e r t i o n a r e d e t e r minate or they are all indeterminate. 1.

In t h e f i r s t p o i n t of T h e o r e m 1, w h i c h i s p r o v e d b e l o w , t h e r e i s g i v e n an e s t i m a t e of the a m o u n t of

t i m e f o r s i m u l a t i n g ITM of h i g h e r d i m e n s i o n on a m a c h i n e of l o w e r d i m e n s i o n .

The m e t h o d u s e d is not s i m u -

l a t i o n o n - l i n e , in c o n t r a s t w i t h the m e t h o d a p p l i e d in [5], w i t h w h i c h t h e r e w a s o b t a i n e d an e s t i m a t e of the a m o u n t of t i m e in l o w e r i n g the d i m e n s i o n on D T M .

We n o t e t h a t the e s t i m a t e o b t a i n e d in S e c . 1 f o r ITM i s

b e t t e r than the c o r r e s p o n d i n g e s t i m a t e f r o m [5] f o r D T M (which m e a n s a l s o the e s t i m a t e f o l l o w i n g f r o m [5] f o r ITM).

The u p p e r b o u n d g i v e n in S e c . 1 i s s l i g h t l y w o r s e than the l o w e r b o u n d o b t a i n e d in [4] f o r o n - l i n e s i m u -

l a t i o n of TM on T M of l o w e r d i m e n s i o n .

N a m e l y (we u s e the n o t a t i o n of [5] a n d the c o r r e c t i o n of the r e s u l t of

[4] m a d e in [5]), it f o l l o w s f r o m [4] t h a t f o r any e > 0

~__L-

Translated from Zapiski Nauehnykh Seminarov Leningradskogo Otdeleniya Matematicheskogo Instituta i m . V. A. S t e k i o v a AN SSSR, V o l . 88, pp. 4 7 - 5 5 , 1979. O r i g i n a l a r t i c l e s u b m i t t e d M a r c h 23, 1976.

2290

0090-4104/82/2004-2290507o50

9 1982 P l e n u m P u b l i s h i n g C o r p o r a t i o n

The m e t h o d u s e d b e l o w a l l o w s one to do e v e n m o r e . tion of the t r a j e c t o r i e s of the h e a d s .

In s t u d y i n g TM the q u e s t i o n a r i s e s of the c o n d e n s a -

T r a j e c t o r i e s can be " s p r e a d ~ o v e r a m u l t i d i m e n s i o n a l l a t t i c e .

~e

m e t h o d m a k e s it p o s s i b l e to s i m u l a t e the o r i g i n a l ITM in s u c h a way that the h e a d s s i m u l a t i n g ti~e ITM do not l e a v e the l i m i t s of a cube with s m a l l edge.

We note that the m e t h o d of [5] a l s o a l l o w s one to get a s i m i l a r r e -

s u l t - to s i m u l a t e the w o r k of a TM with c a p a c i t y c o m p l e x i t y L a n d t i m e c o m p l e x i t y t , by a k - d i m e n s i o n a l TM, w o r k i n g in a cube with edge L I/k-1, but the e s t i m a t e of t i m e h e r e is w o r s e t h a n - t L l / k - i

Upon s i m u l a t i n g

ITM on ITM of the s a m e d i m e n s i o n one c a n a c h i e v e c o n d e n s a t i o n c l o s e to o p t i m a l f o r p o w e r (with a r b i t r a r y e x p o n e n t l a r g e r than one) l o s s of t i m e . In p r o v i n g the s e c o n d point of T h e o r e m 1 u s i n g the s a m e m e t h o d it is shown that upon l o w e r i n g the d i m e n sion by o n e , one can get c o n d e n s a t i o n c l o s e to o p t i m a l , with a l m o s t no l o s s in t i m e . T H E O R E M 1.

L e t k -< m be n a t u r a l n u m b e r s a n d e > 0.

T h e n f o r any m - d i m e n s i o n a l ITM M, w o r k i n g

with t i m e c o m p l e x i t y t and c a p a c i t y c o m p l e x i t y L, one can c o n s t r u c t 1.

a k - d i m e n s i o n a l ITM MI, w o r k i n g with t i m e c o m p l e x i t y ~ - ~ + e

in a cube with edge ~ Ā§

2.

an (m + 1 ) - d i m e n s i o n a l ITM M2, w o r k i n g with t i m e c o m p l e x i t y ~ r ~

in a cube with e d g e ~

; +$ ,

w h e r e M 1 a n d M 2 both have the s a m e output a s M. ( F o r the e a s e k = 1, point 1 of the t h e o r e m o v e r l a p s with the b a s i c r e s u l t of [6], e x t e n d e d to ITM.) We give two a u x i l i a r y l e m m a s .

The f i r s t of t h e m is a m u l t i d i m e n s i o n a l g e n e r a l i z a t i o n of L e m m a 2 of [7]

and was u s e d in p r o v i n g a m u l t i d i m e n s i o n a l g e n e r a l i z a t i o n (whose f o r m u l a t i o n is given in [8]) of the b a s i c r e s u l t of [71. LEMMA 1.

L e t the h e a d s of the m - d i m e n s i o n a l ITM M on the p i e c e A of a zone (not n e c e s s a r i l y c o n -

n e c t e d ) , c o n t a i n i n g S > 2m + 1 c e l l s , o c c u r T t i m e s .

Then one can find a h y p e r p l a n e ~, o r t h o g o n a l to one of

the d i r e c t i o n s of the l a t t i c e , s u c h that 1) on e a c h of i t s s i d e s t h e r e a r e s i t u a t e d n o m o r e than

2(~)S

c e i l s of the p i e c e A;

2) the n u m b e r of p a s s a g e s of h e a d s of the ITM M (in h a n d l i n g the piece A) t h r o u g h (~ does not e x c e e d c l T / S i / m , w h e r e c i d e p e n d s only on m a n d the n u m b e r of h e a d s of the ITM M. Proof. o t h e r left.

F o r e a c h of the m a x e s of the l a t t i c e by c o n v e n t i o n we c a l l one d i r e c t i o n on the a x i s r i g h t , the We s i n g l e out the r i g h t (left) h y p e r p i a n e p a s s i n g t h r o u g h n o d e s of the l a t t i c e , o r t h o g o n a l to the

d i r e c t i o n c o n s i d e r e d and s u c h that on the left (right) side of it t h e r e a r e s i t u a t e d no m o r e than

~ ceils

of A. The 2m h y p e r p i a n e s s i n g l e d out as a r e s u l t (for a l l m d i r e c t i o n s ) b o u n d a p a r a l l e i e p i p e d H, in which, by v i r t u e of the choice of h y p e r p i a n e s , a r e s i t u a t e d not l e s s than ~--~-~y)~ c e i l s of A. has length not l e s s t h a n k ~ 4 - ~ j

H e n c e one of the s i d e s of I1

. C o n s e q u e n t l y , one can find a h y p e r p l a n e ~, o r t h o g o n a [ to t h i s side and

i n t e r s e c t i n g 1], t h r o u g h which h e a d s of the ITM M p a s s not m o r e than e l t / S 1/m t i m e s . LEMMA 2.

L e t P l = {1) . . . . .

a l and a 2 s u e h t h a t a j

Pi+l be o b t a i n e d f r o m Pi by r e p l a c i n g its m a x i m a l e l e m e n t a by s o m e two

>- ca (j = 1, 2, 1 / 2 >_ c > 0), w h e r e a 1 + a 2 = a .

Then any e l e m e n t of PN does not e x c e e d

1/eN. By i n d u c t i o n on N one can p r o v e that if a 1 _> . . . _> a N a r e a l l e l e m e n t s of PN, then a N ~ cal.

Hence

2291

We p r o c e e d to the proof of T h e o r e m 1 (both points will be proved in para[iel). We choose r sufficiently large~_ that one has ~ < d. = k - ~ . ( 2~m + 0 < ~-~+~r

I

< - k~ + s

in the case of point . and

< ~ in the case of point 2.

I

The simulation of the work of M wilt consist of the following,

We choose a (indeterm inate) hyperplane

with the p r o p e r t y indicated in L e m m a I, then we apply L e m m a 1 to the l a r g e r piece of the zone and thus r k t i m e s (in the case of point 2 r m+l times) we apply L e m m a 1 (in both c a s e s if there r e m a i n s a piece of the zone containing no m o r e than 2m + 1 c e i l s , then we no longer subdivide it).

Each time upon application of L e m m a 1

we subdivide indeterminately the l a r g e s t in n u m b e r of cells of the pieces of the zone.

Let us agree that the

l e t t e r c with indices will denote c o n s t a n t s , independent of t, L, s. It wiU be proved by induction that the entire zone of the ITM M can be simulated in the m e m o r y of the ITM M 1 ( o r M2), a c c o m m o d a t i n g it in a cube with side c3L (~ log~/kL (respectively, c3Lfl log~/m+lL), while to each ceil of the active zone of the ITM M c o r r e s p o n d s its image, a cell of the m e m o r y of Ml (or M2), to which t h e r e is attached a cube of side log~/kL (respectively, log~/m+lL) in which there is written the a d d r e s s of the o r i g i n a l cell of the m e m o r y of the ITM M. Let a piece of the active zone of the ITM M, consisting of s c e l l s , be divided in the way d e s c r i b e d above in N = r k (respectively, N = r m+l) p i e c e s , containing s I -~ . . . -> s N, r e s p e c t i v e l y , active ceils. L e m m a 2 to the collection of n u m b e r s ~sl/s . . . . .

We apply

SN/S) and we get that sl -< s / c N , here and later c = 1/(2m + 1).

By the inductive a s s u m p t i o n , the pieces of the zone of the ITM M, c o r r e s p o n d i n g to s i, are already packed in cubes with sides c3s ~ log~/kL (respectively, c3s ~ log~/(m+l)L), so that the time r e q u i r e d by M I (or M 2) for simulating the work of the ITM M on these pieces does not exceed c 2 t i s ~ - l / m log2 L (respectively, c2tiiog2s i 9 log 2 L); e 2 w i l l b e e h o s e n at

the end.

F o r pieces of the zone containing no more than 2m + I ceils, the inequali-

ties indicated f o r the lengths of the sides of the cubes can be satisfied at the expense of a suitable choice of c 3. Since the pieces c o r r e s p o n d i n g to s i can be disconnected, one e s t i m a t e s the sum of the t i m e s n e c e s s a r y for some head of the ITM M 1 (or M2), o v e r all intervals in which the head of the ITM M modeled by it are found in a piece of the zone c o r r e s p o n d i n g to s i.

1Vioreover, one e s t i m a t e s that at the s t a r t of each such interval the e o r -

responding head of the ITM M I (or M2) is found in the image of the ceil in which at the s t a r t of this interval the head of the ITM M modeled by it is situated. The work of the ITM M 1 (or M 2) consists of steps of two types.

F i r s t l y , there is the direct simulation of

the work of the ITM M for steps at which the heads of the ITM M do not pass through the cuts made by the h y p e r planes (steps of the f i r s t type include consideration of the contents of ceils, the e n t r y of the new content, change of state).

Secondly i s t h e s e a r c h for images of cells into which heads of the ITM M pass a f t e r intersecting cuts.

The latter will be effected indeterminately by s h o r t e s t paths, at the end of the s e a r c h it is only n e c e s s a r y to verify that the a d d r e s s of the ceil [it is e n t e r e d in a cube with side iog~/kL (respectively, log 1/(m+l) ] is r e quired. Cubes of the m e m o r y of the ITM M1 (or M 2) with sides c3s[~ log~/kL (respectively, c3s ~ log~/(m+l)L), where 1 -< i -< N, can be packed into a cube with side c3rs ~ log~/kL (respectively, c3rsr log~/(m+l)L). Lemma 2

--~/~

2292

0~0!/K.

S~

~--

ilk

Then by

and, respectively, 4

by v i r t u e of the c h o i c e of c~,/3, w h i c h p r o v e s the i n d u c t i v e s t e p on the l e n g t h of a s i d e of the cube of the m e m o r y of the ITM M 1 (or M~). It r e m a i n s to e s t i m a t e the t i m e .

In h a n d l i n g a p i e c e of the zone c o r r e s p o n d i n g to s , at a s t e p of the f i r s t

t y p e the ITM M 1 (or M S) b y the i n d u c t i v e assumption s p e n d s t i m e not g r e a t e r than

respectively,

At a step of the second

type the ITM

M s (or M S) speiids time not exceeding

respectively,

T, -- c, !

w h e r e s l , tj (1 _< j _< N) a r e the n u m b e r of c e l t s a n d the t i m e s of h a n d l i n g t h e m on the I T M M in p i e c e s of the zone w h i c h a r e c u t out by the h y p e r p l a n e s at the j - t h s t e p of the p r o c e s s d e s c r i b e d a b o v e .

The sum z~ C~IJ}/{ ~)

bounds (by Lemma 1) the number of steps in whose time cuts happen, and

e3s ~ l o g 2 L ( r e s p e c t i v e l y , e3s~ log2L) b o u n d s the n u m b e r of s t e p s of the ITlVI M~ (or M S) in the s e a r c h f o r the i m a g e of the n e c e s s a r y c e l l a f t e r p a s s i n g t h r o u g h a cut.

S i n c e s / m s 9e N, one h a s

respectively, 4

&. H e n c e f o r the ITM M s one h a s

T4+T/~C~JCS ~ov]~+r

z

({-5)

~o~,~