DSPACE Slides By: Alexander Eskin, Ilya Berdichevsky

Slides:



Advertisements
Similar presentations
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
Advertisements

Theory of Computing Lecture 23 MAS 714 Hartmut Klauck.
Variants of Turing machines
1 Savitch and Immerman- Szelepcsènyi Theorems. 2 Space Compression  For every k-tape S(n) space bounded offline (with a separate read-only input tape)
CS21 Decidability and Tractability
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Computability and Complexity 19-1 Computability and Complexity Andrei Bulatov Non-Deterministic Space.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Non Deterministic Space Avi Ben Ari Lior Friedman Adapted from Dr. Eli Porat Lectures Bar-Ilan - University.
1 Slides: Asaf Shapira & Oded Schwartz; Sonny Ben-Shimon & Yaniv Nahum. Sonny Ben-Shimon & Yaniv Nahum. Notes: Leia Passoni, Reuben Sumner, Yoad Lustig.
Linear Bounded Automata LBAs
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Slides: Asaf Shapira & Oded Schwartz; Sonny Ben-Shimon & Yaniv Nahum. Sonny Ben-Shimon & Yaniv Nahum. Notes: Leia Passoni, Reuben Sumner, Yoad Lustig.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Theory of Computing Lecture 21 MAS 714 Hartmut Klauck.
A Universal Turing Machine
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Recursively Enumerable and Recursive Languages
1 Introduction to Turing Machines
1 Design and Analysis of Algorithms Yoram Moses Lecture 13 June 17, 2010
Space Complexity Guy Feigenblat Based on lecture by Dr. Ely Porat Complexity course Computer science department, Bar-Ilan university December 2008.
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Turing’s Thesis.
Turing’s Thesis Costas Busch - LSU.
A Universal Turing Machine
Probabilistic Algorithms
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Busch Complexity Lectures: Turing Machines
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions Costas Busch - LSU.
PDAs Accept Context-Free Languages
OTHER MODELS OF TURING MACHINES
Turing Machines 2nd 2017 Lecture 9.
Hierarchy of languages
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Properties of Regular Languages
Decidable Languages Costas Busch - LSU.
Chapter Nine: Advanced Topics in Regular Languages
Elementary Questions about Regular Languages
CS21 Decidability and Tractability
Variations of the Turing Machine
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
Recall last lecture and Nondeterministic TMs
Instructor: Aaron Roth
Instructor: Aaron Roth
Presentation transcript:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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