the turing machine
play

The Turing Machine Motivating idea Unsolvable Problems Build a - PDF document

The Turing Machine Motivating idea Unsolvable Problems Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical machine provides a means


  1. The Turing Machine • Motivating idea Unsolvable Problems – Build a theoretical a “human computer” – Likened to a human with a paper and pencil that can solve problems in an algorithmic way – The theoretical machine provides a means to determine: • If an algorithm or procedure exists for a given problem • What that algorithm or procedure looks like • How long would it take to run this algorithm or procedure. The Church-Turing Thesis (1936) Undecidability • Informally, a problem is called unsolvable • Any algorithmic procedure that can be or undecidable if there no algorithm exists carried out by a human or group of humans that solves the problem. can be carried out by some Turing • Algorithm Machine” – Implies a TM that computes a solution for the – Equating algorithm with running on a TM problem – Turing Machine is still a valid computational • Solves model for most modern computers. – Implies will always give an answer 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? 1

  2. 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? 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 probkem – 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. 2

  3. 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 that we know to be either solvable or • Given a Turing Machine M, does it accept 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. 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. The halting problem Reducing one language to another • Key facts: • Let’s consider a more general problem – If L 1 ≤ L 2 then about TMs. • If L 2 is recursive then L 1 is also recursive • If L 1 is not recursive then L 2 is not recursive. – Given a TM, M, and a string w, is w ∈ T(M)? – If P 1 and P 2 are decision problems with L 1 and L 2 the languages of “yes encodings” respectively and if L 1 ≤ L 2 then – We simply cannot just run the string on the TM • If P 2 is solvable then P 1 is also solvable since if w ∉ L(M), M might go into an infinite • If P 1 is unsolvable then P 2 is also unsolvable loop. 3

  4. The halting problem The halting problem • If L 1 ≤ L 2 then • The halting problem is unsolvable • If L 2 is recursive then L 1 is also recursive • If L 1 is not recursive then L 2 is not recursive. • Proof: – We can use an argument similar to that used to • Let’s show that Self-Accepting can be show that T u is not recursive. reduced to the halting problem. – Instead, let’s use reduction The halting problem The halting problem • Let’s show that Self-Accepting can be • Instance of SA = (T) an encoded TM, T reduced to the halting problem. • Instance of halt = (T’, w) an encoded TM T’ – For an encoding of an instance of SA, I, we can and encoded string w to run on the TM define a function • f(I) = I’ • We want T to accept e(T) iff T’ accepts w • Such that I’ is an encoding of an instance of Halt and • Let T’=T and w = e(T) • I will be self-accepting iff I’ halts. – f(x) = (x, e(x)) The halting problem The halting problem • We showed that L 1 ≤ L 2 where • f(x) = (x, e(x)) – L 1 is the set of encodings for “yes instances” of the self-accepting problem – If x is an encoding for a TM that self-accepts, – Then x will certainly accept e(x) as specified by f. – L 2 is the set of encodings for “yes instances” of the halting problem. – If x is not an encoding for a TM that self-accepts then either: – We know that the self-accepting problem is • x is a bogus encoding or unsolvable, thus, the halting problem is • x is an encoding for a TM that will not accept it’s own encoding. unsolvable. • In either case (x, e(x)) will not be in halt. 4

  5. The halting problem Reducing one language to another • Practical considerations: • Important observations – Since the halting problem is unsolvable, there is – Reduction operates on strings from languages no algorithm to determine: • Reducing encodings of different problems • Given a computer program – If L 1 ≤ L 2 then • Will this program always finish? • If L 2 is recursive then L 1 is also recursive – Alternately will it ever enter an infinite loop. • If L 1 is not recursive then L 2 is not recursive. – Questions? To show a problem is unsolvable Decision Problems • Find a problem known to be unsolvable • For recursively enumerable languages • Reduce this known unsolvable problem to 1. Is the language accepted by a TM empty? the problem you wish to show is 2. Is the language accepted by a TM finite? unsolvable. 3. Is the language accepted by a TM regular? 4. Is the language accepted by a TM context free? • Only need one to start the ball rolling 5. Is the language accepted by 1 TM a subset of – Self-accepting fits the bill. or equal to the language accepted by another? Rice’s Theorem Decision Problems • The Self-Accepting problem can be reduced • For recursively enumerable languages to each one of these decision problems. • All unsolvable. 1. Is the language accepted by a TM empty? • Rice’s Theorem 2. Is the language accepted by a TM finite? 3. Is the language accepted by a TM regular? – Every non-trivial property of recursively 4. Is the language accepted by a TM context free? enumerable languages is unsolvable. 5. Is the language accepted by 1 TM a subset of or equal • Where a non-trivial property is a property satisfied to the language accepted by another? by any non-null subset of the set of recursively enumerable languages. 5

Recommend


More recommend