An Optimal Lower Bound for Nonregular Languages

Similar documents
SUBLOGARITHMIC BOUNDS ON SPACE AND REVERSALS

Complementing two-way finite automata

Two-Way Automata and Descriptional Complexity

OPTIMAL SIMULATIONS BETWEEN UNARY AUTOMATA

arxiv: v1 [cs.cc] 3 Feb 2019

Computability and Complexity

Advanced topic: Space complexity

Turing Machines, diagonalization, the halting problem, reducibility

Theory of Computation

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Lecture 12: Mapping Reductions

Lecture 20: conp and Friends, Oracles in Complexity Theory

Remarks on Separating Words

Introduction to Languages and Computation

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Variants of Turing Machine (intro)

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov

Turing machines and linear bounded automata

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Part I: Definitions and Properties

Natural Computing Modelling of the Polynomial Space Turing Machines

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Asymptotic notation : big-o and small-o

A Lower Bound for Boolean Satisfiability on Turing Machines

CS21 Decidability and Tractability

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Homework Assignment 6 Answers

TWO-WAY FINITE AUTOMATA & PEBBLE AUTOMATA. Written by Liat Peterfreund

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

The Church-Turing Thesis

Introduction to Turing Machines

Chapter 3: The Church-Turing Thesis

Finite Automata. Mahesh Viswanathan

1 Two-Way Deterministic Finite Automata

COMPUTATIONAL COMPLEXITY

What You Must Remember When Processing Data Words

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Computer Sciences Department

On Stateless Multicounter Machines

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories

Theory of Computation (IX) Yijia Chen Fudan University

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Turing machines and linear bounded automata

Theory of Computation

Space Complexity. The space complexity of a program is how much memory it uses.

CS4026 Formal Models of Computation

conp, Oracles, Space Complexity

UNIT-VIII COMPUTABILITY THEORY

Lecture 4 : Quest for Structure in Counting Problems

Undecidable Problems and Reducibility

Computability Theory. CS215, Lecture 6,

The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

Parikh s Theorem and Descriptional Complexity

Turing Machines Part III

Chapter 2: Finite Automata

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

Non-emptiness Testing for TMs

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

A Lower Bound of 2 n Conditional Jumps for Boolean Satisfiability on A Random Access Machine

CSCE 551 Final Exam, Spring 2004 Answer Key

The tape of M. Figure 3: Simulation of a Turing machine with doubly infinite tape

Two-Way Automata Characterizations of L/poly versus NL

Nondeterministic Finite Automata

Theory of Computation

9 Nondeterministic Turing Machines

Theory of Computation

Turing Machines and Time Complexity

CS154, Lecture 17: conp, Oracles again, Space Complexity

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Theory of Computation

Parallel Turing Machines on a Two-Dimensional Tape

Turing Machine Variants

3515ICT: Theory of Computation. Regular languages

Words with the Smallest Number of Closed Factors

Turing machines and linear bounded automata

1 Basic Combinatorics

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Further discussion of Turing machines

Theory of Computation

Friday Four Square! Today at 4:15PM, Outside Gates


Outline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018

NP, polynomial-time mapping reductions, and NP-completeness

An algebraic characterization of unary two-way transducers

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CSE200: Computability and complexity Space Complexity

Theory of Computation

1 Showing Recognizability

Definition: conp = { L L NP } What does a conp computation look like?

Theory of Computation

Two Way Deterministic Finite Automata

The Power of One-State Turing Machines

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

V Honors Theory of Computation

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

1 Acceptance, Rejection, and I/O for Turing Machines

Computational complexity

Transcription:

