Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lower Bounds on the Time-complexity of Non-regular Languages on One-tape Turing Machine Miaohua Xu For Theory of Computation II Professor: Geoffrey S.

Similar presentations


Presentation on theme: "Lower Bounds on the Time-complexity of Non-regular Languages on One-tape Turing Machine Miaohua Xu For Theory of Computation II Professor: Geoffrey S."— Presentation transcript:

1 Lower Bounds on the Time-complexity of Non-regular Languages on One-tape Turing Machine Miaohua Xu For Theory of Computation II Professor: Geoffrey S. Smith Florida International University

2 Single-tape Turing Machine On each operation the machine Writes a new symbol on the tape square under the head. Enters into a new state (not necessarily different than previous state). Moves the reading head either left or right by one tape square. q1q1

3 Single-tape Turing Machine On each operation the machine Writes a new symbol on the tape square under the head. Enters into a new state (not necessarily different than previous state). Moves the reading head either left or right by one tape square. q2q2

4 Motivational Example Consider the language L = { 0 k 1 k | k ≥ 0} Scan across the tape and reject if a 0 is found to the right of a 1. Repeat the following if the both 0’s and 1’s remain. Scan across the tape crossing off a single 0 and a single 1. If either 0 or 1 remains, reject. Else accept.̎ M 1 = ̎ On input string ω : Can We do better? TIME(n 2 )

5 TIME(n log n) Motivational Example Cont’d. M 2 = ̎ On input string ω : Scan across the tape and reject if a 0 is found to the right of a 1. Repeat the following if the both 0’s and 1’s remain. Scan across the tape, checking whether the total number of 0’s and 1’s remaining on the tape is even or odd. If odd, reject. Scan again across tape, crossing off every other 0 and ever other 1. If either 0 or 1 remains, reject. Else accept.̎ Can We do better?

6 We Can Not Do Any (great) Better Introduction of crossing sequence. Illustration of some properties of crossing sequences. Proving that lengths of crossing sequences must be bounded (Hartmanis68). Proving that bounded length crossing sequences  language must be regular (Hennie65). Theorem: If language A TIME(f(n)), where f(n) belongs to o (n log n), then A is regular. Outline of the proof

7 Crossing Sequence X Y q1q1 q3q3 q7q7 C (w s X : Yw t ) = (q 1, q 2, …, q 7 ) wsws wtwt Crossing sequence on the boundary between X and Y is the ordered sequence of states s(1), s(2), …, s(n); where s(i) is the state in which machine is in i th crossing of the boundary.

8 Properties of Crossing Sequences ω1ω1 ω2ω2 ω3ω3 C (ω 1 : ω 2 ω 3 ) = C (ω 1 ω 2 : ω 3 ) Machine head will be in ω 2 portion iff it has crossed (ω 1 : ω 2 ) boundary an odd number of times and (ω 2 : ω 3 ) boundary even number of times. Running time = sum of the lengths of all crossing sequences. if Machine can not halt in ω 2 portion. It will accept (reject) ω 1 ω 2 ω 3 iff it accepts (rejects) ω 1 ω 3.

9 ω1ω1 ω2ω2 ω3ω3 q1q1 q1q1 q2q2 q2q2 ω1ω1 ω3ω3 q1q1 q2q2 If C (ω 1 : ω 2 ω 3 ) = C (ω 1 ω 2 : ω 3 )

10 Proof outline again Introduction of crossing sequence. Illustration of some properties of crossing sequences. Proving that lengths of crossing sequences must be bounded if f(n) belongs to o(n log n) Proving that bounded length crossing sequences  language must be regular

11 Hartmanis68 Definition: R(n) = maximum length of a crossing sequence on an input of size n. Theorem: If the sequence R(n) is not bounded by a constant then running time T(n) = Ω(n log n). Proof: Assume R(n) is not bounded by a constant R(n) n There will exist 0 < n 1 < n 2 < … such that R(n i ) > R(n), for n i > n s i is the string of length n i for which R(n i )-long crossing sequences are generated

12 Hartmanis68 Cont’d. Proposition: On s i no crossing sequence can be generated more than twice. Let s i = ω 1 ω 2 ω 3 ω 4, ω 1, ω 2, ω 3, ω 4 ≠ ø C (ω 1 : ω 2 ω 3 ω 4 ) = C (ω 1 ω 2 : ω 3 ω 4 ) = C (ω 1 ω 2 ω 3 : ω 4 ) Proof: M will generate a crossing sequence of length R(n i ) either on s′ = ω 1 ω 2 ω 4 or on s′′ = ω 1 ω 3 ω 4. Both strings s′ and s′′ have length < n i, which leads to the contradiction.

13 ω1ω1 ω2ω2 ω3ω3 If C (ω 1 : ω 2 ω 3 ω 4 ) = C (ω 1 ω 2 : ω 3 ω 4 )= C (ω 1 : ω 2 ω 3 : ω 4 ) ω4ω4 ω1ω1 ω2ω2 ω3ω3 ω4ω4 ω1ω1 ω3ω3 ω4ω4 ω1ω1 ω2ω2 ω4ω4

