Professional Documents
Culture Documents
C OMPUTATION
T URING M ACHINES
16 tq5 xxxt
17 q5 t xxxt
18 tq2 xxxt
Configurations for input 0000. 19 txq2 xxt
1 q1 0000t 6 tx0q5 xt 11 txq2 0xt 20 txxq2 xt
2 tq2 000t 7 txq5 0xt 12 txxq3 xt 21 txxxq2 t
3 txq3 00t 8 tq5 x0xt 13 txxxq3 t 22 txxx t qaccept
4 tx0q4 0t 9 q5 t x0xt 14 txxq5 xt
5 tx0xq3 t 10 tq2 x0xt 15 txq5 xxt
( L ECTURE 13) S LIDES FOR 15-453 S PRING 2011 4 / 32
E XAMPLE TM-3
A TM to add 1 to a binary number (with a 0 in front)
M = “On input w
1 Go to the right end of the input string
2 Move left as long as a 1 is seen, changing it to a 0.
3 Change the 0 to a 1, and halt.”
For example, to add 1 to w = 0110011
Change all the ending 1’s to 0’s ⇒ 0110000
Change the next 0 to a 1 ⇒ 0110100
Now let’s design a TM for this problem.
δ : Q × Γ = Q × Γ × {L, R, S}
δ : Q × Γk → Q × Γk × {L, R}k
δ : Q × Γ → Q × Γ × {L, R}
T HEOREM
Every nondeterministic Turing machine has an equivalent
deterministic Turing Machine.
P ROOF I DEA
Timeshare a deterministic TM to different branches of the
nondeterministic computation!
Try out all branches of the nondeterministic computation
until an accepting configuration is reached on one branch.
Otherwise the TM goes on forever.
On each copy, D
During simulation, D processes the simulates one of the
configurations of N in a breadth-first nondeterministic moves
fashion. of N.
Thus D needs to maintain a queue D places the resulting
of N’s configurations (Remember configurations to the
queues?) back of the queue.
( L ECTURE 13) S LIDES FOR 15-453 S PRING 2011 25 / 32
S TRUCTURE OF THE S IMULATING DTM
N is simulated with 2-tape DTM, D
Note that this is different from the construction in the book!
C OROLLARY
A language is Turing-recognizable if and only if some
nondeterministic TM recognizes it.
C OROLLARY
A language is decidable if and only of some nondeterministic
TM decides it.