David Evans CS150: Computer Science University of Virginia Computer Science Lecture 26: Proving Uncomputability Visualization.

Slides:



Advertisements
Similar presentations
Cognitive Computing 2013 Consciousness and Computations 7. THE SELF APPLICABILITY PROBLEM (SAP); PENROSE ON UNDERSTANDING UNDERSTANDING Mark Bishop.
Advertisements

Formal Models of Computation Part III Computability & Complexity
Lecture 10: Context-Free Languages Contextually David Evans
Chapter 11: Models of Computation
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
5.9 + = 10 a)3.6 b)4.1 c)5.3 Question 1: Good Answer!! Well Done!! = 10 Question 1:
What computers just cannot do. (Part II) COS 116, Spring 2012 Adam Finkelstein.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 11: Parsimonious Parsing.
CS211 Problems: unsolvable, unfeasible and unsolved Topic 2: Halting problem.
Methods of Proofs October 20, A Good Proof State your plan Avoid excessive symbols Simplify as much as possible Good notation 2.
Complexity Analysis (Part II)
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Class 39: Universality cs1120 Fall 2009 David Evans University of Virginia.
David Evans CS200: Computer Science University of Virginia Computer Science Class 27: Modeling Computation.
October 13, 2009Theory of Computation Lecture 11: A Universal Program III 1 Coding Programs by Numbers Gödel numbers are usually very large, even for small.
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 39: Lambda Calculus.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
November 3, 2009Introduction to Cognitive Science Lecture 15: Theory of Computation II 1 Languages Accepted by Turing Machines Example 2: Language L =
Lecture 24: Gödel’s Proof CS150: Computer Science
Class 19: Undecidability in Theory and Practice David Evans cs302: Theory of Computation University of Virginia Computer.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
Introduction to Computer Science. A Quick Puzzle Well-Formed Formula  any formula that is structurally correct  may be meaningless Axiom  A statement.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
Class 37: Uncomputability David Evans University of Virginia cs1120 Halting Problems Hockey Team.
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
David Evans CS150: Computer Science University of Virginia Computer Science Computability.
David Evans University of Virginia cs1120 Fall Lecture 38: Modeling Computing.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Proof Strategies CS/APMA 202 Rosen section 3.1 Aaron Bloomfield.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 18: Think Globally, Mutate Locally.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 3: Rules of Evaluation.
Halting Problem Introduction to Computing Science and Programming I.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 36: Modeling Computing.
Halting Problem and TSP Wednesday, Week 8. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 25: Gödel and Computability Halting.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Module #7: Algorithmic Complexity Rosen 5 th ed., §2.3.
Russell’s Paradox and the Halting Problem Lecture 24 Section 5.4 Wed, Feb 23, 2005.
Powerpoint Templates Page 1 Powerpoint Templates Impossible Math Problems (or should we say, undecidable) Math Club 4/16/2012.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Recursively Enumerable and Recursive Languages
Lecture 3: Rules of Evaluation CS150: Computer Science
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 09a: PROOF STRATEGIES Section 3.1 Jarek Rossignac CS1050:
5-5 Indirect Proof. Indirect Reasoning: all possibilities are considered and then all but one are proved false. The remaining possibility must be true.
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: The Meaning of Truth.
CompSci Today’s Topics Computer Science Noncomputability Upcoming Special Topic: Enabled by Computer -- Decoding the Human Genome Reading Great.
THE HALTING PROBLEM - PROOF. Review  What makes a problem decidable?  3 properties of an efficient algorithm?  What is the meaning of “complete”, “mechanistic”,
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 5: Recursion Beware the Lizards!
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Introduction to Computing Science and Programming I
Recursively Enumerable and Recursive Languages
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Computable Problems.
CSE 311 Foundations of Computing I
Lecture 25: Metalinguistics > (meval '((lambda (x) (* x x)) 4)
Halting Problem.
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
Class 24: Computability Halting Problems Hockey Team Logo
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Class 26: Modeling Computing CS150: Computer Science
CSE 311: Foundations of Computing
Lecture 23: Computability CS200: Computer Science
Presentation transcript:

David Evans CS150: Computer Science University of Virginia Computer Science Lecture 26: Proving Uncomputability Visualization of E8E8

2 Lecture 26: Proving Computability The Halting Problem Input: a specification of a procedure P Output: If evaluating an application of P halts, output true. Otherwise, output false.

3 Lecture 26: Proving Computability halts? Examples > (halts? ‘(lambda () (+ 3 3))) #t > (halts? ‘(lambda () (define (f) (f)) (f))) #f > (halts? `(lambda () (define (fibo n) (if (or (= n 1) (- n 2))) 1 (+ (fibo (- n 1)) (fibo (- n 2)))))) (fibo 100)) #t

4 Lecture 26: Proving Computability Halting Examples > (halts? `(lambda () (define (sum-of-two-primes? n) ;;; try all possibilities... ) (define (test-goldbach n) (if (not (sum-of-two-primes? n)) #f ; Goldbach Conjecture wrong (test-goldbach (+ n 2)))) (test-goldbach 2)) ? Goldbach Conjecture (see GEB, p. 394): Every even integer can be written as the sum of two primes.

5 Lecture 26: Proving Computability Can we define halts? ? We could try for a really long time, get something to work for simple examples, but could we solve the problem – make it work for all possible inputs?

6 Lecture 26: Proving Computability Informal Proof (define (paradox) (if (halts? ‘paradox) (loop-forever) #t)) If paradox halts, the if test is true and it evaluates to (loop-forever) - it doesn’t halt! If paradox doesn’t halt, the if test if false, and it evaluates to #t. It halts!

7 Lecture 26: Proving Computability Proof by Contradiction 1.Show X is nonsensical. 2.Show that if you have A you can make X. 3.Therefore, A must not exist. X = paradox A = halts? algorithm

8 Lecture 26: Proving Computability How convincing is our Halting Problem proof? (define (paradox) (if (halts? ‘paradox) (loop-forever) #t)) If contradict-halts halts, the if test is true and it evaluates to (loop-forever) - it doesn’t halt! If contradict-halts doesn’t halt, the if test if false, and it evaluates to #t. It halts! This “proof” assumes Scheme exists and is consistent! Scheme is too complex to believe this...we need a simpler model of computation (in two weeks).

9 Lecture 26: Proving Computability Evaluates-to-3 Problem Input: A procedure specification P Output: true if evaluating (P ) would result in 3; false otherwise. Is “Evaluates to 3” computable?

10 Lecture 26: Proving Computability Proof by Contradiction 1.Show X is nonsensical. 2.Show that if you have A you can make X. 3.Therefore, A must not exist. X = halts? algorithm A = evaluates-to-3? algorithm

11 Lecture 26: Proving Computability Undecidability Proof Suppose we could define evaluates-to-3? that decides it. Then we could define halts?: (define (halts? P) (evaluates-to-3? ‘(lambda () (begin (P) 3)))) if #t: it evaluates to 3, so we know (P) must halt. if #f: the only way it could not evaluate to 3, is if (P) doesn’t halt. (Note: assumes (P) cannot produce an error.)

12 Lecture 26: Proving Computability Hello-World Problem Input: An expression specification E Output: true if evaluating E would print out “Hello World!”; false otherwise. Is the Hello-World Problem computable?

13 Lecture 26: Proving Computability Uncomputability Proof Suppose we could define prints-hello-world? that solves it. Then we could define halts?: (define (halts? P) (prints-hello-world? ‘(begin ((remove-prints P)) (print “Hello World!”))))

14 Lecture 26: Proving Computability Proof by Contradiction 1.Show X is nonsensical. 2.Show that if you have A you can make X. 3.Therefore, A must not exist. X = halts? algorithm A = prints-hello-world? algorithm

15 Lecture 26: Proving Computability Charge Next week: –Monday: computability of virus detection, AliG problem; history of Object-Oriented programming –Wednesday, Friday: implementing interpreters After next week: –Scheme is very complicated (requires more than 1 page to define) –To have a convincing proof, we need a simpler programming model in which we can write paradox: Turing’s model