the turing machine
play

The Turing Machine Motivating idea Computability Build a - PDF document

The Turing Machine Motivating idea Computability 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


  1. The Turing Machine  Motivating idea Computability  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 Theory Hall of Fame (1936)  Alan Turing  Any algorithmic procedure that can be  1912 – 1954 carried out by a human or group of  b. London, England. humans can be carried out by some Turing Machine”  PhD – Princeton (1938)  Research  Equating algorithm with running on a TM  Cambridge and Manchester  Turing Machine is still a valid U. computational model for most modern  National Physical Lab, UK computers.  Creator of the Turing Test Theory Hall of Fame Undecidability  Alonso Church  Informally, a problem is called unsolvable or  1903 -- 1995 undecidable if there no algorithm exists that  b. Washington D.C. solves the problem.  Algorithm  PhD – Princeton (1927)  Implies a TM that computes a solution for the  Mathematics Prof (1927 – problem 1967)  Solves  Advisor to both Turing and  Implies will always give an answer Kleene 1

  2. Decision Problem Decision Problem  Let’s formalize this a bit  Running a decision problem on a TM.  A decision problem is a problem that has a  The problem must first be encoded yes/no answer  Example:  Is a given string x a palindrome (Is x ∈ pal?)  Example:  x is an instance of the problem  Is a given context free language empty?  Is a given string x a palindrome (Is x ∈ pal?)  Instance of a problem is a CFG…must be encoded.  Is a given context free language empty? Decision Problem Solvability  Running a decision problem on a TM.  In other words, a problem is solvable if  Once encoded, the encoded instance in provided the language of all of its encoded “yes” as input to a TM. instances is recursive.  The TM must then  Determine if the input is a valid encoding  There is a TM that recognizes the  Run, halt, language.  Place 1 on the tape if the answer for the input is yes  Place 0 on the tape if the answer for the input is no  If such a TM exists for a given decision problem, the problem is decidable or solvable. Otherwise the problem is called undecidable or unsolvable. Universal Language An unsolvable problem  L u corresponds to the “yes encodings”  Universal Language (L u ) of the decision problem:  Set of all strings w i such that w i ∈ L(M i )  All strings w that are accepted by the TM  Given a Turing Machine M, does it accept with w as it’s encoding. it’s own encoding. (Self-accepting)  All encodings for TMs that do accept their encoding when input  Since L u is not recursive, this problem is unsolvable.  We showed that L u is not recursive. 2

  3. Reducing one language to Reducing one language to another another  One method of showing whether a  Formally, given decision problem is unsolvable is  Let L 1 and L 2 be languages over Σ 1 and Σ 2 to convert the encoding of the problem  We say L 1 is reducible to L 2 if into another that we know to be either  There exists a Turning computable function solvable or unsolvable.  f: Σ 1 * → Σ 2 * such that  This is called reducing one language to  x ∈ L 1 iff f(x) ∈ L 2 another. Reducing one language to Reducing one language to another another  Informally,  We can take any encoded instance of one Instance problem Corresponding Conversion of P 1 TM  Use a TM to compute a corresponding encoded TM Instance of P 2 recognizing instance of another problem. L 2  If this other problem has a TM that recognizes the set of “yes encodings”, we can run that TM to solve the first problem. YES NO Reducing one language to The halting problem another  Key facts:  Let’s consider a more general problem about TMs.  If L 1 is reducible to L 2 then  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  Given a TM, M and a string w and L 2 the languages of “yes encodings”  Will M halt and accept on input w? respectively and if L 1 is reducible to L 2 then  If P 2 is solvable then P 1 is also solvable  We simply cannot just run the string on the TM  If P 1 is unsolvable then P 2 is also unsolvable since if w ∉ L(M), M might go into an infinite loop. 3

  4. To show a problem is The halting problem unsolvable  The halting problem is unsolvable  Find a problem known to be unsolvable  Reduce this known unsolvable problem to the problem you wish to show is  Proof: unsolvable.  We can use an argument similar to that used to show that L u is not recursive.  Instead, let’s use reduction  Only need one to start the ball rolling  Self-accepting fits the bill. Halting problem Halting problem  Reduce self-accepting to halting  Reduction  Self-accepting  Take an instance of SA and convert it to an instance of Halting  Turing Machine M  Does this Machine accept it’s own encoding  Such that a “yes” instance of SA results in a “yes” instance of halt  Halting  Turing Machine M M Reduction M, e(M)  String w machine  Does M halt and accept on input w Halt SA State entry problem Halting problem  Reduction  Given:  Assume Halting is solvable  Turing Machine M  A state q YES  A string w M Reduction M, e(M) Halt TM  Problem: machine Halt SA  Will M enter state q on input w.  The State Entry Problem is unsolvable. NO Then SA must be solvable…CONTRADICTION! 4

  5. State entry problem State entry problem  Reduce halting to state entry (SE).  Reduction  Halting  Take an instance of Halting (M 1 , w 1 ) and  Turing Machine M convert it to an instance of state-entry (M 2 ,  String w w 2 , q)  Does M halt and accept on input w  Such that a “yes” instance of halt results in a  State Entry “yes” instance of self-entry  Turing Machine M  From M 1 create M 2 such that M 1 halts iff M 2  String w enters state q.  State q  Does this Machine enter state q on input w. State entry problem State entry problem  Reduction  Reduction  M 1 will halt only there is no transition  Take an instance of Halting and convert it defined (e.g. δ (q i , a) ) to an instance of state entry  Take M 1, create a new state q.  Define new transition in M 2 for each undefined transition in M 1 so M 1 , w Reduction M 2 , w, q  (q i , a) = (q, a R) machine State-entry  If M 1 halts, M 2 will enter state q Halt Strings of same length problem State entry problem  Reduction  Given:  Assume State Entry is solvable  Turing Machine M  Problem: YES  Will M enter accept two strings of the same M 1 ,w Reduction M 2 , w, q length. State machine Entry TM State  The Same Length Problem is Halt Entry unsolvable. NO Then Halting must be solvable…CONTRADICTION! 5

  6. Same length problem Same length problem  Reduction  Reduce halting to same length.  Halting  Take an instance of Halting (M 1 , w 1 ) and convert it to an instance of state-entry  Turing Machine M  String w (M w )  Does M halt and accept on input w  Such that a “yes” instance of halt results in a  State Entry “yes” instance of same length  Turing Machine M  From M 1 create M w such that M 1 halts on w iff M w accepts string of same length  Does this Machine accept 2 strings of the same length. Same length problem Same length problem  Reduction  (q i , a) will force M w to accept “a” and “b”  We can certainly create TMs that accept “a” and  M 1 will halt only there is no transition “b”. defined (e.g. δ (q i , a) )  M w will do the following:  Define new transition in M w for each  Copy w onto it’s tape (after the input)  Place the tape head at the start of w undefined transition in M 1 so  Simulate M 1  (q i , a) will force M 2 to accept a and b  For all halting configurations, transition back to the start of the input (where you can accept both “a” and “b”).  If M 1 halts on w, M w accept “a” and  You will only get back to the start of input of M w if M 1 “b” (strings of same length) halts on input w. Same length problem Same length problem  Reduction  Reduction  Take an instance of Halting and convert it  Assume Same length is solvable to an instance of same length YES M 1 ,w Reduction M w Same machine Length Same M 1 , w Reduction M w Halt TM length machine Same length Halt NO Then Halting must be solvable…CONTRADICTION! 6

Recommend


More recommend