computational complexity of recursive sequences*res/complexity_recursive_seq_1964.pdf ·...

9
COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns General Electric Research Laboratory Schenectady, N.Y. ABSTRACT In this paper we investigate how numbers, functions, and sequences can be classified according to their computational complexity. The computational complexity is measured by how fast the number or function can be computed by a multitape computer (Turing machine). It is shown that by means of this measure the computational complexity of numbers and functions can be submitted to rigorous mathematical study and a number of results are obtained. J T(n)·log T(n) = 0 U(n) lim CD then ST 7 SUo Thus for every time func tion T and E)' 0, there exists a sequence a which can be computed in [T(n)]l+e operations but cannot be computed in T(n) operations. The intersection of two classes is again a class. The general containment problem, however, is recursively One section is devoted to an investi- gation as to how a change in the abstract machine model might affect the complexity. classes. Some of these are related by a' "square law," including the one-tape- multitape relationship: that is if a is T-computable by a multitape Turing *This paper is an updated summary of Ref. 10. enumerable and so no class ST contains all computable sequences.. On the other hand, every computable a is contained in some complexity class ST. Thus a hierarchy of complexity classes is Furthermore, the classes are of time scale or of the speed of the components from which the machines could be built, as there is a "speed-up" theorem which says that ST SkT for positive numbers k. As corollaries to the speed-up theorem, there are several limit condi- tions which establish containment be-. tween two complexity classes. This is contrasted later with a theorem which gives a limit condition for non-contain- ment. One form of this result states . that if (with minor restrictions) I. INTRODUCTION In his celebrated paper,l A.M. Turing investigated the computability of sequences (functions) by mechanical pro- cedures and showed that the set of sequences can be partitioned into com- putable and noncomputable sequences. One finds, however, that some computable sequences are very easy to as other computable sequences seem to have an inherent complexity that makes them difficult to compute. In this paper, we investigate a scheme of classi- fying sequences according to how hard they are to compute. This scheme puts a rich structure on the computable sequences and a variety of theorems are established. Furthermore, this scheme can be generalized to classify numbers, functions, or recognition problems ac- cording to their computational The computational complexity of a sequence is to be measured by how fast a multi tape Turing machine can print out the terms of the sequence. This particu- lar abstract model of a computing device is chosen because much of the work in this area is stimulated by the rapidly growing importance of computation through the use of digital computers, and all digital computers in a slightly idealized form belong to the class of multitape Turing machines. More specifically, if T(n) is a computable, monotone increasing function of positive integers into posi- tive integers and if U is a (binary) sequence, then we say that u is in com- plexity class ST or that a is T-com- putable if and only if there is a multi- tape Turing machine:f such that 5 com- putes the n th term of a within T(n) operations. Each set ST is recursively 82

Upload: others

Post on 25-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*J. Hartmanis and R.E. Stearns

General Electric Research LaboratorySchenectady, N.Y.

ABSTRACT

In this paper we investigate how numbers, functions, and sequences can beclassified according to their computational complexity. The computationalcomplexity is measured by how fast the number or function can be computed by amultitape computer (Turing machine). It is shown that by means of this measurethe computational complexity of numbers and functions can be submitted to rigorousmathematical study and a number of results are obtained. J

T(n)·log T(n) = 0U(n)

limCD

thenST 7 SUo

Thus for every time func tion T and E)' 0,there exists a sequence a which can becomputed in [T(n)]l+e operations butcannot be computed in T(n) operations.The intersection of two classes is againa class. The general containment problem,however, is recursively

One section is devoted to an investi-gation as to how a change in the abstractmachine model might affect the complexity.classes. Some of these are related by a'"square law," including the one-tape-multitape relationship: that is if a isT-computable by a multitape Turing

*This paper is an updated summary ofRef. 10.

enumerable and so no class ST containsall computable sequences.. On the otherhand, every computable a is contained insome complexity class ST. Thus ahierarchy of complexity classes is