An Optimal Lower Bound for Nonregular Languages Alberto Bertoni Carlo Mereghetti Giovanni Pighizzini Dipartimento di Scienze dell Informazione Università degli Studi di Milano via Comelico, 39 2035 Milano Italy. Abstract In this paper we prove a tight log n lower bound on the product of strong space and input head reversals for any Turing machine (equipped with a read only input tape) accepting a nonregular language. Keywords: Computational complexity; Formal languages; Lower bounds. Preliminaries A classical topic in formal language theory and structural complexity concerns the analysis of computational resource requirements for certain classes of problems. A well nown result in this field deals with space lower bounds for Turing machines accepting nonregular languages: Theorem [5] If a language L is accepted by a one way (two way, resp.) nondeterministic Turing machine in strong space o(log n) (o(log log n), resp.) then L is regular. In this wor we unify and refine the bounds stated in Theorem by taing into account also the number of input head reversals. More precisely, we prove that, for any nonregular language, the product of strong space and input head reversals must be greater than log n infinitely often. Furthermore, we show the optimality of such a lower bound by proving that a nonregular language proposed in [] can be accepted within strong O(log log n) space and O( log n log log n ) input head reversals simultaneously. We briefly recall definitions and conventions adopted throughout this wor. Unless otherwise stated, Turing machines we consider are intended to be nondeterministic. Any machine M is equipped with a read only input tape and a wor tape. The input tape is usually visualized as having end marers which can never be exceeded by the input head during computations. Without loss of generality, we assume that M accepts by entering a This wor was supported in part by the ESPRIT Basic Research Action No. 637: Algebraic and Syntactic Methods in Computer Science (ASMICS 2) and by the Ministero dell Università e della Ricerca Scientifica e Tecnologica (MURST). Presented at Secondo incontro italiano di Combinatoria Algebrica, 6 7 October, 995, Milano Italy

final state with its input head off the rightmost input symbol. M wors within strong s(n) space and i(n) input head reversals (simultaneously) if, on any input of length n, each computation taes at most s(n) wor tape squares and reverses input head direction at most i(n) times. More generally, M is said to be one way if, at each step, it can move its input head right one position or eep it stationary. M is a two way machine if left input head moves are allowed too. For technical reasons, we will assume i(n) = for one way machines. 2 The lower bound Let us refine space lower bounds for nonregular languages given in [5] by considering also input head reversal. We first show how to remove input head reversals on Turing machines by suitably augmenting wor space. Such a result is a generalization of the simulation of two way finite state automata with one way corresponding devices as presented, e.g., in [6]. The ey idea is the notion of crossing sequence which we now briefly recall. Let us consider the boundary between two input tape squares and let c i denote the configuration of a Turing machine M when, during a computation, its input head crosses such a boundary for the ith time. The sequence S = (c, c 2,...) is called crossing sequence generated in the computation of M at the given boundary [4]. Let us now tae an input tape square containing a symbol σ and two sequences S and S of configurations of M. We say that S matches S on σ if S and S can represent two crossing sequences occurring at the left and at the right boundary, respectively, of σ in some computation of M. It is worth remaring that such a matching can be locally tested without nowing input symbols other than σ and just taing into account the transition function of M (see, for details, [6]). By means of such a tool, we are able to prove the following: Theorem 2 For any two way Turing machine M woring within strong s(n) space and i(n) input head reversals there exists an equivalent one way machine M where each accepting computation taes at most O(s(n) i(n)) wor tape cells. Proof. It is not hard to see that the Turing machine M accepts an input string x if and only if there exists a vector (S 0, S,..., S n ) of crossing sequences (representing an accepting computation of M on x) such that:. S 0 and S n are crossing sequences whose only elements are, respectively, the initial and a final configuration of M. 2. For each 0 i n, the crossing sequence S i has length at most i(n). 3. For each 0 < i n, the crossing sequence S i matches S i on the ith input symbol. The Turing machine M simulating M begins by writing S 0 on its own wor tape. Then, it guesses a crossing sequence S, verifies matching with S 0 on the first input symbol and substitutes S 0 with S. Such a procedure is iterated on each input symbol (see (3)) and M accepts if and only if, according to (), a crossing sequence corresponding to a final configuration of M is reached at the end. The fact that M is one way follows from local verifiability of matching between crossing sequences above mentioned. Furthermore, by (2), any guessed crossing sequence can be represented within O(s(n) i(n)) space. 2

