Presentation is loading. Please wait.

Presentation is loading. Please wait.

DSPACE Slides By: Alexander Eskin, Ilya Berdichevsky

Similar presentations


Presentation on theme: "DSPACE Slides By: Alexander Eskin, Ilya Berdichevsky"— Presentation transcript:

1 DSPACE Slides By: Alexander Eskin, Ilya Berdichevsky
(From the Course “Computational Complexity” by Ely Porat) י'/אייר/תשע"ט DSPACE

2 Agenda Definition of DSPACE DSPACE(s(n))  DTIME(2O(s(n)))
DSPACE(O(1)) = DFA DSPACE(o(logn))  DSPACE(O(1)) DSPACE(o(loglogn)) = DSPACE(O(1)) י'/אייר/תשע"ט DSPACE

3 Definition of DSPACE Let M be a deterministic Turing Machine with 3 tapes: Input, Space (work) and Output. DSPACE ( s(n) ) := { L |  M M(x) = L(X)  n |Space(M)|  s(n) } י'/אייר/תשע"ט DSPACE

4 Explanation Input tape is read-only. Work tape is read-write.
|Space(M)| is measured by the bounds of the machine’s position on this tape. Output tape is write-only. DSPACE ( s(n) ) is the class of all the languages that can be decided deterministically using s(n) work space. י'/אייר/תשע"ט DSPACE

5 Theorem: DSPACE(s(n))  DTIME(2O(s(n)))
Proof: Let M be a Turing Machine s.t. L(M)  DSPACE(s(n))  |Space(M)| = s(n)  = {0, 1, #}  number of states for the work tape is || |Space| = 3 s(n) The number of possible head positions in the work tape is s(n). The number of possible head positions in the input tape is n. The number of the states of M is |QM|. י'/אייר/תשע"ט DSPACE

6 Claim: M cannot do more than 2O(s(n)) steps
This entails: The number of the possible configurations of M is s(n)  3s(n)  n  |QM| = 2O(s(n)) Claim: M cannot do more than 2O(s(n)) steps Otherwise, M will go through the same configuration at least twice, entering an infinite loop. Therefore, M has to run in time  2O(s(n)) י'/אייר/תשע"ט DSPACE

7 Explanation If M will go through the same configuration twice, it will enter an infinite loop, since: The same configuration Ci  the same head position in the input tape and the same state. But M is deterministic, so in both cases it will move to the same configuration Ci+1 etc. Since after the first time M entered Ci , it returned there one more time, it would do so after the second time and so on. י'/אייר/תשע"ט DSPACE

8 Theorem: DSPACE(O(1)) = DFA
Proof: Claim: DSPACE(O(1)) = TWA (Two way automata) Claim: TWA = DFA Claims 1, 2 entail: DSPACE(O(1)) = DFA י'/אייר/תשע"ט DSPACE

9 Explanation Proof of Claim 1:
Let M be a Turing machine. |Space(M)| = O(1)  there is constant number of possible contents of the work tape, say y. There are |Q| states  M can be simulated by TWA with |Q|y states (still constant # of states). The proof of Claim 2 is beyond the scope of this course. י'/אייר/תשע"ט DSPACE

10 Theorem: DSPACE(o(logn))  DSPACE(O(1))
Proof: We will show: DSPACE(log log(n))  DSPACE(O(1)) Let L be a language: (L) = {0, 1, $} L = {w = 0…0$0…01$0…010$…$1…1 | k  N the l-th substring of w delimited by $ has length k and is the binary representation of l-1, 0  l < 2k } Claim: L is not regular. י'/אייר/תשע"ט DSPACE

11 Lemma: L  DSPACE(log log(n))
Proof: Let M be a Turing Machine, doing the following: Check that every block delimited by $ is k-length. This takes log(k) space. Check the 1st block is all 0’s and the last block is all 1’s. This takes O(1) space. For each two consecutive sub-strings, verify that they are x$x+1. י'/אייר/תשע"ט DSPACE

12 Explanation The claim that L is not regular can be easily proved by the Pumping Lemma Step 3 above (for each two consecutive sub-strings, verify that they are x$x+1) is done as follows: Start from the LSB (right-to-left) Check: every 1 in Xm  0 in Xm+1 Check: the 1st 0 in Xm  1 in Xm+1 י'/אייר/תשע"ט DSPACE

13 Back to the proof of the lemma:
Verifying that each two consecutive sub-strings are x$x+1 (step 3) takes log(k) space, since each time we compare 1 bit only, and need a log(k) counter to count k bits forward Steps 1-3 take together O(log(k)) space, which is O( log log(n) ) We have shown: L  DSPACE(log log(n)) But L is not regular  DSPACE(log log(n))  DSPACE(O(1))  DSPACE(o(log(n))  DSPACE(O(1)) י'/אייר/תשע"ט DSPACE

14 Theorem: DSPACE(o(loglogn)) = DSPACE(O(1))
Proof: Claim: DSPACE(o(loglogn))  DSPACE(O(1)) Lemma: DSPACE(o(loglogn))  DSPACE(O(1)) DSPACE(o(loglogn)) = DSPACE(O(1)) (entailed by 1. and 2. above) י'/אייר/תשע"ט DSPACE

15 Explanation Claim: Proof: DSPACE(o(loglogn))  DSPACE(O(1))
o(loglogn))  O(1)  י'/אייר/תשע"ט DSPACE

16 k = 2S(n)  S(n)  |QM| = O(2S(n))
Claim: Given input x : |x| = n such that M accepts x, then M can be on every cell on the input tape at most k times k = 2S(n)  S(n)  |QM| = O(2S(n)) Proof: k is number of possible different configuration of the machine. If M were on the cell more than k times then it would be in the same configuration twice and thus never terminate. י'/אייר/תשע"ט DSPACE

17 Explanation k is the number of possible different configurations of the machine 2S(n) – number of possible contents of the work-tape. S(n) – number of possible locations for the r/w head on the work-tape. |QM| - set of states of M. If M were on the cell more than k times then it would be in the same configuration twice. The second time in the same configuration the machine will perform exactly as the first time  endless loop. י'/אייר/תשע"ט DSPACE

18 Lemma: DSPACE(o(loglogn))  DSPACE(O(1)) Proof: Definition:
semi-configuration is a configuration with position on the input tape replaced by the symbol at the current input tape position configuration of the machine For every location i on the input tape we consider all possible semi-configuration of M when passing location I The sequence of such a configurations is Ci = Ci1,Ci2… Cir then it length is bounded by O(2S(n))  r י'/אייר/תשע"ט DSPACE

19 Proof of Lemma (contd.):
The number of possible different sequences of semi-configurations of M, associated with any position on input tape is bounded by S(n) = o(log log n)  n0N such that n  n0, We’ll show that n  n0 S(n) = S(n0), thus LDSPACE(S(n0))  DSPACE(S(1)) proving the theorem. י'/אייר/תשע"ט DSPACE

20 Assume to the contrary that there exists n` such that S(n`) > S(n0)
Proof of Lemma (contd.): Assume to the contrary that there exists n` such that S(n`) > S(n0) Let and let x1{0,1}n1 be such that SpaceM(x1) > S(n0) x1 is the shortest input on which M uses more space then S(n0). The number of sequences of semi-configurations at any position in the input tape is Labeling n1 positions on the input tape by at most sequences means there must be at least three positions with the same sequence of semi-configurations. י'/אייר/תשע"ט DSPACE