Furthermore, the classes areof time scale or of the

speed of the components from which themachines could be built, as there is a"speed-up" theorem which says that STSkT for positive numbers k.

As corollaries to the speed-uptheorem, there are several limit condi-tions which establish containment be-.tween two complexity classes. This iscontrasted later with a theorem whichgives a limit condition for non-contain-ment. One form of this result states .that if (with minor restrictions)

I. INTRODUCTION

In his celebrated paper,l A.M. Turinginvestigated the computability ofsequences (functions) by mechanical pro-cedures and showed that the set ofsequences can be partitioned into com-putable and noncomputable sequences. Onefinds, however, that some computablesequences are very easy toas other computable sequences seem tohave an inherent complexity that makesthem difficult to compute. In thispaper, we investigate a scheme of classi-fying sequences according to how hardthey are to compute. This scheme puts arich structure on the computablesequences and a variety of theorems areestablished. Furthermore, this schemecan be generalized to classify numbers,functions, or recognition problems ac-cording to their computational

The computational complexity of asequence is to be measured by how fasta multi tape Turing machine can print outthe terms of the sequence. This particu-lar abstract model of a computing deviceis chosen because much of the work inthis area is stimulated by the rapidlygrowing importance of computation throughthe use of digital computers, and alldigital computers in a slightly idealizedform belong to the class of multitapeTuring machines. More specifically, ifT(n) is a computable, monotone increasingfunction of positive integers into posi-tive integers and if U is a (binary)sequence, then we say that u is in com-plexity class ST or that a is T-com-putable if and only if there is a multi-tape Turing machine:f such that 5 com-putes the n th term of a within T(n)operations. Each set ST is recursively

82

Page 2: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

then it is T2_ computable by amingle tape Turing machine. On the other:and, (it has been shown recently byF.C. Hennie and R.E. Stearns that) if ais T-computable by a multi tape Turingmachine then it is T. log T-computableby a two-tape machine. Thus there is aconsiderable difference in the reductionfrom many-to-one-tape and many-to-two-tapes. It is gratifying, however, thatsome of-the more obvious variations donot change the classes.

The complexity of rational, alge-braic, and transcendental numbers is'studied in another section. There is agood agreement with our intuitive notions,but there are several questions stillto be settled.

There is a section in which general-izations to recognition problems andfunctions are discussed. This sectionalso provides the first explicit"impossibility" proof, by describing acontext free language whose "words" can-not be recognized in real-time l T(n) = nJ.

The final section is devoted toopen questions and problem areas. It isour conviction that numbers and functionshave an intrinsic computational natureaccording to which they can beas shown in this paper, and thatis a good opportunity here for furtherresearch.

For background information aboutfuring machines, computability and re-lated the reader should consultDavis. "Real-time" computations (i.e.,T(n) = n) were first defined and studiedby .3 More recently Rabin4 hasexplicitly exhibited a set of ·sequenceswhich can be recognized in real-time bya two tape machine but cannot be recog-nized in real-time by anyone tape 5machine. In his thesis at M.I.T. Blumbas defined· a machine independent theoryof the complexity of recursive functions,Which shows, among other things, thatmany of the results of this paper haveanalogues in any "reasonable" complexitymeasure on recursive functions. Finally,

Hennie6 has shown that there exist"off-line" recognition problems which canbe done in real-time on a two tapemachine but require T(n) n2 operationson a one tape machine. Other ways ofclassifying the complexity of a.computa-tion haye been studied by Myhil17 and

Ritchie8 where the complexity is definedin terms of the amount of tape used.

II. TIME LIMITED COMPUTATIONSIn this section, we define our

version o'f a multitape Turing machine,define our complexity classes with re-spect to this type of machine, and thenwork out some fundamental properties ofthese classes.

