1 / 12

CSE 105 Theory of Computation

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.

thanos
Download Presentation

CSE 105 Theory of Computation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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.

  2. Alan Turing was a genius and all, but… Why do we careAbout Turing Machines?

  3. 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

  4. 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

  5. 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?

  6. 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…?

  7. Proofs using TM’s • It is easier to prove theorems about Turing machines than Java programs because they are: • Less powerful • Less complicated • Both

  8. 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

  9. AND NOW…. MORE TURING MACHINE CONSTRUCTION EXAMPLES!!!!!!111

  10. L = {1n | n is a Fibonacci number} • I promised this on Tuesday, didn’t I?

  11. L = {w | w does NOT containtwice as many 0’s as 1’s}

  12. L = {1n | n is a prime number}

More Related