Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing with Turing Machines

Similar presentations


Presentation on theme: "Computing with Turing Machines"— 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 M computes 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. 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 M semidecides L 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 Example Design a Turing Machine that generates the binary representations of the set of nonnegative integers. COPY INCR

13 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. COPY SUCC


Download ppt "Computing with Turing Machines"

Similar presentations


Ads by Google