Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.

Similar presentations


Presentation on theme: "CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons."— Presentation transcript:

1 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. Permissions beyond the scope of this license may be available at http://peerinstruction4cs.org.

2 WHY DO WE CARE ABOUT TURING MACHINES? Alan Turing was a genius and all, but… 2

3 Why do we care about 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 3 Alan Turing was a genius and all, but…

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 boolean isAPowerOfTwo(String w) { int i = 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 boolean doesThisFunctionHalt(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: a)Less powerful b)Less complicated c)Both

8 Proofs using TM’s We care about proving theorems about Turing machines because they are: a)Equivalent to statements about Java programs b)Required for CSE 105 c)Both

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

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

11 L = {w | w does NOT contain twice as many 0’s as 1’s}

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


Download ppt "CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons."

Similar presentations


Ads by Google