14 Hartmanis68 cont’d. Number of crossing sequences on s i ≥ n i (as there are at least n i number of boundaries). no crossing sequence can be generated more than twice. 2Q R(n ) + 1 ≥ n i i R(n i ) ≥ log n i – 2 (the base of logarithm is Q) Number of crossing sequences of length at most r = Σ Q i ≤ Q r + 1 (Q is the number of states) i = 0 i = r Number of crossing sequences of length at most r = Σ Q i ≤ Q r + 1 (Q is the number of states) i = 0 i = r If R(n) = o ( log n) then R(n) must be bounded by a constant

15 1. T(n i ) = sum of the lengths of all crossing sequences. 2. If R(n i ) is not bound, then 3. no crossing sequence can be generated more than twice If T(n) = o (n log n) then R(n) must be bounded by a constant ??? R(n i ) ≥ log n i - 2 Length of crossing sequence Number of crossing sequences of the length 02 12*|Q| 22*|Q| 2 32*|Q| 3 ……… N-12*|Q| N-1 N2*|Q| N

16 Hartmanis68 cont’d. T(n) = Ω (n log n) If T(n) = o (n log n) then R(n) must be bounded by a constant

17 Complete Proof If T(n) is o(n log n) then lengths of all crossing sequences will be bounded by a constant. Done! bounded length crossing sequences  language must be regular If lengths of all crossing sequences is ≤ k (for some constant k), the language can be represented as a union of a number of classes of a finite right- invariance relation. Any language which can be represented as a union of a number of classes of a finite right-invariance relation, must be regular. (Myhill-Nerode Theorem): A language L is regular iff it can be represented as the union of a number of classes of a finite, right–invariant equivalence relation ≡ L.

18 Right-invariant Definition: The equivalence relation ≡ L is right-invariant iff x ≡ L y and x L  y L (Myhill-Nerode Theorem): A language L is regular iff it can be represented as the union of a number of classes of a finite, right –invariant equivalence relation ≡ L. x ≡ L y  for all z, x.z ≡ L y.z

19 A language can be represented as the union of a number of classes of a finite, right – invariant equivalence relation  it’s regular

20 Hennie65: Intuitive Idea Defining the relation ≡ L in terms of crossing sequence. If we know all possible crossing sequences at a boundary then just by knowing the part of string on the right of boundary we can simulate the TM. x ≡ L y if and only the set of crossing sequences which can appear on their right-hand end is same. Determining whether a given crossing sequence can appear at the right of a given left-end tape segment can not be done by considering all tapes that contain the given left-end segment.

21 Hennie’s Experiment For a given finite left-end tape segment t and finite crossing sequence C = S(1), S(2), …, S(k) do the following experiment. Begin the experiment by placing machine in the start state and causing it to scan leftmost square of t. When machine leaves the right-end of t for i th time (i < k) and is in state S(i), put it in state S(i + 1) and send it back to the rightmost square of t. If the machine halts within t, or gets stuck in some periodic behavior within t, or leaves t in such a way that previous step can not be applied, stop the experiment. If at the end the crossing sequence generated at right end of t is same as C, the segment t is said to support the crossing sequence C. Transient, accepting, non accepting crossing sequences for t.

22 Hennie65 Number of all crossing sequences of length at most k is finite (≤ Q k + 1 ). Number of subsets of these crossing sequences will also be finite. Every finite left-end tape can be classified according to the crossing sequences of length k or less that it supports at its right end, and according to which of these sequences are transient, which are accepting and which are non accepting. Define the relation ≡ M by x ≡ M y if all the four sets of crossing sequences are same for x and y.

23 Hennie65 Cont’d. The relation ≡ M is an equivalence relation. Finiteness: Since the number of 4-tuples (supported crossing sequences x transient CS x accepting CS x non accepting CS) is finite, the relation ≡ M will have finite number of equivalence classes. Right-invariance: Let t 1 and t 2 are two finite left-end segments, belonging to the same class. Now consider t 1 t x and t 2 t x, where t x is finite. Since t 1 can be replaced by t 2 without changing the crossing sequences in t x portion, t 1 t x and t 2 t x will have same set of supported, transient, accepting and non accepting crossing sequences (i.e., t 1 t x ≡ M t 2 t x ). t2t2 txtx txtx t1t1 C C C’

24 More Result LanguagesLower boundsUpper bounds Regular LanguagesO(n) Nonregular CFLsO(nlogn)n 5 -recognizable Particular Nonregular CFLs {0 k 1 k |k>0}O(nlogn) {w|w is palindrome}O(n 2 ) There is no algorithm to decide whether a nonregular context-free language generated by grammar G can be recognized in time T(n)=nlogn

25 References Hennie, F.C. One-tape, offline Turing machine computations, Inf. Contr. 8 (1965), 553-578. Hartmanis, J. Computational complexity of one-tape Turing machine computations, JACM, Volume 2, Issue 15 (1968), 325-339. Aho, Motwani, Ullman Introduction to automata and language theory. Ajay Kr. Verma, Amin Shokrollahi Lower Bounds on the Time-complexity of Non-regular Languages on Single- tape Turing Machine (slides) www-cad.eecs.berkeley.edu/~tah/172/7.pdf -- Lectue 7: Myhill-Nerode Theorem

26 Questions? Thank you!


Download ppt "Lower Bounds on the Time-complexity of Non-regular Languages on One-tape Turing Machine Miaohua Xu For Theory of Computation II Professor: Geoffrey S."

Similar presentations


Ads by Google