Presentation is loading. Please wait.

Presentation is loading. Please wait.

Slide 1 of No. Insert Unit Name Here Lecture L: Computability Unit L1: What is Computation?

Similar presentations


Presentation on theme: "Slide 1 of No. Insert Unit Name Here Lecture L: Computability Unit L1: What is Computation?"— Presentation transcript:

1 Slide 1 of No. Insert Unit Name Here Lecture L: Computability Unit L1: What is Computation?

2 Slide 2 of No. Insert Unit Name Here Physical Computation

3 Slide 3 of No. Insert Unit Name Here Mathematically defined computation f(x,0) = 1 f(x,y) = g(y,f(x,y-1)) g(z,0) = 0 g(z,w) = h(w,g(z,w-1)) h(r,0) = r h(r,s) = h(r,s-1)+1 public class PrintPrimes { public static void main(String[] args){ for(j = 2; j < 1000; j++) if (isPrime(j)) System.out.println(j); } private static boolean isPrime(int n) { for(int j=2; j < n; j++) if (n%j == 0) return false; return true; }

4 Slide 4 of No. Insert Unit Name Here Turing Machines 0 0 1 1 a a b b z z 0, R, b 1, L, b 0, L, a 1, L, g 0, L, a 1, R, x a a b b z z e e

5 Slide 5 of No. Insert Unit Name Here Turing Machine for adding 1 a a b b 0 0 1 1 1, _, b 0, L, a 1, _, b 0, _, b start halt

6 Slide 6 of No. Insert Unit Name Here Universal Computers Theoretical version: there exists a single Universal Turing Machine that can simulate all other Turing machines  The input will be a coding of another machine + an input to the other machine Hardware version: stored program computer Software version: interpreter /** * Runs the first method in the Java class that is given in * “program” on the parameter given in “input”. Returns * the value returned by the method. The method must be * static, accept a single String parameter, and return a * String value. */ static String simulate(String program, String input){ … }

7 Slide 7 of No. Insert Unit Name Here The Church-Turing Hypothesis Everything computable is computable by a Turing machine  Physical interpretation  Conceptual interpretation  Definition of Computation  Everything computable is computable by a Java program  All “good enough” computers are equivalent

8 Slide 8 of No. Insert Unit Name Here CTH: The Modern Version Everything efficiently computable is computable efficiently by a randomized Turing machine  “Efficiently”: in “polynomial time”. Running time is for some constant c.  “Randomized”: allow to “flip coins” – use randomization  All “good enough” computers are equivalent -- even if you worry about efficiency

9 Slide 9 of No. Insert Unit Name Here CTH and Chaos The physical world is analog When we simulate it on a digital device we use a given precision  Input and output are given in finite precision  How many bits of precision do we need?  How much can error in the input affect the output?  Normally: a little  Chaotic systems: a lot When we simulate a digital device on an analog device we can encode many bits in one analog signal  Limits to precision of analog systems: atoms, quantum effects  Hard to think of a physical signal of even 64 bits of precision

10 Slide 10 of No. Insert Unit Name Here CTH and Quantum Physics Only known challenge to the “modern” version of CTH We do not know how to simulate quantum mechanical systems efficiently The quantum “probability amplitudes” are different from normal probabilities Maybe “quantum computers” can efficiently do more than normal randomized computers  Efficient “quantum algorithm” for factoring is known Can quantum computers be built?  Existing physics? New physical laws? Technology? Can quantum computers be simulated efficiently on a randomized Turing machines?

11 Slide 11 of No. Insert Unit Name Here CTH and the Brain Is the brain just a computer? Metaphysics: The mind-body problem  Monism: everything is matter -- including humans  Dualism: there is more (“soul”, “mind”, “consciousness” …) Technical differences  Parallel, complicated, analog, …  Still equivalent to a Turing Machine

12 Slide 12 of No. Insert Unit Name Here The Brain vs. a Pentium There are 10^9 -- 10^10 neurons in the brain Each neuron receives input from 10^3 -- 10^4 synapses Each neuron can fire about 1 -- 10^2 times/sec Total computing power is 10^9 -- 10^16 ops/sec Pentium III computing power = 10^8 ops/sec

13 Slide 13 of No. Insert Unit Name Here AI Why can’t we program computers to do what humans easily do?  Recognize faces  Understand human language Processing power? Software?  Scruffy vs. Neat debate

14 Slide 14 of No. Insert Unit Name Here The Turing Test

15 Slide 15 of No. Insert Unit Name Here Lecture L: Computability Unit L2: The limits of computation and mathematics

16 Slide 16 of No. Insert Unit Name Here The Halting problem program must be a Java class. The method that is run is the first one in the class and must be of the form static boolean XXXX(String input) /** * Return True if the program finishes * running when given the input as its * parameter. Return false if it gets into * an infinite loop. */ static boolean halt(String program, String input){ // fill in – can you do it? }

17 Slide 17 of No. Insert Unit Name Here Diagonalization static boolean autoHalt(String program){ return halt(program, program); } static boolean paradox(String program){ if autoHalt(program) while(true) ; // do nothing else return true; }

18 Slide 18 of No. Insert Unit Name Here The Halting problem cannot be solved Will paradox halt when running on its own code?  Yes ==> autoHalt(paradoxString) returns true ==> No  No ==> autoHalt(paradoxString) returns false ==> Yes Contradiction. Hence the assumption that halt(program, input) exists is wrong. Theorem: the halt method can not be written. String paradoxString = “class Test {\n” + “ static boolean paradox(String program){\n” + … “ static boolean halt(String program, String input){\n” + … Boolean answer = Test.paradox(paradoxString);

19 Slide 19 of No. Insert Unit Name Here Diophantine Equations Fact: It is possible to write compileToEquations above Theorem: There does not exist any program that can solve diophantine equations Proof: If there was, we could write the halt method. /** * Produce a set of diophantine equations that have a * solution if the given program halts on the given input. */ static String compileToEquations(String prog, String inp) { … }

20 Slide 20 of No. Insert Unit Name Here Formal Proofs Theorem:  Proof:         QED Axiom Follows from previous lines

21 Slide 21 of No. Insert Unit Name Here Axiomatic System A syntactic way to show semantic mathematical truths Axioms + Deduction rules (logic) Must be effective  trivial to determine if a proof is correct Must be sound  Anything you prove must be true Can it be complete?  Prove all true statements

22 Slide 22 of No. Insert Unit Name Here Zermelo-Fraenkel Set Theory The basis of all mathematics (one possibility) Effective Sound, we think Anything you prove in Math courses really uses ZFC The details are not important, yet we will prove: Theorem: ZFC is not complete

23 Slide 23 of No. Insert Unit Name Here Proof Checking /** * Checks whether the proof is a valid proof of the * theorem using ZFC axioms. */ Static boolean isProof(String theorem, String proof){ … // check line by line }

24 Slide 24 of No. Insert Unit Name Here Computation theory is part of mathematics /** * Returns a formal mathematical statement that says * that the program halts on the given input */ static String formalHalt(String program, String input){ … } /** * Returns a formal mathematical statement that says * that the program does not halt on the given input */ static String formalNoHalt(String program, String input){ … }

25 Slide 25 of No. Insert Unit Name Here Godel’s incompleteness theorem static boolean halt(String program, String input){ String thmYes = formalHalt(program, input); String thmNO = formalNoHalt(program, input); StringEnumerator e = new AllStringsEnumeration(); while(true) { String proof = e.getNext(); if isProof(thmYes, proof) return true; if isProof(thmNo, proof) return false; } Theorem: ZFC is not complete


Download ppt "Slide 1 of No. Insert Unit Name Here Lecture L: Computability Unit L1: What is Computation?"

Similar presentations


Ads by Google