IIT Kharagpur Theory of Computation: CS41001 Lecture IX

IIT Kharagpur Theory of Computation: CS41001 Lecture IX

Computer Science & Engineering Department IIT Kharagpur Theory of Computation: CS41001 Lecture IX Instructor: Goutam Biswas Autumn Semester 2014-2015 0.1 Hierarchy Theorems Space, the number of tape cells, and the time, the number of computation steps are two main measure of cost of a Turing machine computation. If we increase space or time as a function of the input size, the size of the class of problems that can be solved also increases in size. It is expected that the class of languages that can be decided in linear space (space usage is linearly dependent on the input size) is larger than the class problems decidable in logspace. This type of claims are formally established in space and time hierarchy theorems. Proof of these theorems use diagonalisation techniques in a more sopheisticated way. Theorem 1. (Space Hierarchy Theorem) Let s : N0 → N0 be a space constructible function and s(n) ≥ log n. There is a language L decidable in space O(s(n)), but not in space o(s(n)). ′ ′ In other words, if s,s : N0 → N0 are space-constructible functions, where s (n)= o(s(n)), then SPACE(s′(n)) is a proper subset of SPACE(s(n)). Proof: We need a language L with two properties, (i) L is decided in space O(s(n)), but (ii) L is not decided in space o(s(n)). We use diagonalisation to establish that L is different from every language decided in o(s(n)) space. We design an O(s(n)) space bounded Turing machine D such that L(D) is different from every L(M), where M is a o(s(n)) space bounded Turing machine. The language L(D) is different from every L(M) in at least one string. The string where D differs is related to <M>. Steps of D are roughly as follows, but they are to be tuned. 1. If the input x ∈ {0, 1}∗ is not a description of a Turing machine, then D rejects it. 2. The function s(n) is space constructible. D computes s(n) and puts a right marker after s(n) cells, where x =<M> and n = |x| = | <M> |. 3. D simulates M on <M > within the space bound s(| <M > |). D accepts <M > if and only if M rejects <M >. 4. If M does not halt within 2s(|<M>|) time steps (s(| <M> |) bits are required to count it), D rejects the input. 5. If the simulation of M goes beyond s(n), M is not o(s(n)) space bounded, and D may accept or reject. There are a few important technical details that are to be taken into consideration. 1. Even if M runs in o(s(n)) space, it is an asymptotic behavior. For small values of the input length, the space usage may be more than s(n)1. In such a situation D’s space may be insufficient to complete the simulation of M on <M >. D may reject 1 For all c> 0 there is n0 ∈ N, such that the space is < cg(n) for all n ≥ n0. 1 <M > without knowing the outcome of the computation of M on <M >, and the diagonalisation may fail. One trick to avoid this problem is to also consider inputs of the form x =<M > 10∗. Simulate M on <M > 10∗, which can be arbitrarily long and the problem of ‘small length’ strings can be avoided for some value of k and a string <M > 10k, where the asymptotic behaviour has started. Following is the O(s(n)) space decider D for L(D). We argue that L(D) cannot be decide by any o(s(n)) space decider. D: input x 1. if x =<M > 10∗, reject x. 2. Compute s(|x|) and mark tape space of s(|x|) cells. If there is any move of simulation beyond this mark, reject x. 3. Prepare a counter of s(|x|) bits and initialise it to 0. 4. Simulate M on x, at every step increment the counter. 5. If the counter exceeds 2s(n), reject x. 6. If M accepts x, reject x; else accept x. Note that the set of alphabet of M may be larger than D and one cell of M may require k cells of D for simulation. So, if M runs in s′(n) space, its simulation on D will use ks′(n) space. We prove that L(D) cannot be decided in o(s(n)) space. For the sake of contradiction we assume that L(D) is decided in space s′(n)= o(s(n)) by M. Simulation of M on D runs in ′ ks (n) space. From the definition o(s(n)), we know that there is a n0 such that for all n ≥ n0, ks′(n) <s(n). n0 So for an input x of length ≥ n0 e.g. x =<M> 10 , the simulation of M on D will halt, and D will accept x if and only if M rejects it. So the languages L(D) is not the language of L(M) - a contradiction. QED. ′ ′ If s,s : N0 → N0 be such that s (n)= o(s(n)) and s(n) is space constructible, then SPACE(s′(n)) ⊂ SPACE(s(n)). So we have L ⊂ PSPACE. Also NL ⊆ SPACE((log n)2), by the Savitch’s theorem. And by the space hierarchy, SPACE((log n)2) ⊂ SPACE(n) ⊂ PSPACE. Theorem 2. (Time Hierarchy Theorem) For any time constructible function t : N0 → N0, t(n) ≥ n there is a language L that is decidable in O(t(n)) time but not decidable in o(t(n)/ log t(n)) time. [On a single tape machine]. ′ ′ In other words, if t,t : N0 → N0 are time constructible functions so that t (n) = o(t(n)/ log t(n)), then DTIME(t′(n)) ⊂ DTIME(t(n)). The idea is essentially same. We design a Turing machine D that rejects any input not of the form <M > 10∗. The machine D simulates M on <M > 10∗ for no more than t(n)/ log t(n) steps. D accepts <M > 10∗ if and only if M rejects it within t(n)/ log t(n) time. The overhead of log t(n) for the simulation of M comes from the fact that no better 2 method, other than counting, is known to keep track of the number of steps of simulation of M. Proof: D: input x 1. If x is not of the form <M > 10∗, reject it. 2. Compute t(n) and log t(n) and initialise a counter of size O(log t(n)) to t(n)/ log t(n). 3. If the counter is 0, reject. 4. Simulate next step of M on x. 5. If M accepts x, then reject; if M rejects x, then accept. 6. Decrement counter. 7. Goto step 3. QED. We argue that step 4,5,6 can be performed in O(t(n)) time. We assume that D is a single tape machine. If we keep the step counter of size log(t(n)/ log t(n)) = O(log t(n)); information about the state, head-position, and the transition table of M (all are of constant size), far away from the head position of D, the simulation cost will increase. So after every move of M, D will carry all these required information near its head position on a separate track. It costs O(log t(n)) time. So the simulation of t(n)/ log t(n) steps of M takes O(t(n)) steps of D. The tape of D has more than one track, (i) on the first track the content of M’s tape is present, (ii) on the second track the current state and state transition function of M is stored, (iii) the step counter is kept on the third track. The content of second and third tracks are to be kept closer to the head position of D on the first track. After every move, this information is to be shifted. The length of the content of track two is fixed for a particular M. So shifting this information requires fixed number of steps at every step of simulation of M. The length of the counter in track three is O(log t(n)) and all its bits are shifted by at most one cell after every move. It requirs O(log t(n)) moves. To prove that L(D) cannot be decided in o(t(n)/ log t(n)) time. We start with the as- sumption that there is a Turing machine M that decides L(D) in g(n)= o(t(n)/ log t(n)). D simulates M in time cg(n) steps (not considering the simulation step counter), where c is a constant. g(n) = o(t(n)/ log t(n)), so there is a n0 such that for all n>n0, cg(n) < t(n) log t(n). n So for input <M > 10 , n>n0, the simulation will come to completion and D’s decision will be opposite to M’s decision. So L(D) cannot be same as L(M) - a contradiction. Example 1. We prove a simpler statement: DTIME(n) ⊂ DTIME(n1.5). Consider the following Turing machine: D: input x 1. If x =< M10∗ >, then reject. 2. Simulates M on < M10∗ > for |x|1.4 steps of simulation. 3 3. If M does not halt on < M10∗ > within these steps, then reject. 4. If M accepts, then reject; if M rejects, then accept.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us