The theorems we have which we will show is
Theorem: There exists a Turing Machine U such that for every x,α∈{0,1}∗ U(x,α)=Mα(x) where Mα denotes the turing machine represented by α. Moreover, if Mα halts on input x within T steps then U(x,α) halts within cTlogT steps where C is a number of independent of |x| and depending only on M′αs alphabet size, number of tapes and number of states
For this, we need some equivalency between some special Turing machine models
Theorem 1: For every f:{0,1}∗→{0,1} and time-constructible T:N→N if f is computable in time T(n) by a Turing Machine M using alphabet Γ then it is computable in time 4log|Γ|T(n) by a Turing Machine ˆM using the alphabet {▹,◻,0,1}
Theorem 2: Define a single-tape Turing machine to be a Turing Machine that has only one read-write tape, that is used as input, work tape, and output tape. For every f:{0,1}∗→{0,1} and time-constructible T:N→N if f is computable in time T(n) by a Turing Machine M using k tapes then it is computable in time 5kT2(n) by a single-tape Turing Machine ˆM.
Theorem 3: Define a bidirectional Turing machine to be a Turing Machine whose tapes are infinite in both directions. For every f:{0,1}∗→{0,1} and time-constructible T:N→N if f is computable in time T(n) by a bidirectional Turing Machine M using k tapes then it is computable in time 4T(n) by a standard Turing Machine ˆM.
Now coming back to the proof, we'll first proof a weaker version.
Weaker Version: CTlogT is replaced by CT2
Proof of Weaker Version: Our universal TM U is given an input (x,α), where α represents some TM M, and needs to output M(x). By Theorem 1 and Theorem 2, we may assume
- M has a single work tape (in addition to the input and output tape)
- M uses the alphabet {▹,◻,0,1}
Note that these transformations may introduce quadratic slowdown
The TM U uses the alphabet {▹,◻,0,1} and three work tapes in addition to its input and output tape. U uses its input tape, output tape, and one of the work tapes in the same way M uses its three tapes. In addition, U will use its first extra work tape to store the table of values of M 's transition function, and its other extra work tape to store the current state of M.
Simulation: To simulate one computational step of M,U scans the table of M 's transition function and the current state to find out the new state, symbols to be written, and head movements, which it then executes.
Now we will prove the actual theorem.
Proof of Actual Theorem: The general structure of U will be as in the case of CT2. U will use its input and output tape in the same way M does and will also have extra work tapes to store M 's transition table and current state and to encode the contents of M 's work tapes. The main obstacle we need to overcome is that we cannot use Theorem 2 to reduce the number of M 's work tapes to one
Let k be the number of tapes that M uses (apart from its input and output tapes) and Γ its alphabet. We may assume that U uses the alphabet Γk. Thus we can encode in each cell of U's main work tape k symbols of Γ, each corresponding to a symbol from one of M's tapes. This means that we can think of U's main work tape not as a single tape but rather as k parallel tapes; that is, we can think of U as having k tapes with the property that in each step all their read-write heads go in unison either one location to the left, one location to the right, or stay in place.
We still have to deal with the fact that M's k read-write heads can each move independently to the left or right, whereas U 's parallel tapes are forced to move together.
Idea: Since we can not move U′s read-write head in different directions at once we simply move parallel tapes ``under'' the head.
To simulate a single step of M, we shift all the nonblank symbols in each of these parallel tapes until the head's position in these parallel tapes corresponds to the heads' positions of M's k tapes. For example, if k=3 and in some particular step M's transition function specifies the movements L,R,R, then U will shift all the nonblank entries of its first parallel tape one cell to the right, and shift the nonblank entries of its second and third tapes one cell to the left. The above approach is still not good enough to get O(TlogT) time simulation. The reason is that there may be as many as T nonblank symbols in each parallel tape and so each shift operation may cast U as much as T operations per each step of M resulting Θ(T2) time simulation.
We will deal with this problem by encoding the information on the tapes in a way that allows us to amortize the work performing a shift.
Idea: We will ensure that we do not need to move all the nonblank symbols of the tape in each shift operation. Specifically, we will encode the information in a way that allows half of the shift operations to be performed using 2c steps, for some constant c, a quarter of them using 4c steps, and more generally 2−i fraction of the operations will take 2ic steps, leading to simulation in roughly cTlogT time.
Encoding M's tapes on M's tape:
We add a special kind of blank symbol ⊠ to the alphabet of M’s parallel tapes with the properties that this symbol is ignored in the simulation. For example, if M's tape contents are 010 then, this can be encoded as 0⊠10 or 0⊠⊠1⊠0 and so on or just 010.
For convenience, we think of U's parallel tapes as infinite in both the left and right directions by the Lemma. Thus we index their locations by 0,±1,±2,… Normally we keep U's head on location 0 of these parallel tapes. We will only move it temporarily to perform a shift when, following our general approach, we simulate a left hand movement by sifting the tape to the right and vice versa. At the end of the shift, we return the head to location 0.
We split each of U's parallel tapes into zones that we denote by R0, L0, R1, L1,… (We'll only need to go up to RlogT, LlogT since the turing machine runs for time T, it can at most access T cells of each tape.). The cell at location 0 is not at any zone. Zone R0 contains two cells immediately right of location 0 (i.e. location +1,+). Zone R1 contains the four cells +3,+4,+5,+6. Generally for every i≥1, Zone R1 contains the 2×2i cells that are right to the Ri−1 (i.e. locations 2i+1−1,…,2i+2−2). Similarly Zone L0 contains two cells indexed by −1 and −2 and generally Zone Li contains the cells −2i+2+2,…,−2i+1+1
Invariants: We shall always maintain the following invariants
- Each of the zones is either empty, full, or half-full with non-⊠-symbols. That is, the number of symbols in zone Ri that are not ⊠ is either 0, 2i, or 2×2i and the same holds for Li . (We treat the ordinary symbol ◻ the same as any other symbol in Γ, and in particular a zone full of ◻’s is considered full). We assume that initially all the zones are half-full. We can ensure this by filling half of each zone with ⊠ symbols in the first time we encounter it.
- The total number of non-⊠-symbols in Ri∪Li is 2×2i. That is, either Ri is empty and Li is full, or Ri is full and Li is empty, or they are both half-full.
- Location 0 always contains a non-⊠-symbol.
Performing a Shift: Now when performing the shifts, we do not always have to move the entire tape, but we can restrict ourselves to only using some of the zones.
We illustrate this by showing how U performs a left shift on the first of its parallel tapes
- U finds the smallest i0 such that Ri0 is not empty (Hence R0,R1,…,Ri0−1 are empty). Note that this is also the smallest i0 such that Li0 is not full. We call this number i0 the index of this particular shift.
- U puts the leftmost non-⊠-symbol of Ri0 in position 0. We now denote the new zones as Ri,Li. Now there are 2×2i0−1 non-⊠-symbols remain in Ri0 if Ri0 is full and otherwise 2i0−1 non-⊠-symbols remain in Ri0.
- Now if Ri0 was full before we shift the 2×2i0−1 to the R0,…,Ri0 each of the zones becomes half filled. In other words we shift the leftmost 2i0−1 non-⊠-symbols to the zones R0,…,Ri0−1 each of which becomes half filled because in total they take the space i0−1∑i=02×2i=2(2i0−1). And hence Ri0 also becomes half filled because 2i0 non-⊠-symbols remain in Ri0.
- If Ri0 was half-full before we shift the 2i0−1 non-⊠-symbols of Ri0 into the zones R0,…,Ri0−1 filling up exactly half of the symbols of each Ri zones where i∈{0,…,i0−1}. Now the zone Ri0 is empty.
- U performs symmetric operation to the left of position 0. That is for j starting from i0−1 down to 0, U literally moves the 2×2j symbols of Lj to fill the cells of Lj+1. Finally U moves the symbol originally in position 0 to L0.
- So if Ri0 was full before Li0 was empty and all L0,…,Li0−1 were full. After the shifting Lj contains all the 2×2j symbols of Lj−1. So Li0 becomes half filled. And since at each step Lj−1 was emptied to move all its content to Lj in the next step Lj−1 becomes half filled. Therefore all L0,…,Li0−1 are half filled.
- If Ri0 was half filled before Li0 was also half filled and all L0,…,Li0−1 were full. After the shifting Lj contains all the 2×2j symbols of Lj−1. So Li0 becomes full. And since at each step Lj−1 was emptied to move all its content to Lj in the next step Lj−1 becomes half filled. Therefore all L0,…,Li0−1 are half filled.
- At the end of the shift all of the zones R0,L0,R1,L1,…,Ri0−1,Li0−1 are half-full, Ri0 has 2i0 fewer non-⊠-symbols and Li0 has 2i0 additional non-⊠-symbols. Thus our invariants are maintained
Complexity Analysis: The total cost of performing a shift is proportional to the total size of all zones involved R0,L0,…,Ri0,Li0. That is O(i0∑j=02×2j)=O(2i0) operationsAfter performing a shift with index i the zones R0,L0,…,Ri−1,Li−1 are half-full which means it will take at least 2i−1 left shifts before the zones L0,…,Li−1 becomes empty or at least 2i−1−1 right shifts before the zones R0,…,Ri−1 becomes empty. Hence once we perform a shift with index i, the next 2i−1 shifts of that particular parallel tape will all have index less than i. This means that for every one of parallel tapes at most a 12i fraction of the total number of shifts have index i. Since we perform T shifts and the highest possible index is in the course of simulating T steps of M is O(llogT∑i=1T2i−12i)=O(TlogT)
Comments
Post a Comment