Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Hein 731

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

13.

1 Turing Machines 707

powerful than determinism for pushdown automata. But we've also seen that
the two ideas are equal in power for finite automata.
For Turing machines we don't get any more power by allowing nondeter-
minism. In other words, we have the following result:

If a nondeterministic Turing machine accepts a language L, then (13.1)


there is a deterministic Turing machine that also accepts L.

We'll give an informal idea of the proof. Suppose N is a nondeterministic


Turing machine that accepts language L. We define a deterministic Turing
machine D that simulates the execution of N by exhaustively executing all
possible paths caused by A^s nondeterminism. But since N might very well
have an input that leads to an infinite computation, we must be careful in the
way D simulates the actions of AT. First D simulates all possible computations
of AT that take one step. Next D simulates all possible computations of AT that
take two steps. This process continues, with three steps, four steps, and so on.
If during this process D simulates the action of AT entering the Halt state, then
D enters its Halt state. So N halts on an input string if and only if D halts on
the same input string.
The problem is to write D so that it does all these wonderful things in a
deterministic manner. The usual approach is to define D as a three-tape
machine. One tape holds a permanent copy of the input string for N. The
second tape keeps track of the next computation sequence and the number of
steps of AT that must be simulated by D. The third tape is used repeatedly by
D to simulate the computation sequences for N that are specified on the
second tape.
The computation sequences on the second tape are the interesting part of
D. Since N is nondeterministic, there may be more than one instruction of the
form (state, input, ?, ?, ?>. Let m be the maximum number of instructions for
any (state, input) pair. For purposes of illustration, suppose m = 3. Then for
any (state, input) pair there are no more than three instructions of the form
(state, input, ?, ?, ?>, and we can number them 1, 2, and 3. If some (state,
input) pair doesn't have three nondeterministic instructions, then we'll
simply write down extra copies of one instruction to make the total three. This
gives us exactly three choices for each (state, input) pair. For convenience
we'll use the letters a, b, and c rather than 1,2, and 3.
Each simulation by D will be guided by a string over {a, b,c} that is sitting
on the second tape. For example, the string ccab tells D to simulate four steps
of AT because length(cca&) = 4. For the first simulation step we pick the third
of the possible instructions because ccab starts with c. For the second
simulation step we also pick the third of the possible instructions because the
second letter of ccab is c. The third letter of ccab is a, which says that the third
simulation step should choose the first of the possible instructions. And the

You might also like