80 likes | 181 Views
Nondeterministic TMs. Definition of NTMs. Must change transition function: : Q x 2 (Q x x {L, R}). Language of an NTM. String accepted if it’s possible to reach accepting configuration Set of computations – Computation Tree. Deciding a Language.
E N D
Definition of NTMs • Must change transition function: • : Q x 2(Q x x {L, R})
Language of an NTM • String accepted if it’s possible to reach accepting configuration • Set of computations – Computation Tree
Deciding a Language • Accept – The computation tree contains an accepting configuration. • Reject – All leaves in the computation tree are rejecting configurations. • Loop – The computation tree contains no accepting configuration and there exists an infinitely long path in the tree.
Equivalence of NTMs and TMs For a language L • NTMM s.t. L = L(M) TMM’ s.t. L = L(M’) • NTMM that decides L TMM’ that decides L
Simulating NTM with TM • Let M = (Q, , , , q0, , F) be any NTM • Will create TM M = (Q, , , , q0, , F) • On input w *, M creates computation tree for M • By simulating M‘s moves.
TM Simulating NTM 1 2...n Input NTM transitions ((q,),{(q1,1,D1), (q2,2,D2), ... , (qk,k,Dk)})... Finite Control (States) Queue of configs q01 2...n$1 q12 ... n$ ... Scratch
Pseudocode Step 1: Put M‘s state transitions on tape 2 Step 2: Put start configuration on tape 3 (q0 followed by copy of tape 1) Step 3: Create computation tree