Académique Documents
Professionnel Documents
Culture Documents
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/242506038
CITATIONS READS
632 320
2 authors, including:
Juris Hartmanis
Cornell University
179 PUBLICATIONS 5,250 CITATIONS
SEE PROFILE
All in-text references underlined in blue are linked to publications on ResearchGate, Available from: Juris Hartmanis
letting you access and read them immediately. Retrieved on: 20 September 2016
On the Computational Complexity of Algorithms
Author(s): J. Hartmanis and R. E. Stearns
Source: Transactions of the American Mathematical Society, Vol. 117 (May, 1965), pp. 285-306
Published by: American Mathematical Society
Stable URL: http://www.jstor.org/stable/1994208 .
Accessed: 25/02/2011 04:30
Your use of the JSTOR archive indicates your acceptance of JSTOR's Terms and Conditions of Use, available at .
http://www.jstor.org/page/info/about/policies/terms.jsp. JSTOR's Terms and Conditions of Use provides, in part, that unless
you have obtained prior permission, you may not download an entire issue of a journal or multiple copies of articles, and you
may use content in the JSTOR archive only for your personal, non-commercial use.
Please contact the publisher regarding any further use of this work. Publisher contact information may be obtained at .
http://www.jstor.org/action/showPublisher?publisherCode=ams. .
Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printed
page of such transmission.
JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of
content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms
of scholarship. For more information about JSTOR, please contact support@jstor.org.
American Mathematical Society is collaborating with JSTOR to digitize, preserve and extend access to
Transactions of the American Mathematical Society.
http://www.jstor.org
ON THE COMPUTATIONAL
COMPLEXITY OF ALGORITHMS
BY
J. HARTMANIS AND R. E. STEARNS
T_ T2(n)_
n 4 00 U(n)
* TAPES
| STATE
FINITE ;; OUTPUT
TAPE
COMPUTER X
FIGURE 1. An n-tapeTuringmachine
ofdistinctcomplexity
classes.
Proof.Let$7 computea sequencea notin ST (Corollary
1.1).Let V(n)equal
thenumberof operations requiredby$7to computethenthdigitof a. Clearly
V is computableand cee Sy. Let
U(n) = max [T(n), V(n)],
thenV(n) is a time-function
and clearly
Su D SrT
Sincecxin Su andocnotin ST,wehave
SU # ST
1.3. The setof all complexity
COROLLARY classesis countable.
Proof. The set of enumerablesets is countable.
Ournexttheoremassertsthatlinearchangesin a time-function
do notchange
class.If r is a real number,
thecomplexity wewrite[r] torepresent
thesmallest
integerm such that m 2 r.
290 J. HARTMANIS AND R. E. STEARNS [May
inf T(n)
~~>0,
n,- U(n)
thenSU C ST.
sup -
T(n)
()< oo
n ) U(n)
,,~
thenSu 2: ST.
2.1.
ofCorollary
Proof. Thisis thereciprocal
1965] ON THE COMPUTATIONAL COMPLEXITY OF ALGORITHMS 291
J71 1-21-10112112
(a)
21-41-31-2-12 3 5-4-30 21-31415
(b)
(c) (d)
4 52
4-3-12 31 51 134151617
(e) (f)
L 7
(g)
FIGURE 2. (a) Tape of Y withhead on 0. (b) Corresponding of Y'. (c) -T' if
configurations
Ymovestwoleft. (d) Y' ifY movesto-1. (e)Y6'if9_movesto0. (f)' ifYmoves to 1.
(g) Y' if Y movestwo right
I
inf T(n) > > 0
H,cn =k
and S,, C ST by Corollary2.1.
COROLLARY 2.5. For any time-function T, ST=Su whereU(n)=max [T(n),n].
Therefore,any complexityclass may be definedby afunction U(n) > n.
Proof. Clearlyinf(T/ U) > min(1, 1/ k) and sup (T/ U) < 1.
COROLLARY 2.6. If T is a time-function
satisfying
EI l I I2lAl l l |~ | } TAPETI
-3- -1
0 27 TAPETn
(a)
-l 0 2
2n 1
fl_L-1 2 7 7n 3 2*-1 -]n||121|1- 2 1|n -| .
(b)
FIGURE 3. (a) The n tapesof Y. (b) The tape of Y1
(a) 5T-
I '10?112131461?/1 I I
21ER ~ v1618
{)l(b IFT'234536 ?JTIDKl
(a) (b)
FIGURE 4. (a) Y' in cleanposition.(b) ' in dirtyposition
a performs like the left head of 5 tape b behaves like the right head, and tape
,
c reduces the count each time a check mark is moved. Head a must carry the
check right whenever it moves right from a checked square, since the new symbol
it prints will not be stored on tape b; and similarly head b moves its check left.
After some m operations of Y' corresponding to m operations of Y, a "dirty"
position such as Figure 4(b) is reached where there is no overlapping information.
The information (if any) between the heads of 9 must be on only one tape of 9-',
say tape b as in Figure 4(b). Head b then moves to the check mark, the between
head information is copied over onto tape a, and head a moves back into position.
A clean position has been achieved and J' is ready to resume imitating Y. The
time lost is 31 where 1 is the distance between the heads. But 1 ? mi since head
b has moved I squares from the check mark it left. Therefore 4m is enough time
to imitate m operations of Y and restore a clean position. Thus
aseS4T = Sr
as was to be shown.
This theorem suggests that our model can tolerate some large deviations
without changing the complexity classes. Thec same techniques can be applied
to other changes in the model. For example, consider multitape Turing ma-
chines which have a fixed number of special tape symbols such that each symbol
can appear in at most one square at any given time and such that the reading
head can be shifted in one operation to the place where the special symbol is
printed, no matter how far it is on the tape. Turing machines with such "jump
instructions" are similarly shown to leave the classes unchanged.
Changes in the structure of the tape tend to lead to "square laws." For example,
consider the following:
DEFINITION 3. A two-dimensional tape is an unbounded plane which is sub-
divided into squares by equidistant sets of vertical and horizontal lines as shown
in Figure 5. The reading head of the Turing machine with this two-dimensional
tape can move either one square up or down, or one square left or right on each
operation. This definition extends naturally to higher-dimensional tapes.
1965] ON THE COMPUTATIONAL COMPLEXITY OF ALGORITHMS 297
Turing
Sucha deviceis relatedto a multitape machine square
bythefollowing
law.
THEOREM8. If ocis T-computablebya Turing machinewithn-dimensional
tapes, thena is T2-computableby a Turing machinewithlinear tapes.
Proof. We restrict to a singletwo-dimensional
ourselves tape machine,.9T,
being
thegeneralization straightforward.
-
Weproceedto simulate on a multitape machineY'.
At thebeginning of thesimulation on ourmachine9f',the
of a .Y operation
tapeis written
of thetwo-dimensional
entirehistory on theright-
chronologically
handpartofa lineartapeas shownin Figure5. The squaresrecordalternately
_P3 I I IrIP51rIP4jd
IP3V IP21uIPIIUIPoQ \
N u UP SHIFT
_ _ __PO 9/ -
d - DOWNSHIFT
READING
HEAD r - RIGHTSHIFT
lineartape
tape and corresponding
FIGtRE 5. Contrastbetweentwo-dimensional
OUTPUT PRINT
SYMBOLS
[TAPE SHIFT NEXT]
READ STATE
INSTRUCTIONS
INSTRUCTIONS
SECTION
DETAILOF TRANSITION
SNTAME TRANSITION
SECTIONS
I
DETAIL SECTION
OF STATE ENDMARKER
ISTARTING IRE
SECTIONS
STATE STATE
STATETAPE
FIGURE 6. Details of state tape
ENUMERATOR CUNE
STATETAPE CONTROL
TAPE
OUTPUT
t ~~~~~~~~~~~OUTPUT
TAPETAPE ACTIVETAPE
SCRATCH RESERVETAPE
TAPE
FIGURE 7. Device to printa U-sequencethatis not a T-sequence
a contradiction.
Next we give a corollarythatenablesus to construct
specificcomplexity
classesrelatedby propercontainment.
COROLLARY9.1. If U and T are real-timecountable monotoneincreasing
functionsand
limT(n)2 = 0
inf
fT(n)2
n c T(n + 1)
and the resultfollowsfromthe theorem.
COROLLARY9.3. There existfunctionsU and T such that ST $ Su and
SU$ ST.
inf T2(n) = 0
n -+ U(n)
inf T(n)
U) =0?
wouldbe transcendental.
The authors express their gratitudeto G. M. Roe,
ACKNOWLEDGMENTS.
R. L. Shuey,and an anonymousrefereefor theirhelpful and
suggestions
constructive ofthiswork.
criticism
Addedinproof. Someimprovements on the resultsin this paper may be
in [8].
foundin [7]. Relatedresultsare reported
REFERENCES
1. A. M. Turing,On computable numbers,withapplications problem,
to theEntscheidungs
Proc. London Math. Soc. (2) 42 (1937),230-265.
2. M. Davis, Computability McGraw-Hill,New York, 1958.
and unsolvability,
3. H. Yamada, Real-time computationandrecursive functionsnotreal-time IRE
computable,
Trans.EC-ll (1962), 753-760.
4. J.Myhill,Linearbounded automata,WADD Tech.Note 60-165,Rep. No.60-22, Univ.
of Pennsylvania, June,1960.
5. R. W. Ritchie,Classes ofpredictably computable functions,Trans. Amer.Math. Soc.
106 (1963),139-173.
6. A. N. Chomsky,On certain formalpropertiesof grammars, Information and Control2
(1959),137-167.
7. J. Hartmanisand R. E. Stearns,Computational complexityof recursive Proc.
sequences,
FifthAnnualSympos.on Switching Theoryand LogicalDesign,Princeton, N. J.1964.
8. M. 0. Rabin,Real-time computation,Israel J. Math. 1 (1963),203-211.