21 Without loss of generality say x1= aaa
Each of the position with symbol a has the same sequence of semi-configurations attached. Claim: The machine produces the same final semi-configuration with either a or a eliminated from the input. י'/אייר/תשע"ט DSPACE

22 Explanation Proof of the Claim:
Consider cutting a, leaving x1` = aa On x1` M proceeds on the input exactly as with x1 until it first reaches the a. M will make the same decision to go right or left on x1` as it did on x1 since all the information stored in the machine at the current head position is identical. If the machine goes left then its computation will proceed identically because it still did not see difference on both inputs. י'/אייר/תשע"ט DSPACE

23 Explanation (contd.) Proof of the claim (contd.):
If the machine goes right: Say this is the ith time at the first a. Since the semi-configuration is the same in both cases then on input x1 the machine M also went right on the ith time seeing the second a. The machine proceeded and either terminated or came back for the (i+1)th time to the second a. In either case on input x`1 the machine M is going to do the same thing but now on the first a. י'/אייר/תשע"ט DSPACE

24 Explanation (contd.) Proof of the claim (contd.):
As the machine proceeds through the sequence of semi-configurations we see that the final semi-configuration on x`1 will be same as for x1 arguing each time that on x`1 we will have the same sequence of semi-configurations. The case in which a is eliminated is identical. י'/אייר/תשע"ט DSPACE

25 Proof of the Lemma (contd.): Let x2 = aa and x3 = aa
If the worst case of space usage processing x1 was in a then WM(x1)= WM(x2)= WM(x3) If the worst case of space usage was in a then WM(x1)= WM(x2)WM(x3) If the worst case of space usage was in a then WM(x1)= WM(x3)WM(x2) Chose x1`{x2,x3} to maximize WM(x1`)  WM(x1`) = WM(x1) and | x1`| < | x1| Contradiction to assumption that x1 is minimal length string using more then S(n0) space  no such x1 exists. י'/אייר/תשע"ט DSPACE


Download ppt "DSPACE Slides By: Alexander Eskin, Ilya Berdichevsky"

Similar presentations


Ads by Google