Summary of Previous Class There are languages that are not decidable –(we have not proved this yet) Why not extend Turing machines just as we did with finite automata and pushdown automata? First Try: multi-tape Turing machines –More convenient than Turing machines –But multi-tape Turing machines can be simulated with Turing machines –Therefore, anything we can do with a multi-tape Turing machines can be done with Turing machines On the bright side we can use this to our advantage!
Second Try: Multi-Head Turing Machines Control We add a finite number of heads for the same tape … a1a1 a2a2 Tape head 1 … head 2 head n
ab Tape ab State: s Configuration in a 2-header Turing Machine: s+b+1 s+b+1+b+2 Equivalent configuration in a Turing Machine ab 11 ab 22 ee 33
Example: Proof that Palindromes is Decidable
Nondeterministic Turing Machines Definition. A Nondeterministic Turing machine is a 5-tuple (S, , , s, H), where: S is a set of states is an alphabet. It must contain and . It cannot contain or s S is the initial state H S is the set of halting states
Nondeterministic Turing Machine (II) is a collection of transitions defined by the relation: ((S-H) ) (S ( ( , })) such that: 1.For any q S – H, if ((q, ),(p, )) then = or = 2.There cannot be any p, q S and α – { } such that ((p, α),(q, )) (that is, cannot be added) The difference between nondeterministic Turing machines and Turing machines is that the latter requires to have one and only one transition of the form ((q, ),(_,_)) for every q S-H and
What does Nondeterministic Turing Machine Do? Reminder: When a word is accepted by a nondeterministic automata? Given an NFA, a string w *, is accepted by A if at least one of the configurations yielded by (s,w) is a configuration of the form (f,e) with f a favorable state (s,w) (p,w’) … (q,w’’) with w’’ e (s,w) (p,w’) … (q,e) with q F … (s,w) (p,w’) … (f,e) … We will do something similar for nondeterministic TMs
What does Nondeterministic Turing Machine Do? (2) Definition. A nondetermistic Turing machine NM semidecides a language L if: If w L then at least one possible computation of NM halts If w L then no computation of NM halts
Example of Nondeterministic TM Find a nondeterminstic TM semideciding the language a*ab*b Solution: C 0 = (s, aab) (p, aab) ∞ (q, aab) ∞ (q, aab) halt (f, aab) p q f a a b b Halt ML: Assumption: unspecified transitions will caused the Turing machine to run in an endless loop
Nondeterministic TMs can be Simulated by TMs Theorem. If a nondeterministic Turing machine, NM, semidecides a language L, then there is a Turing machine, M, semideciding L
Nondeterministic TMs can be Simulated by TMs Idea: C 0 = (s, hRS) C 11 C 12 C 13 … C 21 C 22 C 1n … … Simulate all computations in NM by computing them doing breadth-first order NM: C0C0 C 11 C 12 C 13 … C 1n C 21 C 22 … … If w L one of the C ij is a halting configuration: (h, …) which will also be found by M Let w = hRS M:M:
Context-Free Languages are Turing- Computable (Decidable) Let L be a context-free language Let A be a pushdown automata accepting L We simulate the pushdown automata A using a 2-tape nondeterministic Turing machine, M. The second tape is used for simulating the stack The header of the first tape points to the next character to be processed and the header of the second tape points to the last element (top of the stack)
Context-Free Languages are Turing- Computable (Decidable, II) For each transition ((q, , ), (q’, )) in A, we construct several transitions in M doing the following steps: 1.Check if the next substring is (one transition per character in , moving once the header of tape 1 to the right) 2.Check if the top of the stack is (one transition per character in, moving once the header of tape 2 to the left and putting blank character) 3.If 1 and 2 hold, “push” on tape 2
Possible Extensions of Turing Machines Turing Machines PhysicalComputational Adding several tapes Adding several heads Matrix Non determinism None of these extensions add computational power to the Turing Machines “no one can be told what the Matrix is, you have to see it for your self”