Reminder • Final exam Solvability – The date for the Final has been decided: – Saturday, November 16 th – 12:30pm – 2:30pm – 07 – 1420 Homework The Turing Machine • Homework #8 (The Final Homework) – Due Nov • Motivating idea 11 – Build a theoretical a “human computer” – From textbook – Likened to a human with a paper and pencil that can solve problems in an algorithmic way • 9.7 • 9.8 – The theoretical machine provides a means to determine: • 9.15a • If an algorithm or procedure exists for a given problem • 10.16 (use grammar in Example 10.3) • What that algorithm or procedure looks like • Likes / Dislikes • How long would it take to run this algorithm or procedure. – A. What topic did you enjoy the most – B. What topic did you enjoy the least Theory Hall of Fame The Church-Turing Thesis (1936) • Alan Turing • Any algorithmic procedure that can be – 1912 – 1954 carried out by a human or group of humans – b. London, England. can be carried out by some Turing Machine” – PhD – Princeton (1938) – Research – Equating algorithm with running on a TM • Cambridge and Manchester U. – Turing Machine is still a valid computational • National Physical Lab, UK model for most modern computers. – Creator of the Turing Test 1
Theory Hall of Fame Undecidability • Kurt Godel • Informally, a problem is called unsolvable or undecidable if there no algorithm exists – 1906 -- 1978 – b. Brünn, Austria-Hungary that solves the problem. • Algorithm – PhD – University of Vienna – Implies a TM that computes a solution for the (1929) problem – Research • Princeton University • Solves – Implies will always give an answer – Godel’s Incompleteness Theorem Decision Problem Decision Problems • Let’s formalize this a bit • For regular languages – A decision problem is a problem that has a 1. Is the language empty? yes/no answer 2. Is the language finite? 3. Is a given string in the language? 4. Given 2 languages, are there strings that are in both? – Example: 5. Is the language a subset of another regular language? • Is a given string x a palindrome (Is x ∈ pal?) 6. Is the language the same as another regular language? • Is a given context free language empty? Decision Problems Decision Problems • For Context Free Languages • For recursively enumerable languages 1. Is a given string in the language? 1. Is the language accepted by a TM empty? 2. Is the language empty? 2. Is the language accepted by a TM finite? 3. Is the language finite? 3. Is the language accepted by a TM regular? 4. Is the language accepted by a TM context free? 5. Is the language accepted by 1 TM a subset of or equal to the language accepted by another? 2
Decision Problem Decision Problem • Running a decision problem on a TM. • Running a decision problem on a TM. – Once encoded, the encoded instance in provided as – The problem must first be encoded input to a TM. – Example: – The TM must then • Is a given string x a palindrome (Is x ∈ pal?) • Determine if the input is a valid encoding • Run, halt, – x is an instance of the problem – Place 1 on the tape if the answer for the input is yes • Is a given context free language empty? – Place 0 on the tape if the answer for the input is no – Instance of a problem is a CFG…must be encoded. – If such a TM exists for a given decision problem, the problem is decidable or solvable. Otherwise the problem is called undecidable or unsolvable. Solvability Universal Language • In other words, a problem is solvable if the • Universal Language (L u ) language of all of its encoded “yes” – Set of all strings w i such that w i ∈ L(M i ) instances is recursive. – All strings w that are accepted by the TM with w as it’s encoding. – There is a TM that recognizes the language. – All encodings for TMs that do accept their encoding when input • We showed that L u is not recursive. An unsolvable problem Reducing one language to another • L u corresponds to the “yes encodings” of • One method of showing whether a given the decision problem: decision problem is unsolvable is to convert the encoding of the problem into another • Given a Turing Machine M, does it accept that we know to be either solvable or it’s own encoding. (Self-accepting) unsolvable. • This is called reducing one language to • Since L u is not recursive, this problem is another. unsolvable. 3
Reducing one language to another Reducing one language to another • Formally, • Informally, – Let L 1 and L 2 be languages over Σ 1 and Σ 2 – We can take any encoded instance of one problem – We say L 1 is reducible to L 2 (L 1 ≤ L 2 ) if • Use a TM to compute a corresponding encoded • There exists a Turning computable function instance of another problem. * → Σ 2 * such that • f: Σ 1 • If this other problem has a TM that recognizes the set of “yes encodings”, we can run that TM to solve • x ∈ L 1 iff f(x) ∈ L 2 the first problem. Reducing one language to another Reducing one language to another • Key facts: – If L 1 ≤ L 2 then Instance • If L 2 is recursive then L 1 is also recursive Corresponding Conversion of P 1 TM • If L 1 is not recursive then L 2 is not recursive. TM Instance of P 1 recognizing – If P 1 and P 2 are decision problems with L 1 and L 2 L 2 the languages of “yes encodings” respectively and if L 1 ≤ L 2 then • If P 2 is solvable then P 1 is also solvable • If P 1 is unsolvable then P 2 is also unsolvable YES NO The halting problem The halting problem • Let’s consider a more general problem about TMs. • The halting problem is unsolvable – Given a TM, M, and a string w, is w ∈ T(M)? • Proof: – Given a TM, M and a string w – We can use an argument similar to that used to • Will M halt on input w? show that T u is not recursive. – We simply cannot just run the string on the TM since if – Instead, let’s use reduction w ∉ L(M), M might go into an infinite loop. 4
The halting problem The halting problem • If L 1 ≤ L 2 then • Let’s show that Self-Accepting can be reduced to the halting problem. • If L 2 is recursive then L 1 is also recursive • If L 1 is not recursive then L 2 is not recursive. – For an encoding of an instance of SA, I, we can define a function • f(I) = I’ • Let’s show that Self-Accepting can be • Such that I’ is an encoding of an instance of Halt reduced to the halting problem. and • I will be self-accepting iff I’ halts. The halting problem The halting problem • f(x) = (x, e(x)) • Instance of SA = (T) an encoded TM, T • Instance of halt = (T’, w) an encoded TM T’ – If x is an encoding for a TM that self-accepts, and encoded string w to run on the TM – Then x will certainly accept e(x) as specified by f. – If x is not an encoding for a TM that self-accepts then • We want T to accept e(T) iff T’ accepts w either: • Let T’=T and w = e(T) • x is a bogus encoding or • x is an encoding for a TM that will not accept it’s own – f(x) = (x, e(x)) encoding. • In either case (x, e(x)) will not be in halt. The halting problem The halting problem • We showed that L 1 ≤ L 2 where • Practical considerations: – L 1 is the set of encodings for “yes instances” of – Since the halting problem is unsolvable, there is the self-accepting problem no algorithm to determine: – L 2 is the set of encodings for “yes instances” of • Given a computer program the halting problem. • Will this program always finish? – Alternately will it ever enter an infinite loop. – We know that the self-accepting problem is unsolvable, thus, the halting problem is unsolvable. 5
To show a problem is unsolvable Reducing one language to another • Important observations • Find a problem known to be unsolvable – Reduction operates on strings from languages • Reduce this known unsolvable problem to • Reducing encodings of different problems the problem you wish to show is – If L 1 ≤ L 2 then unsolvable. • If L 2 is recursive then L 1 is also recursive • If L 1 is not recursive then L 2 is not recursive. • Only need one to start the ball rolling – Self-accepting fits the bill. – Questions? Good time for a break Decision Problems Rice’s Theorem • The Self-Accepting problem can be reduced • For recursively enumerable languages to each one of these decision problems. 1. Is the language accepted by a TM empty? 2. Is the language accepted by a TM finite? • Rice’s Theorem 3. Is the language accepted by a TM regular? – Every non-trivial property of recursively 4. Is the language accepted by a TM context enumerable languages is unsolvable. free? • Where a non-trivial property is a property satisfied 5. Is the language accepted by 1 TM a subset of by any non-null subset of the set of recursively or equal to the language accepted by another? enumerable languages. Theory Hall of Fame Decision Problems • Alan Turing • For recursively enumerable languages – 1912 – 1954 • All unsolvable. – b. London, England. 1. Is the language accepted by a TM empty? 2. Is the language accepted by a TM finite? – PhD – Princeton (1938) 3. Is the language accepted by a TM regular? – Research 4. Is the language accepted by a TM context free? • Cambridge and Manchester U. • National Physical Lab, UK 5. Is the language accepted by 1 TM a subset of or equal to the language accepted by another? – Creator of the Turing Test 6
Recommend
More recommend