730 likes | 872 Views
Erik Jonsson School of Engineering and Computer Science. CS 4384 – 0 01. Automata Theory. http://www.utdallas.edu/~pervin. Tuesday : Chapters Five & Six. Thursday 4-24-14. FEARLESS Engineering. Turing Machines. Effective Computability.
E N D
Erik Jonsson School of Engineering and Computer Science CS 4384– 001 Automata Theory http://www.utdallas.edu/~pervin Tuesday: Chapters Five & Six Thursday4-24-14 FEARLESS Engineering
Turing Machines Effective Computability
Construct a Turing Machine that accepts the language of equal numbers of a’s and b’s. If you use JFLAP, you will have to assume the input is on an two-way infinite tape with the head started on the left-most character of the input and you are in the “initial” state. In addition, when you finish, you should be in a “final” state from which there are no moves with the input unchanged from the initial values. Homework 16 – due 4/22 Required is a detailed TM, not an "informal" description.
Homework 17 – due 4/24 Construct (in informal language) a Turing Machine that calculates the function f(x) = 2x using our unary notation. The machine should start with #11…1# on the tape (x+1 ones) with the head over the left #. It should halt with #11…1# on the tape (2*x + 1 ones) with the head over the left #. You may also submit a working Turing Machine from JFLAP
Uncomputable Functions Infinities
The Two Types of Languages Recursively Enumerable and Recursive
Let M be a Turing Machine • Question: Is L(M) r.e.? • Answer: Yes, by definition it is! • Question: Is L(M) recursive? • Answer: Don’t know – not enough info • Question: Is L(M) in r.e. – r? • Answer: Don’t know – not enough info
Let M be a TM that halts on all inputs: • Question: Is L(M) recursively enumerable? • Answer: Yes! By definition it is! • Question: Is L(M) recursive? • Answer: Yes! By definition it is! • Question: Is L(M) in r.e – r? • Answer: No! It can’t be. Since M always halts, L(M) is recursive.
Let M be a TM. • As noted previously, L(M) is recursively enumerable, but may or may not be recursive. • Question: Suppose that L(M) is recursive. Does that mean that M always halts? • Answer: Not necessarily. However, some TM M’ must exist such that L(M’) = L(M) and M’ always halts. • Question: Suppose that L(M) is in r.e. – r. Does M always halt? • Answer: No! If it did then L(M) would be recursive and therefore not in r.e. – r.
Let M be a TM, and suppose that M loops forever on some string x. • Question: Is L(M) recursively enumerable? • Answer: Yes! By definition it is. • Question: Is L(M) recursive? • Answer: Don’t know. Although M doesn’t always halt, some other TM M’ may exist such that L(M’) = L(M) and M’ always halts. • Question: Is L(M) in r.e. – r? • Answer: Don’t know. May be another M’ will halt on x, and on all strings! We just do not know!
The Halting Problem The easy way
The Halting Problem The hard way
abaaabaaaabaaabaaabaaaabaaabaabababa Reverse Engineering