First, we give an English descrip-tion of our machine (Fig. 1) since onemust have a firm picture of the devicein order to follow our paper. We imaginea computing device that has a finiteautomaton as a control unit. Attached tothis control unit is a fixed number oftapes which are linear, unbounded at bothends, and ruled into an infinite sequenceof squares. The control unit has onereading head assigned to each tape, andeach head rests on a single square ofthe assigned tape. There area finitenumber of distinct symbols which canappear on the tape squares. Each com-bination of symbols under the readingheads together with the state of thecontrol unit determines a unique machineoperation. A machine operation consistsof overprinting a symbol on each tapesquare under the heads, shifting thetapes independently either one squareleft, one square right, or no squares,and then changing the state of the con-trol unit. The machine is then ready toperform its next operation as determinedby the tapes and control state. Themachine operation is our basic unit oftime. One tape is signaled out andcalled the output tape. The motion ofthis tape is restricted to one waymovement, it moves either one or nosquares right. What is printed on theoutput tape and moved from under the headis therefore irrevokable, and is di-vorced from further calculations.

To clear up any misconceptionsabout our model, we now give a formaldefinition.Definition 1.

An n-tape Turing , is aset of (3 n + 4)-tuples,l (qi; Sii' Si 2 , , • · , Sin;Sj 0 ' Sj 1." , , , Sj n ;mO,ml,···,rnn;qj)} ,

where each component can take on afinite set of values, and such that

83 -

Page 3: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

every possible combination of the first(n+l) entries, there exists a unique(3 n + 4)-tuple in this set. The firstentry, qt, designates the present state;the next n-entries, Si!, ••• ,Si n, desig-nate the present symbo s scanned on tapesTl ... , Tn' respectively; the next n + 1symbols Sjo, ••• ,Sj , designate the new .symbols to be on tapes TO, •.• ,Tn ,respectively; the next n entries describethe tape motions (left, right, no move)of the n + 1 tapes with the restrictionrnO left; and the last entry gives thenew internal state. Tape TO is calledthe output tape. One tuple with Si. =blank symbol for 1 j n is desigJatedas starting symbol.

Note that we are not counting theoutput tape when we figure n. Thus azero-tape machine is a finite automatonwhose outputs are written on a tape. Weassume without loss of generality thatour machine starts with blank tapes.

For brevity and clarity, many proofsare omitted and other proofs will appealto the English description and willtechnically be only sketches of proofs.Indeed, we will not even give a formaldefinition of a machine operation. Aformal definition of this concept can befound in Davis. 2

For the sake of simplicity, we shalltalk about binary sequences, the general-ization being obvious. We use the nota-tion Q = alaZ ••..Definition 2.

Let T(n) be a computable functionfrom integers into integers such thatT(n) T(n + 1) and, for some integer k,T(n) for all n. Then we shall saythat sequence a: is T-computable ifand only if there exists a mu1titapeTuring machine,:J , which prints thefirst n digits of the sequence u on itsoutput tape in no more than T(n) opera-tions, n = 1,2, •.• , allowing for thepossibility of printing a bounded numberof digits on one square. The class ofall T-computable binary sequences shallbe denoted by ST' and we shall refer toT(n) as a time-function. ST will becalled a complexity class.

When several symbols are printed onone square, we regard them as componentsof a single symbol. Since these arebounded, we are dealing with a finite setof output symbols. As long as the output

84

comes pouring ou t of the mach ine in areadily understood form, we do not regardit as unnatural that the output must bestrictly binary. Furthermore, we shallsee in Corollaries 2.5 and 2.6 that ifwe insist that T(n) n and that only

binary outputs be used, then thecomplexity classes would be identicalto the classes in the theory we areadopting. We prefer the approach herebecause many of the results have asimpler formulation.

The reason for the condition T(n) 2is that we do not wish to regard the

empty set as a complexity class. For ifa is in ST and is the machine whichprints it, there is a bound k on thenumber of digits per square of outputtape and can print at most knO digitsin nO operations. By assumption, T(kna>nO or (substituting nO = T(n) .On the other hand, T(n) it impliesthat the sequence of all zeros is in Srbecause we can print k zeros in eachoperation and thus ST is not void.

Next we shall discuss some funda-mental properties of our classes.Theorem 1.

The set of all T-computable binarysequences, ST' is recursively enumerable.Corollary 1.1.

There does not exist a time-functionT such that ST is the set of all computa-ble binary sequences.

Proof: By the diagonal process.Corollary 1.2.

For any time func t ion T, there exis tsa time function U such that ST iscontained in SUe Therefore, there areinfinitely long chains

STl

C STZc:

of distinct complexity classes.Corollary 1.3.

The set of all complexity classes iscountable.

Our next theorem asserts that linearchan6es in a time-function do not changethe complexity class. If r is a realnumber, we write [r] to-represent thesmallest integer m such that m r.Theorem 2.

If the sequence a is T-computable

Page 4: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

If U and T are time-functions such

The purpose of this section is tocompare the speed of our multi tapeTuring machine with the speed of othervariants of a Turing machine. Most im-portant is the second result because ithas an applicationn a later section.Theorem 6A.

If the sequence a is T-computable bymultitape Turing machine, :J , then a isT2-computable by a one-tape Turingmachine :J 1-'

function and STln ST

2= ST·

Proof: T is obviously a time-function. If J 1 is a machine thatcomputes u in time T1 and 2 computes Qin time T2 , then it 1S an easy matter toconstruct a third incorporatingboth ::J 1 and 2' which computes 0: bothways simultaneously and prints the n thdigit of a as soon as it is computed by. either .J or :J 2. Clearly this machineoperates

T(n) = min [Tl(n), T2 (n)]-Theorem 4.

If sequences a and p differ in atmost a finite number of places, then forany time-function T, a£ST if and only ifI3£ST·Theorem 5.

Given a time-function T, there is nodecision procedure to decide whether asequence u is in ST-

Proof: Let.1 be any Turing machinein the classical sense and let 2 be amultitape Turing machine which pr1nts asequence p not in ST- Such a existsby Theorem 1. Let!J 2 be a mult1tapeTuring machine which prints a zero foreach operation before stopping_If should stop after k operations, then

2 prints the k th and all subsequentoutput digits of -1 1 - Let a be thesequence printed by :J 2. Because ofTheorem 4, U(ST if and only if stops.Therefore, a decision procedure fora£Sr would solve the stoppingwhich is known to be unsolvable.Corollary 5.1.

There is no decision procedure todetermine if Su = ST or SH C ST forarbitrary and T.

III. OTHER DEVICES

< 00 ,

< 00,

T(n)D(n)

that sup T(n)

then Su ST •Corollary 2.3.

that

Corollary 2.1.If U anG. T are time-functions such

that T(n)inf > 0n -. 00 D(n)

then Su ::. STcorollary 2.2.

If U and T are time-functions such

ST = S[kT] ·Proof: If a is computed in time T

by ma'ChItle , one can design a .:J I whichin effect performs two operations of ina single operation. Thus I operates intime 1/2.T and the theorem follows byinduction.

and k is a computable, positive realthen a is [kT] computable; that

is

o < lim00

then Su = ST.Corollary 2.4.

If T(n) is a time-function, thenSn =ST. Therefore, T(n) = n is the mostsevere time restriction.Corollary 2.5.

For any time function T(n),

ST = Smax(n, T)-Thus, the restriction T(n) n can beadded to Definition 2 without eliminatingany complexity classes.Corollary 2.6.

If the restriction T(n) n is addedto Definition 2, then the same complexityclasses are obtained by considering bina-ry output machines only. -

Proof: If a can be done in timeT(n) by a multi-output machine 1 , abinary output machine :J I can be con-structed to produce a in time max (n,T(n».Theorem 3.

If Tl and TZ are time-functions,then T(n) = min LTl(n), TZ(n)] is a time-

85

Page 5: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

Theorem 6B.(Hennie and If the

sequence U is T-computable by a multi tapeTuring machine, , then Q is T.log T-computable by a two-tape Turing machine :11•

Next we investigate what happens ifwe allow the possibility of having seveDtiheads on each tape with some appropriaterule to prevent two heads from occupyingthe same square and giving conflictingprint instructions. We call such a de-vice a multihead Turing machine. Ournext result says that the use of such amodel would not change the complexityclasses.Theorem 7.

Let u be computable by a multiheadTuring machine which prints the n thdigit in T(n) or less operations where Tis a time-function; then u is in ST.

This theorem suggests that our modelcan tolerate some large deviations with-out changing the complexity classes. Thesame techniques can be applied to otherchanges in the model. For example, con-sider multitape Turing machines whichhave a fixed number of special tapesymbols such that each symbol can appearin at most one square at any given timeand such that the reading head can beshifted in one operation to the placewhere the special symbol is printed, nomatter how far it is on the tape. Turingmachines with such "jump instructions"are similarly shown to leave the classesunchanged.

Changes in the structure of the tapetend to lead to "square laws." For ex-ample, consider the following:Definition 3.

A two-dimensional tape is an un-bounded plane which is subdivided intosquares by equidistant sets of verticaland horizontal lines. The reading headof the Turing machine with this two-di-mensional tape can move either one squareup or down, or one square to the left orright on each operation. This definitionextends naturally to higher dimensionaltapes.

Such a device is related to a multi-tape Turing machine by the followingsquare law.Theorem 8.

If a is T-computable by a Turing·machine with n-dimensional tapes, then a

86

is T2-computable by a Turing machine Withlinear tapes.

IV. A LIMIT THEOREMIn Theorem 2 and its corollaries, we

established some conditions under whichtwo specific complexity classes are thesame. The purpose of this section is toestablish a condition under which twoclasses are different. First we needa preliminary definition.Definition 4.

A monotone increasing function f ofintegers into integers is calledtime countable if and only if there is amultitape Turing machine 2 which, on itsn th operation, prints on its output tapea one whenever T(m) = n -for some m andprints a zero otherwise. We shall referto as aT-counter.

This definition was used by H.Yamada3 and he shows that such commonfunctions as nk , kn , and n: are all real-time countable. He also shows that, ifTl and T2 are real-time countable, thenso are kTl' Tl(n) + T2(n), Tl(n) · T2 (n),Tl[T2(n)], and [Tl (n)J T2(n).

It is also true that, given a com-putable sequence a, there is'a real-timecountable function T(n) thatFor observe that,- for any J which printsQ, one can change the output of 7 toobtain a prints a zero when-

does not print an output andprints a one does print an output;and Jr' is a real-time counter for somefunction T such that U(ST. Thus the nexttheorem, in spite of its real-time count-ability restriction, has considerableinterest and potential application.Theorem 9.

If U and T are real-time countablemonotone increasing functions and

inf T(n) log T(n) - 0U(n) -

then there is a sequence a such that ais in Su but not in ST.

Summary of Proof: Because T istime countable, a set t1. } of binaryput multi tape Turing can beenumerated such that each 1 i operates intime 2T and such U€ST is the aiprinted by some :r i. A device can beconstructed which, when supplied (on atape) with the instructions for .,gives out the n th digit of Q. Ci'T(n) • log T(n) operations, w6ere Ci is a

Page 6: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

o .

U(n) + T(n), U[T(n)], and U(n)·T(n).These constructions involve the operationof one counter or the other and thusnecessarily run in time 2T which is justas good as T by Theorem 2.

V. CLASSIFICATION OF NUMBERSA sequence u can be regarded as a

binary expansion of a real number a. Itis interesting to inquire as to whetheror not numbers that we regard as simplein some sense fall into small complexityclasses. Although we believe that thecomplexity classes a number belongs todepends on its base, the theorems givenhere apply to any base.Theorem 10.

All the rational numbers are con-tained in Sn.

Proof: It is both well known andobvious that any rational number, beingultimately periodic, can be printed onedigit per operation by a zero tapemachine (finite automaton).Theorem 11.

All the algebraic numbers are con-tained in Sn2.

Proof: Let f(x) = arXr + a _lxr - l +••• + be a smallest degree polynomialwith a as a root, 0 s a 1. Let Qm bea number equal to a through the mthdecimal place and zero in the other bits,where m is chosen large enough so that a:is the only root of f(x) so approximated_We may assume without loss of generalitythat f(um) 0 and f(Qm + 2-m) > o.

Our operates as follows:the numbers Oml. (1 sis r) are stored onseparate tapes with reading heads on ther • roth place (to obtain the least sig-nificant bit of The first m outputsare given from a memory tape.Then b = + 2-,m+ J] is computed. • If

But theninf T log T = inf U log U =0

max (U,T) max (U,T)and the result follows by Theorem 9.

We close this section with some sideremarks about Definition 4. Obviously,the concept of real-time countabilityeasily generalizes to T(n)-countability.Yamada's constructions3 can be used toprove the closure of these classes underthe rules of combination

inf T(n)· log T(n) = 0 ,n 00 T(n + 1)

and the result follows from the theorem.Corollary 9.3.

There exist functions U and T suchthat Su U ST Smax(U,T)·

Proof: It is clearly possible toconstruct real-time functions U and Tsuch that:

· f T log T · f U log U1n U = 1n T

constant for each i which accounts forthe fact that the transitions are takenoff a tape and where the T.log T accountsfor the fact that the number of tapesavailable to simulate all the jfi isfixed and Theorem 6B must be appealed to.A device can now be specified to run adiagonal process on the and print intime U. Because the inf is zero, thesimulation of ::r i will eventually catchup to U regardless of how much initialdelay Di before the simulation begins;i.e., Di + Ci · T(Ni ) · log T(N i ) < U(N i )for some large Ni - Thus if we put out anoutput only at t1mes U(n) [and this ispossible since U(n) is thereis enough time to simulate all the :J i'one after another, and print out thecomplement of 2'i(Ni ) at time U(N.), Nl <NZ < ••• <Ni < •.• Thus we are a51e toprint out a U-computable sequencedifferent from all T-computable sequences.

Next we give a corollary thatenables us to construct specificty classes related by proper containment.Corollary 9.1

If U and T are real-time countablemonotone increasing functions and

lim T(n). log T(n) = 0n ---+ 00 U(n)

then ST is properly contained in SueProof: This follows from the theo-

rem and Corollary 2.3.Now we disprove some conjectures by

using our ability to construct distinctclasses.Corollary 9.2.

There exist time functions T suchthat ST(n) ST!n+l)· Thus a translationof a t1me-funct10n may give a differentcomplexity class. 2

Proof: Choose T(n) = 2n which weknow to be real-time countable by Yamada.3Clearly,

87

Page 7: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

infn--+- 00

3. If T and U are time functions suchthat

inf T(n) + n > 0 ,<D U(n) :

then if R is T-recognizable, R is U-recognizable.4. If R is T-recognizable by a multi-

tape multihead Turing machine, then itis T2-recognizable by a single-tape,single-head Turing machine.5. If U and T are real-time, monotone

increasing functions andT(n).log T(n) = 0 ,

U(n)

strange result that in thissome transcendental numbers are simplerthan all irrational algebraic numbers.

VI. GENERALIZATIONSIn this section, we consider briefly

some generalizations of our theory. Tostart off} we investigate the complexityof recognition problems.Definition 6.

Let R be a set of words of finitelength taken over some finite alphabet A.Let.1 be a multitape Turing machine witha one-way input tape which uses thesymbols in A. 2 is said to recognize Rif and only if, for any input sequenceex on A, the n th output digit of.:f is aone if the first n digits of u form aword in R and is zero otherwise. If T isa time-function, T(n) n, then R issaid to be T-recognizable if and only 1£there is which recognizes R and, forany input sequence a, prints the n thoutput digit in T(n) or fewer operations.

The restriction that inputs betaken one digit at a time prevents someof the previous results from beingcarried over exactly. The generalizationsare nevertheless easy and some importantones are summarized in the next theorem.Had we not permitted several outputdigits per square in our previous work,the previous results might have alsotaken this form.Theorem 13.1. The subset of Turing machines which

are T-recognizers is recursively enumer-able and therefore there are arbitrarilycomplex recognition problems.2. If R is T-recognizable and T(n) =

n + E(n), E(n) 0, then R is U-recog-nlzable where U(o) = n + [kE(n)], k > O.

00ex =:E ...J...

0=1 2n •which is a Liouville number and known tobe transcendental. For the base k, the2 must be replaced by k. Since alteringa finite set of digits does not alter thecomplexity or the transcendental charac-ter of a, Sn contains an infinity ofsuch numbers which form dense subset ofthe real numbers.

It would be interesting to determinewhether there are any irrational alge-braic numbers which belong to S. Ifthis is not the case, we would Rave the

b 0 the (m + l)th output is one and, .we store 1 (1 $ i $ r) [where Um+l =a + 2-(m+T}] on separate tahes, set

on the r(m+l)t place, .anderase the If b > 0, the output 1Szero and we take = urn' the Qeadson the r(m+l)st place of the (=and erase scratch work. The cycle thenrepeats itself to calculate the otherbits.

It remains to bethis procedure can be done 1n m opera-tions. This will follow if we can showthat each cycle can be completed in anumber of operations proportional to m.Now k numbers of length r • m with read-ing heads on the least significant bitcan be added and heads returned in2 (r • m+k) times (r • m+k to accoun t forcarries). Multiplication by an integerh can also be done in proportion to msince this is equivalent to adding hnumbers.

· . · · i-lThe number (um+2-m)1 = + <I) a •2-m+••• +2- im , (1 i r), can thus becomputed in time proportional to m sin:ethis involves adding and constant mult1-plication 9£ stored numbers.and sincefactors 2- 1 affect only dec1rnal places.Then b can be computed in proportion tom by a similar argument. Finally, the(Um + 2-m)i or the (depending on theoutput) and b can be erasedto m and thus the whole operat10n 1S 1nproportion to m from.which it followsthat a is T(m) = m2 computable.Theorem 12.

There exist transcendental numbersthat belong to Sn.

Proof: Since is real-time count-prints (in real-time)

the binary form of

88

Page 8: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

then there exists an R which is U-recog-nizab1e but is not T-recognizable.

One possible application of this isto language recognition problems. Wehave a straightforward proof that a con-text free language9 can be recognized intime T(n) = kn where k depends only onthe grammer. The proof amounts to per-forming all possible constructions oflength n and then checking the lis7 forthe n th word. The next example g1ves aC.F. language which cannot be recognizedin real time.

Example: Let R be the set of wordson the set lO,l,s} such that a word isin R if and only if the mirror_ image ofthe zero-one word following the last sis the same as a zero-one word betweentwo consecutive s's or preceding theinitial s. Thus Osl10sls01l and ll0slls011 are in R because 110 is the mirrorimage of 011 whereas OllsllOlsOll is notin R. The reason that we use the mirror

instead of the word itself is thatR is now a C.F. language, although wewill not give the grammer here.

Proof that R is not n-recognizable:Suppose that 2 is a machine which recog-nizes R. Let J' have d states, m tapes, -and at most k symbols per tape square.Assume that has already performed someunspecified number of operations. Wewish to put an upper bound on the numberof past input histories can distinguittlin i additional operations. The onlyinformation in storage available toin i operations is the present state andthe tape information within i squares ofthe head. From this information, at mostd • k(2i + l)m cases can be distinguished.Now the set of zero-one words of lengthi - 1 has 2i - 1 elements and this sethas 2(Zi - 1) subsets. Anyone of thesesubsets could be the set of words oflength i - 1 which occurred betweenvarious s symbols among the previouslyreceived inputs. Any pair of these sub-sets must be distinguishable by in ioperations since, if the next i inputsare an s followed by the mirror image ofa word in one set but not the other, !Jmust produce different outputs. But

2(2 i - l ) > d k(2i+l)m for large i,and thus :r cannot operate as it issupposed to.

Thus we have our first impossibilityresult. It would seem that the s'tudyof recognition problems offers an easier

89

approach to impossibility results thenthe study of sequences, since the re-searcher can control what the machinemust do.

Obviously, this theory can also begeneralized to the classification offunctions of integers into integers.The exact form of the theory will dependon what form one wants the answersprinted, but the techniques of the proofsapply quite "generally.

VII. PROBLEMS AND OPEN QUESTIONS1. Improve Theorem 9; either by elimi-

nating the real-time countable conditionon U or by finding a stronger limit.There is a distinct gap between Theorem 9which says an a in Su - ST andCorollary 2.1 which says that there isnot; and the question is, what can besaid about Su and ST when

inf T(n) = 0 ?00 U(n)

We are inclined to believe that thiscondition insures ST SU' especially ifthe functions are countable,but a better approach than used inTheorem 9 will probably have to be found.2. Are there problems which need time

T2 on a one-tape machine, but which canbe done in time T using several tapes?An improvement on Theorem 6 would auto-matically give an improvement on Theorem9. This problem has been solved byF.e. Rennie for "off-line" recognition

(Proved constructively)3. Are there problems which need time

T2 on linear tapes, but which can be donein time T using n-dimensional tapes?4. Which, if any, irrational algebraic

numbers are in Sn? If there are none,then one could exhibit numerous tran-cendential numbers by constructing real-time multitape Turing machines known notto be ultimately periodic. For example,

00

a =

n=lwould be trancendential.

REFERENCES1. A.M. Turing, "On Computable Numbers,

with Applications to the Entschei-dungs Problem," ·Proc. London Math.Soc., Sere 2, 42, 230-265 (1937).

Page 9: COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES*res/complexity_recursive_seq_1964.pdf · 2019-03-09 · COMPUTATIONAL COMPLEXITY OF RECURSIVE SEQUENCES* J. Hartmanis and R.E. Stearns

2. M. Davis, Computability and Unsolv-ability, McGraw-Hill Book Co., Inc.,New York (1958).

3. H. Yamada, "Real-Time Computation andRecursive Functions Not Real-TimeComputable," I.R.E. TEC, EC-ll, No.66,753-760 (December 1962).

.4. M.G. Rabin, "Real Time Computation,"Israel J. Math., .1, 203-211 (1963).

5. M. Blum, I'A Machine- IndependentTheory of the Complexity of RecursiveFunctions, It PhD Thesis, Department ofMath., M.I.T. (May 5 1964).

6. F.C. Hennie, Private Communication.

7 • J. Myhill, "Lineary Bounded Automata,lIWADD Tech. Note 60-165, Univ. ofPennsylvania Rept. No. 60-22 (June1960) •

8. R.W. Ritchie, "Classes of PredictablyComputable Functions," Trans. Am.Math. Soc., 106, No.1, lJ9-l73(June 1963) .

9. A.N. Chomsky, "On Certain FormalProperties of Grannners," Informationand Control, No.2, 137-1671959) .

10. J. Hartmanis and R.E. Stearns, "0nthe Computational Complexity ofAlgorithms," Trans. American Math.Soc. (in press).

TAPES

FINITE STATECOMPUTER

OUTPUT TAPE

FIG. 1. MULTITAPE TURING MACHINE.

90