120 likes | 197 Views
CSE 105 Theory of Computation. Alexander Tsiatas Spring 2012. Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons Attribution- NonCommercial - ShareAlike 3.0 Unported License. Based on a work at http://peerinstruction4cs.org.
E N D
CSE 105Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at http://peerinstruction4cs.org. Permissions beyond the scope of this license may be available at http://peerinstruction4cs.org.
Alan Turing was a genius and all, but… Why do we careAbout Turing Machines?
Alan Turing was a genius and all, but… Why do we careabout Turing Machines? • All modern computers follow the Turing Machine model • CPU = TM control • Memory = TM tape • This division seems obvious now, but is the core of Turing’s model • Our memory isn’t infinite • Theoretical analysis of TMs answers the question: what kinds of problems could we solve (or can’t we solve), if we didn’t have to worry about memory limitations (sometimes with computing “cloud” it feels like we’re almost to that point!) • “Memory” can include all levels of the memory hierarchy (more about this in CSE 141): RAM, disk, etc
Church-Turing Thesis • Alonzo Church devised a λ-calculus definition of algorithms • Basis for programming languages like O’Caml • Alan Turing proposed a Turing Machine definition of algorithms • It is shown that these two independent approaches are equivalent in power
Another reason why we care about TM’s • Show that language L is decidable. • Translation: Show that it is possible to write a program that determines if a string is in L or not. • Give a TM that decides language L OR • Give a Java function (with no infinite loops!) or Python script public static booleanisAPowerOfTwo(String w) { inti = Integer.parseInt(w); … } The Java function is easier to do, no?
Another reason why we care about TM’s • Show that language L is NOT decidable. • PROVE that there is NO Java function or Python script (that always halts) that can decide if a string is in L or not. public booleandoesThisFunctionHalt(String w) { Function p = interpretAsFunction(w); … } • Could you do this? Could I do this…?
Proofs using TM’s • It is easier to prove theorems about Turing machines than Java programs because they are: • Less powerful • Less complicated • Both
Proofs using TM’s • We care about proving theorems about Turing machines because they are: • Equivalent to statements about Java programs • Required for CSE 105 • Both
AND NOW…. MORE TURING MACHINE CONSTRUCTION EXAMPLES!!!!!!111
L = {1n | n is a Fibonacci number} • I promised this on Tuesday, didn’t I?