Nondeterministic Space Is Closed Under Complementation

Total Page:16

File Type:pdf, Size:1020Kb

Nondeterministic Space Is Closed Under Complementation Nondeterministic Space is Closed Under Complementation Neil Immerman Computer Science Department Yale University New Haven CT SIAM Journal of Computing Intro duction In this pap er we show that nondeterministic space sn is closed under com plementation for sn greater than or equal to log n It immediately follows that the contextsensitive languages are closed under complementation thus settling a question raised by Kuro da in See Hartmanis and Hunt for a discussion of the history and imp ortance of this problem and Hop croft and Ullman for all relevantbackground material and denitions The history b ehind the pro of is as follows In we showed that the set of rstorder inductive denitions over nite structures is closed under complementation This holds with or without an ordering relation on the structure If an ordering is present the resulting class is PMany p eople exp ected that the result was false in the absence of an ordering In we studied rstorder logic with ordering with a transitive closure op erator We showed that NSPACElog n is equal to FO p os TC ie rstorder logic with ordering plus a transitive closure op eration in which the transitive closure op erator do es not app ear within any negation symbols Nowwehave returned to the issue of complementation in the lightof recent results on the collapse of the log space hierarchies Wehave shown that the class FO p os TC is closed under complementation Our Research supp orted by NSF Grant DCR main result follows In this pap er wegive the pro of in terms of machines and then state the result for transitive closure as Corollary The question of whether FO posTCwithout ordering is closed under complementation remains op en Our work in rstorder expressibility led to our pro of that nondetermin istic space is closed under complementation However b ecause rstorder expressibility classes are not directly relevant to the pro ofs in this pap er we omit those denitions here The interested reader should refer to for all these denitions Note that the pro of of Theorem in is more complicated than the pro of of Theorem but quite similar to it The same is true of the pro of in that the rstorder inductive formulas are closed under complementation Results Theorem For any sn log n NSPACEsn coNSPACEsn Pro of We do this bytwo lemmas We will show that counting the exact numb er of reachable congurations of an NSPACEsn machine can b e done in NSPACEsn Lemma Lemma says that once this number has b een calculated we can detect rejection as well as acceptance Note the similaritybetween Lemma and a similar result ab out census functions in Lemma Suppose we are given an NSPACEsn machine M a size sn initial conguration START and the exact number N of congurations of size sn reachable by M from START Then we can test in NSPACEsn if M rejects Pro of Our NSPACEsn tester do es the following It initializes a counter to and a target conguration to the lexicographically rst string of length sn For each such target either we guess a computation path of M from START to target and increment b oth counter and target or we simply The conguration ofaTuring machine is the contents of its work tap es the p ositions of its heads and its state Note that for sn log nthenumb er of p ossible congurations sn is less than c for some constant candthus can b e written in O sn space increment target For each target that wehave found a path to if it is an accept conguration of M then we reject Finally if when we are done with the last target the counter is equal to N we accept otherwise we reject Note that we accept i wehave found N reachable congurations none of which is accepting Supp ose that M accepts In this case there can b e at most N reachable congurations that are not accepting and our machine will reject On the other hand if M rejects then there are N nonaccepting reachable congurations Thus our nondeterministic machine can guess paths to each of them in turn and accept That is we accept i M rejects Lemma Given START as in Lemma we can calculate N the total number of congurations of size sn reachable by M from STARTin NSPACEsn Pro of Let N b e the numb er of congurations reachable from START d in at most d steps The computation pro ceeds by calculating N N and so on By induction on d weshow that each N may b e calculated in d NSPACEsn The base case d is obvious Inductive step Given N weshowhow to calculate N AsinLemma d d wekeep a counter of the number of d reachable congurations and we cycle through all the target congurations in lexicographical order For each target we do the following Cycle through all N congurations reachable in d at most d steps again we nd a path of length at most d for eachreachable one and if we dont nd all N of them then we will reject For eachof d these N congurations check if it is equal to target or if target is reachable d from it in one step If so then increment the counter and start on target If we nish visiting all N congurations without reaching target then just d start again on target without incrementing the counter When weve completed this algorithm for all targets our counter contains N Since N d sn is b ounded ab oveby c for some constant c the space needed is Osn To complete the pro of of the lemma and the theorem note that N is equaltotherstN suchthatN N d d d Remark In our original statement of Theorem we made the assump tion that sn is space constructible However the standard denition of a nondeterministic Turing machine having space complexity sn is that no sequence of choices enables it to scan more than sn cells Thus the ab ove pro of works even if sn is not space constructible We just let sn increase as needed The following corollary is immediate Corollary The class of context sensitive languages is closed under com plementation Pro of Kuro da showed in that CSL NSPACEn th The k level of the log space alternating hierarchy ALOG is dened k to b e the set of problems accepted by alternating log space Turing machines that make at most k alternations and b egin in an existential state Re cently Lange Jenner and Kirsig showed that this hierarchy collapsed to the second level ALOG This result was then extended by several authors who showed that the log space oracle hierarchy collapses to NL L Here LDSPACElog n and NL NSPACElog n The logspace or OLOG k acle hierarchyisgiven by OLOG NLand OLOG NL k In the case of the p olynomial time hierarchy the oracle and alternating hier archies are identical but they app eared to b e dierent in the log space case We knew that the logspace oracle hierarchy is equal to FO TC This together with the ab ove results led us to exp ect Theorem The following is again immediate Corollary The LogSpaceAlternating Hierarchy and the LogSpaceOracle Hierarchy both col lapse to NSPACElog n In we showed that NL is equal to FO p os TC In Theorem of wealsoshowed that any problem in NL may b e expressed in the form max where is a quantier free rstorder formula and and TC max are constantsymb ols It now follows that the same is true for the class FOTC Corollary NSPACElog nFOpos TC FOTC Any formula in FOTCmaybe expressed in the form TC max where is a quantier free rstorder formula Michael Fischer has observed that one can now diagonalize nondeter ministic space and thus easily proveatight hierarchy theorem for nonde terministic space Although Corollary is not new our techniques givea much simpler pro of than was previously known See Chapter in for the old pro of Corollary For any tapeconstructible sn log n tn lim n sn implies NSPACE tn NSPACE sn Conclusions and Directions for Future Work Most of the interesting questions concerning the p ower of nondeterminism remain op en We still do not know whether nondeterministic space is equal to deterministic space or whether Savitchs Theorem is optimal It is interesting to consider whether our pro of metho d can b e extended to answer these questions or to tell us anything new ab out nondeterministic time So on after weproved Theorem Tompa et al gavetwo extensions they proved that LOGCFL the set of problems log space reducible to a context free language is closed under complementation and they showed that Symmetric Log Space cf is contained in ZPLP the class of errorless probabilistic Turing machines running in O log n space and p olynomial exp ected time We suggest the following op en problems Is FO without p os TC closed under complementation Is Symmetric Log Space equivalently FO p os STC closed under complementation Is NL equal to a complexity class that was previously known to b e closed under complementation eg L AC or DSPACElog n In the pro of of Theorem we made use of the linear space compression theorem Theorem in Our actual construction multiplies the space b ound by ab out eight It is interesting to ask howmuch this can b e reduced Note in particular that if we could complementlogn times while only increasing the space b ound by a constant factor then it would followthatNLAC Acknowledgements Thanks to Sam Buss MikeFischer Lane Hemachan dra Steve Mahaney and Jo el Seiferas who contributed comments and cor rections to this pap er References A Boro din SA Co ok PW Dymond WL Ruzzo and M Tompa Two Applications of Complementation via Inductive Counting this volume S R Buss SA Co ok P Dymond and L Hay The Log Space Oracle Hierarchy Collapses in preparation SA Co ok A Taxonomy of Problems with Fast Parallel Algorithms Information and Control J Hartmanis and HB Hunt I I I The LBA
Recommended publications
  • CS601 DTIME and DSPACE Lecture 5 Time and Space Functions: T, S
    CS601 DTIME and DSPACE Lecture 5 Time and Space functions: t, s : N → N+ Definition 5.1 A set A ⊆ U is in DTIME[t(n)] iff there exists a deterministic, multi-tape TM, M, and a constant c, such that, 1. A = L(M) ≡ w ∈ U M(w)=1 , and 2. ∀w ∈ U, M(w) halts within c · t(|w|) steps. Definition 5.2 A set A ⊆ U is in DSPACE[s(n)] iff there exists a deterministic, multi-tape TM, M, and a constant c, such that, 1. A = L(M), and 2. ∀w ∈ U, M(w) uses at most c · s(|w|) work-tape cells. (Input tape is “read-only” and not counted as space used.) Example: PALINDROMES ∈ DTIME[n], DSPACE[n]. In fact, PALINDROMES ∈ DSPACE[log n]. [Exercise] 1 CS601 F(DTIME) and F(DSPACE) Lecture 5 Definition 5.3 f : U → U is in F (DTIME[t(n)]) iff there exists a deterministic, multi-tape TM, M, and a constant c, such that, 1. f = M(·); 2. ∀w ∈ U, M(w) halts within c · t(|w|) steps; 3. |f(w)|≤|w|O(1), i.e., f is polynomially bounded. Definition 5.4 f : U → U is in F (DSPACE[s(n)]) iff there exists a deterministic, multi-tape TM, M, and a constant c, such that, 1. f = M(·); 2. ∀w ∈ U, M(w) uses at most c · s(|w|) work-tape cells; 3. |f(w)|≤|w|O(1), i.e., f is polynomially bounded. (Input tape is “read-only”; Output tape is “write-only”.
    [Show full text]
  • Interactive Proof Systems and Alternating Time-Space Complexity
    Theoretical Computer Science 113 (1993) 55-73 55 Elsevier Interactive proof systems and alternating time-space complexity Lance Fortnow” and Carsten Lund** Department of Computer Science, Unicersity of Chicago. 1100 E. 58th Street, Chicago, IL 40637, USA Abstract Fortnow, L. and C. Lund, Interactive proof systems and alternating time-space complexity, Theoretical Computer Science 113 (1993) 55-73. We show a rough equivalence between alternating time-space complexity and a public-coin interactive proof system with the verifier having a polynomial-related time-space complexity. Special cases include the following: . All of NC has interactive proofs, with a log-space polynomial-time public-coin verifier vastly improving the best previous lower bound of LOGCFL for this model (Fortnow and Sipser, 1988). All languages in P have interactive proofs with a polynomial-time public-coin verifier using o(log’ n) space. l All exponential-time languages have interactive proof systems with public-coin polynomial-space exponential-time verifiers. To achieve better bounds, we show how to reduce a k-tape alternating Turing machine to a l-tape alternating Turing machine with only a constant factor increase in time and space. 1. Introduction In 1981, Chandra et al. [4] introduced alternating Turing machines, an extension of nondeterministic computation where the Turing machine can make both existential and universal moves. In 1985, Goldwasser et al. [lo] and Babai [l] introduced interactive proof systems, an extension of nondeterministic computation consisting of two players, an infinitely powerful prover and a probabilistic polynomial-time verifier. The prover will try to convince the verifier of the validity of some statement.
    [Show full text]
  • Complexity Theory
    Complexity Theory Course Notes Sebastiaan A. Terwijn Radboud University Nijmegen Department of Mathematics P.O. Box 9010 6500 GL Nijmegen the Netherlands [email protected] Copyright c 2010 by Sebastiaan A. Terwijn Version: December 2017 ii Contents 1 Introduction 1 1.1 Complexity theory . .1 1.2 Preliminaries . .1 1.3 Turing machines . .2 1.4 Big O and small o .........................3 1.5 Logic . .3 1.6 Number theory . .4 1.7 Exercises . .5 2 Basics 6 2.1 Time and space bounds . .6 2.2 Inclusions between classes . .7 2.3 Hierarchy theorems . .8 2.4 Central complexity classes . 10 2.5 Problems from logic, algebra, and graph theory . 11 2.6 The Immerman-Szelepcs´enyi Theorem . 12 2.7 Exercises . 14 3 Reductions and completeness 16 3.1 Many-one reductions . 16 3.2 NP-complete problems . 18 3.3 More decision problems from logic . 19 3.4 Completeness of Hamilton path and TSP . 22 3.5 Exercises . 24 4 Relativized computation and the polynomial hierarchy 27 4.1 Relativized computation . 27 4.2 The Polynomial Hierarchy . 28 4.3 Relativization . 31 4.4 Exercises . 32 iii 5 Diagonalization 34 5.1 The Halting Problem . 34 5.2 Intermediate sets . 34 5.3 Oracle separations . 36 5.4 Many-one versus Turing reductions . 38 5.5 Sparse sets . 38 5.6 The Gap Theorem . 40 5.7 The Speed-Up Theorem . 41 5.8 Exercises . 43 6 Randomized computation 45 6.1 Probabilistic classes . 45 6.2 More about BPP . 48 6.3 The classes RP and ZPP .
    [Show full text]
  • Lecture 10: Space Complexity III
    Space Complexity Classes: NL and L Reductions NL-completeness The Relation between NL and coNL A Relation Among the Complexity Classes Lecture 10: Space Complexity III Arijit Bishnu 27.03.2010 Space Complexity Classes: NL and L Reductions NL-completeness The Relation between NL and coNL A Relation Among the Complexity Classes Outline 1 Space Complexity Classes: NL and L 2 Reductions 3 NL-completeness 4 The Relation between NL and coNL 5 A Relation Among the Complexity Classes Space Complexity Classes: NL and L Reductions NL-completeness The Relation between NL and coNL A Relation Among the Complexity Classes Outline 1 Space Complexity Classes: NL and L 2 Reductions 3 NL-completeness 4 The Relation between NL and coNL 5 A Relation Among the Complexity Classes Definition for Recapitulation S c NPSPACE = c>0 NSPACE(n ). The class NPSPACE is an analog of the class NP. Definition L = SPACE(log n). Definition NL = NSPACE(log n). Space Complexity Classes: NL and L Reductions NL-completeness The Relation between NL and coNL A Relation Among the Complexity Classes Space Complexity Classes Definition for Recapitulation S c PSPACE = c>0 SPACE(n ). The class PSPACE is an analog of the class P. Definition L = SPACE(log n). Definition NL = NSPACE(log n). Space Complexity Classes: NL and L Reductions NL-completeness The Relation between NL and coNL A Relation Among the Complexity Classes Space Complexity Classes Definition for Recapitulation S c PSPACE = c>0 SPACE(n ). The class PSPACE is an analog of the class P. Definition for Recapitulation S c NPSPACE = c>0 NSPACE(n ).
    [Show full text]
  • Computability and Complexity Time and Space Complexity Definition Of
    Time and Space Complexity For practical solutions to computational problems available time, and Computability and Complexity available memory are two main considerations. Lecture 14 We have already studied time complexity, now we will focus on Space Complexity space (memory) complexity. Savitch’s Theorem Space Complexity Class PSPACE Question: How do we measure space complexity of a Turing machine? given by Jiri Srba Answer: The largest number of tape cells a Turing machine visits on all inputs of a given length n. Lecture 14 Computability and Complexity 1/15 Lecture 14 Computability and Complexity 2/15 Definition of Space Complexity The Complexity Classes SPACE and NSPACE Definition (Space Complexity of a TM) Definition (Complexity Class SPACE(t(n))) Let t : N R>0 be a function. Let M be a deterministic decider. The space complexity of M is a → function def SPACE(t(n)) = L(M) M is a decider running in space O(t(n)) f : N N → { | } where f (n) is the maximum number of tape cells that M scans on Definition (Complexity Class NSPACE(t(n))) any input of length n. Then we say that M runs in space f (n). Let t : N R>0 be a function. → def Definition (Space Complexity of a Nondeterministic TM) NSPACE(t(n)) = L(M) M is a nondetermin. decider running in space O(t(n)) Let M be a nondeterministic decider. The space complexity of M { | } is a function In other words: f : N N → SPACE(t(n)) is the class (collection) of languages that are where f (n) is the maximum number of tape cells that M scans on decidable by TMs running in space O(t(n)), and any branch of its computation on any input of length n.
    [Show full text]
  • Lecture 4: Space Complexity II: NL=Conl, Savitch's Theorem
    COM S 6810 Theory of Computing January 29, 2009 Lecture 4: Space Complexity II Instructor: Rafael Pass Scribe: Shuang Zhao 1 Recall from last lecture Definition 1 (SPACE, NSPACE) SPACE(S(n)) := Languages decidable by some TM using S(n) space; NSPACE(S(n)) := Languages decidable by some NTM using S(n) space. Definition 2 (PSPACE, NPSPACE) [ [ PSPACE := SPACE(nc), NPSPACE := NSPACE(nc). c>1 c>1 Definition 3 (L, NL) L := SPACE(log n), NL := NSPACE(log n). Theorem 1 SPACE(S(n)) ⊆ NSPACE(S(n)) ⊆ DTIME 2 O(S(n)) . This immediately gives that N L ⊆ P. Theorem 2 STCONN is NL-complete. 2 Today’s lecture Theorem 3 N L ⊆ SPACE(log2 n), namely STCONN can be solved in O(log2 n) space. Proof. Recall the STCONN problem: given digraph (V, E) and s, t ∈ V , determine if there exists a path from s to t. 4-1 Define boolean function Reach(u, v, k) with u, v ∈ V and k ∈ Z+ as follows: if there exists a path from u to v with length smaller than or equal to k, then Reach(u, v, k) = 1; otherwise Reach(u, v, k) = 0. It is easy to verify that there exists a path from s to t iff Reach(s, t, |V |) = 1. Next we show that Reach(s, t, |V |) can be recursively computed in O(log2 n) space. For all u, v ∈ V and k ∈ Z+: • k = 1: Reach(u, v, k) = 1 iff (u, v) ∈ E; • k > 1: Reach(u, v, k) = 1 iff there exists w ∈ V such that Reach(u, w, dk/2e) = 1 and Reach(w, v, bk/2c) = 1.
    [Show full text]
  • 26 Space Complexity
    CS:4330 Theory of Computation Spring 2018 Computability Theory Space Complexity Haniel Barbosa Readings for this lecture Chapter 8 of [Sipser 1996], 3rd edition. Sections 8.1, 8.2, and 8.3. Space Complexity B We now consider the complexity of computational problems in terms of the amount of space, or memory, they require B Time and space are two of the most important considerations when we seek practical solutions to most problems B Space complexity shares many of the features of time complexity B It serves a further way of classifying problems according to their computational difficulty 1 / 22 Space Complexity Definition Let M be a deterministic Turing machine, DTM, that halts on all inputs. The space complexity of M is the function f : N ! N, where f (n) is the maximum number of tape cells that M scans on any input of length n. Definition If M is a nondeterministic Turing machine, NTM, wherein all branches of its computation halt on all inputs, we define the space complexity of M, f (n), to be the maximum number of tape cells that M scans on any branch of its computation for any input of length n. 2 / 22 Estimation of space complexity Let f : N ! N be a function. The space complexity classes, SPACE(f (n)) and NSPACE(f (n)), are defined by: B SPACE(f (n)) = fL j L is a language decided by an O(f (n)) space DTMg B NSPACE(f (n)) = fL j L is a language decided by an O(f (n)) space NTMg 3 / 22 Example SAT can be solved with the linear space algorithm M1: M1 =“On input h'i, where ' is a Boolean formula: 1.
    [Show full text]
  • Introduction to Complexity Classes
    Introduction to Complexity Classes Marcin Sydow Introduction to Complexity Classes Marcin Sydow Introduction Denition to Complexity Classes TIME(f(n)) TIME(f(n)) denotes the set of languages decided by Marcin deterministic TM of TIME complexity f(n) Sydow Denition SPACE(f(n)) denotes the set of languages decided by deterministic TM of SPACE complexity f(n) Denition NTIME(f(n)) denotes the set of languages decided by non-deterministic TM of TIME complexity f(n) Denition NSPACE(f(n)) denotes the set of languages decided by non-deterministic TM of SPACE complexity f(n) Linear Speedup Theorem Introduction to Complexity Classes Marcin Sydow Theorem If L is recognised by machine M in time complexity f(n) then it can be recognised by a machine M' in time complexity f 0(n) = f (n) + (1 + )n, where > 0. Blum's theorem Introduction to Complexity Classes Marcin Sydow There exists a language for which there is no fastest algorithm! (Blum - a Turing Award laureate, 1995) Theorem There exists a language L such that if it is accepted by TM of time complexity f(n) then it is also accepted by some TM in time complexity log(f (n)). Basic complexity classes Introduction to Complexity Classes Marcin (the functions are asymptotic) Sydow P S TIME nj , the class of languages decided in = j>0 ( ) deterministic polynomial time NP S NTIME nj , the class of languages decided in = j>0 ( ) non-deterministic polynomial time EXP S TIME 2nj , the class of languages decided in = j>0 ( ) deterministic exponential time NEXP S NTIME 2nj , the class of languages decided
    [Show full text]
  • Computational Complexity
    Computational complexity Plan Complexity of a computation. Complexity classes DTIME(T (n)). Relations between complexity classes. Complete problems. Domino problems. NP-completeness. Complete problems for other classes Alternating machines. – p.1/17 Complexity of a computation A machine M is T (n) time bounded if for every n and word w of size n, every computation of M has length at most T (n). A machine M is S(n) space bounded if for every n and word w of size n, every computation of M uses at most S(n) cells of the working tape. Fact: If M is time or space bounded then L(M) is recursive. If L is recursive then there is a time and space bounded machine recognizing L. DTIME(T (n)) = fL(M) : M is det. and T (n) time boundedg NTIME(T (n)) = fL(M) : M is T (n) time boundedg DSPACE(S(n)) = fL(M) : M is det. and S(n) space boundedg NSPACE(S(n)) = fL(M) : M is S(n) space boundedg . – p.2/17 Hierarchy theorems A function S(n) is space constructible iff there is S(n)-bounded machine that given w writes aS(jwj) on the tape and stops. A function T (n) is time constructible iff there is a machine that on a word of size n makes exactly T (n) steps. Thm: Let S2(n) be a space-constructible function and let S1(n) ≥ log(n). If S1(n) lim infn!1 = 0 S2(n) then DSPACE(S2(n)) − DSPACE(S1(n)) is nonempty. Thm: Let T2(n) be a time-constructible function and let T1(n) log(T1(n)) lim infn!1 = 0 T2(n) then DTIME(T2(n)) − DTIME(T1(n)) is nonempty.
    [Show full text]
  • Complexity Classes
    CHAPTER Complexity Classes In an ideal world, each computational problem would be classified at least approximately by its use of computational resources. Unfortunately, our ability to so classify some important prob- lems is limited. We must be content to show that such problems fall into general complexity classes, such as the polynomial-time problems P, problems whose running time on a determin- istic Turing machine is a polynomial in the length of its input, or NP, the polynomial-time problems on nondeterministic Turing machines. Many complexity classes contain “complete problems,” problems that are hardest in the class. If the complexity of one complete problem is known, that of all complete problems is known. Thus, it is very useful to know that a problem is complete for a particular complexity class. For example, the class of NP-complete problems, the hardest problems in NP, contains many hundreds of important combinatorial problems such as the Traveling Salesperson Prob- lem. It is known that each NP-complete problem can be solved in time exponential in the size of the problem, but it is not known whether they can be solved in polynomial time. Whether ? P and NP are equal or not is known as the P = NP question. Decades of research have been devoted to this question without success. As a consequence, knowing that a problem is NP- complete is good evidence that it is an exponential-time problem. On the other hand, if one such problem were shown to be in P, all such problems would be been shown to be in P,a result that would be most important.
    [Show full text]
  • Space Complexity and Interactive Proof Systems
    Space Complexity and Interactive Proof Systems Sections 8.0, 8.1, 8.2, 8.3, 10.4 Based on Powerpoint slides by Giorgi Japaridze, Villanova University 1 8.0.a Space complexity defined Definition 8.1 Let M be a deterministic Turing machine that halts on all inputs. The space complexity of M is the function f: N→N, where f(n) is the maximum number of tape cells that M scans on any input of length n. If the space complexity of M is f(n), we also say that M runs in space f(n). If M is a nondeterministic TM wherein all branches halt on all inputs, we define its space complexity f(n) to be the maximum number of tape cells that M scans on any branch of its computation for any input of length n. 2 ! 8.0.b SPACE and NSPACE Definition 8.2 Let f: N→R+ be a function. The space complexity classes SPACE(f(n)) and NSPACE(f(n)) are defined as follows. SPACE(f(n)) = {L | L is a language decided by an O(f(n)) space deterministic Turing machine} NSPACE(f(n)) = {L | L is a language decided by an O(f(n)) space nondeterministic Turing machine}. 3 ! 8.0.c Space is more powerful than time Example 8.3. Space is more powerful than time, because it can be reused. E.g., while we believe that SAT has no polynomial (let alone linear) time algorithm, it can be easily decided in linear space: M1 = “On input <φ>, where φ is a Boolean formula: 1.
    [Show full text]
  • Introduction to Complexity Theory
    Introduction to Complexity Theory Mahesh Viswanathan Fall 2018 We will now study the time and space resource needs to solve a computational problem. The running time and memory requirements of an algorithm will be measured on the Turing machine model we introduced in the previous lecture. Recall that in this model, the Turing machine has a designated read-only input tape, and finitely many read/write worktapes. Unless we talk about function computation in the context of reductions, the output tape does not really play a role, and so we can assume for most of the time that these machines don't have an output tape. We will consider both the deterministic and nondeterministic versions of such Turing machines. Computational resources needed to solve a problem depend on the size of the input instance. For example, it is clearly easier to compute the sum of two one digit numbers as opposed to adding two 15 digit numbers. The resource requirements of an algorithm/Turing machine are measured as a function of the input size. We will only study time and space as computational resources in this presentation. We begin by defining time bounded and space bounded Turing machines, which are defined with respect to bounds given by functions T : N ! N and S : N ! N. Our definitions apply to both deterministic and nondeterministic machines. Definition 1. A (deterministic/nondeterministic) Turing machine M is said to run in time T (n) if on any input u, all computations of M on u take at most T (juj) steps; here juj refers to the length of input u.
    [Show full text]