1 / 13

Computing with Turing Machines

Computing with Turing Machines. Section 4.2 Mon, Nov 29, 2004. Function Evaluators. A Turing Machine may be viewed as a function evaluator. Let  0   – {  ,  }. Let w   0 * . The initial configuration is ( s ,   w ).

Download Presentation

Computing with Turing Machines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computing with Turing Machines Section 4.2 Mon, Nov 29, 2004

  2. Function Evaluators • A Turing Machine may be viewed as a function evaluator. • Let 0 – {, }. • Let w0*. • The initial configuration is (s, w). • When the Turing Machine halts, the configuration is (s, y), for some y 0*. • Then we write M(w) = y and say that Mcomputes a function f : 0*0* if M(w) = f(w) for all w0*.

  3. Recursive Functions • A function is called recursive if it can be computed by a Turing Machine. • This is not the same as a recursive function in C++.

  4. Examples • The TM INCR computes the function f(n) = n + 1. • The TM DECR computes the function f(n) = n – 1, if n > 0 and f(0) = 0. • Design a TM that computes the function f(n) = 2n. • Design a TM that computes the fucntion f(n) = 2n + 1. • Design a TM that computes the function f(w) = wwR.

  5. Language Acceptors • A Turing Machine may be viewed as a language acceptor. • Let 0 – {, }. • Let w0*. • The initial configuration is (s, w). • H = {y, n}. • If the final state is y (“yes”), then the input is accepted. • If the final state is n (“no”), then the input is rejected.

  6. Recursive Languages • Let L be a language. • A Turing Machine M decides L if it has the following property. • If w L, then M accepts w. • If wL, then M rejects w. • A language is decidable, or recursive, if there is a Turing Machine that decides it.

  7. Example • Let 0 = {a, b, c}. • Let L = {anbncn | n 0}. • The Turing Machine in Programming Assignment #3 will decide this language.

  8. Recursively Enumerable Languages • Let L 0* be a language. • A Turing Machine MsemidecidesL if • For every w0*, M halts on w if and only if wL. • A language is recursively enumerable if there is a Turing Machine that semidecides it.

  9. Example • Let 0 = {a, b}. • Let L = {w* | w contains at least one a}. • The Turing Machine Ra will semidecide L.

  10. Recursive and Recursively Enumerable Languages • Theorem: If L is recursive, then L is recursive enumerable. • Theorem: If L is recursive, then L′ is recursive. • Theorem: If L and L′ are recursively enumerable, then L is recursive.

  11. Language Generators • A Turing Machine may be viewed as a language generator. • The initial configuration is (s, ). • The Turing Machine writes a sequence of words on the tape, separated by blanks. • The Turing Machine runs forever (if the language is infinite). • Each word in the language appears exactly once on the tape.

  12. 0 COPY INCR Example • Design a Turing Machine that generates the binary representations of the set of nonnegative integers.

  13. 0 COPY SUCC Example • Let  = {0, 1}. • Design a TM SUCC to produce the lexicographical successor of the input string w *. • This is similar to INCR except that, e.g., the successor of 111 is 0000.

More Related