In [2], it is proved that Theorem 2 can be extended also to those machines where space is evaluated by just taing into account all the accepting computations (accept mode). Hence, we obtain the following: Theorem 3 Let L be a nonregular language accepted by a Turing machine M in strong s(n) space and i(n) input head reversals. Then, for a suitable constant c > 0, it holds that s(n) i(n) c log n infinitely often. 3 Optimality proof In this section, we prove that the lower bound obtained in Theorem 3 is optimal. Actually, we shall provide a stronger statement by showing that such a lower bound is tight also for deterministic Turing machines accepting nonregular languages over a single letter alphabet. For any positive integer n, let q(n) denote the smallest integer not dividing n. Alt and Mehlhorn [] introduced the nonregular language: L = { n q(n) is a power of 2}, and showed how to accept it in O(log log n) space: given an input string n, the rest of the integer division of n by (< n >, for short) is computed for each integer 2 until q(n) is reached. Then, L membership is decided by testing whether q(n) is a power of 2. The space bound follows from the observation that q(n) = O(log n) []. Moreover, for each 2 q(n), the computation of < n > can be accomplished by scanning the input string once while counting its length modulo. Thus, the number of input head reversals equals the number of iterations on and hence is O(log n). Next lemma allows to reduce such an iteration number in order to obtain an optimal algorithm. Lemma For any positive integer n, q(n) is a power of a prime number. Proof. Let > 2 be an integer such that < n > j = 0 for each 2 j +. If + is not a prime power, then there exists a pair a, b of relatively prime numbers less than such that + = a b. So, it holds that < n > a =< n > b = 0 and hence < n > a b =< n > + = 0. Thus, q(n) must be a prime power. By previous lemma, we are able to obtain the following algorithm for recognizing L: Algorithm input( n ) := 2 while < n > = 0 do begin := + while not(pp()) do := + end if is a power of 2 then accept else reject where pp(x) denotes the predicate x is a power of a prime number. 3

Now, we can prove the optimality of the lower bound stated in Theorem 3 by estimating the complexity of Algorithm : Theorem 4 The language L can be recognized by a deterministic Turing machine in strong O(log log n) space with O( log n log log n ) input head reversals. Proof. The correctness of Algorithm is a consequence of previous discussions. Let us now setch how to evaluate predicate pp(x) for any positive integer x expressed in binary notation: for 2 j x, test j s primality by simply verifying that no positive integer less than j divides it. If that is the case, then checs whether j i equals x by considering integers i such that j i x. It is not hard to show that all this can be wored out in O( x ) space without moving input head. Therefore, by recalling that q(n) = O(log n), we can estimate the space complexity of whole Algorithm as being O(log log n). The number of input head reversals equals the number of iterations of the outermost loop, i.e., it coincides with the number of prime powers not exceeding q(n). Claim The number of prime powers not exceeding is asymptotic to ( ). Proof. Let p, p 2,..., p s denote the primes not exceeding and, for each i s, let N i be the number of powers of p i not exceeding. Thus, p N i i and hence N i log p i. By the Prime Number Theorem [3], it holds that the number s of primes not exceeding is asymptotic to ( ). Hence we obtain the following asymptotic estimation of the number of prime powers not exceeding : s N + N 2 +... + N s = log i s log ( 2 log p i dx log x ). log i s log s In conclusion, by observing that q(n) = O(log n) and that the function non decreasing, we obtain the result. is monotone References [] H. Alt and K. Mehlhorn. A language over a one symbol alphabet requiring only O(log log n) space. SIGACT news, 7:3 33, 975. [2] A. Bertoni, C. Mereghetti, and G. Pighizzini. Strong optimal lower bounds for Turing machines that accept nonregular languages. In Mathematical Foundations of Computer Science 995, Proceedings, Lecture Notes in Computer Science 969, pages 309 38. Springer Verlag, 995. 4

[3] G. Hardy and E. Wright. An Introduction to the Theory of Numbers. Oxford University Press, 5th edition, 979. [4] F. Hennie. One tape, off line Turing machine computations. Information and Control, 8:553 578, 965. [5] J. Hopcroft and J. Ullman. Some results on tape bounded Turing machines. Journal of the ACM, 6:68 77, 969. [6] J. Hopcroft and J. Ullman. Introduction to automata theory, languages, and computations. Addison Wesley, Reading, MA, 979. 5