Ñòóäîïåäèÿ
rus | ua | other

Home Random lecture






Text 4. Sublinear Time Bounds (770 characters) Martin Tompa


Date: 2015-10-07; view: 409.


The extension to sublinear space bounds suggests doing the same for time bounds. One might argue that any interesting Turing machine cannot have a sublinear time bound, as it takes at least n steps just to read the input. However, this argument fails for nondeterministic or alternating Turing machines, provided they are given random access to the input tape rather than sequential access. Consider, for instance, the language that consists of all strings that contain a 1. A nondeterministic machine could guess and record the position of the 1 in time O(log n), and use its supposed random access to the input to verify that there is a 1 in that position. This idea of random access or indexing is formalized in the following definition.

Definition 2.13: An indexing Turing machine has an input tape with no head, and a special «index tape» in addition to its other worktapes. The next move depends on the I th input symbol if the nonblank portion of the index tape to the left of the head is the binary encoding of i for 1 ≤ i n, and depends on the endmarker symbol otherwise. The length of the nonblank portion of the index tape is included in the machine's space bound.

Convention 2.14: Unless explicitly stated otherwise, we will assume from now on that all deterministic and nondeterministic Turing machines are not indexing machines, but that all other alternating Turing machines are.

Example 2.15: An indexing nondeterministic Turing machine can calculate the length n of the input as follows. On the index tape guess n one bit at a time, verify that the nth input symbol is in the input alphabet, and verify that the (n + l) st symbol is an endmarker, rejecting if either of these is not the case. It takes time O(log n) to do this.

Example 2.16: The complement of the language L = {ωω │ ω ª {0,1}*} from Example 2.12 can be accepted by an indexing nondeterministic Turing machine in time O(log n). Compute the length n of the input as in Example 2.15. If n is odd, accept. Otherwise, guess i satisfying 1 ≤ i ≤ n/2, and accept if and only if xixi+n/2, where x1x2... xn is the input. The sum i + n/2 and the other computations necessary can be calculated in time O(log n).

Any nondeterministic Turing machine requires time at least n to accept the language L from Example 2.16, but it only takes an alternating Turing machine time O(log n) to do the same. These are both left as simple exercises. Here is an example of a slightly more interesting language that can be accepted by an alternating Turing machine in O(log n) time:

Example 2.17: Let L be the set of strings A#B that are encodings of two equal sets (which we will also refer to as A and B). More specifically, A = A0$A1$... $Aa and  = B0$B1$ ... $Bb, where for simplicity Ai, Bi ª {0, 1}m for some m = 2P - 1.

The alternating Turing machine first determines n, m, a, b, and h where h is the index of the marker #, in a manner similar to that of Example 2.15. The goal is to accept if and only if À Ñ Â and Â Ñ A.

The machine will universally check each of these two conjuncts. Here is how it checks the first, the second being done in an analogous manner:

Universally choose and record i, with 0 ≤ ia.

Existentially choose and record j, with 0 ≤ jb.

Universally choose and record k, with 1 ≤ km.

Accept if and only if Ai,k = Bj,k, where these are the kth bits of Ai and Bj, respectively.

The machine requires time O(log a) to universally choose i, time O(log b) to existentially choose j, and time O(log m) to universally choose k; furthermore, a, b, and m are each at most n. To find Bj,k in step 4, the alternating Turing machine needs to calculate h + j2p + k on its index tape, which can be done in O(log n) time.

Alternating Turing machines, and particularly indexing alternating Turing machines, may seem unmotivated at first, but there is a direct correspondence to Boolean circuits (Ruzzo [39]) that makes them an excellent model of parallel computations; this will be explored further in Section 7.5. Furthermore, they will turn out to be extremely helpful in understanding the complexity of natural problems, much as nondeterministic Turing machines have proven to be.

 



<== previous lecture | next lecture ==>
Biskup M, Chayes L. and Kotecky R. | Learn to read math symbols
lektsiopedia.org - 2013 ãîä. | Page generation: 0.002 s.