Presentation is loading. Please wait.

Presentation is loading. Please wait.

Russell’s Paradox and the Halting Problem Lecture 24 Section 5.4 Wed, Feb 23, 2005.

Similar presentations


Presentation on theme: "Russell’s Paradox and the Halting Problem Lecture 24 Section 5.4 Wed, Feb 23, 2005."— Presentation transcript:

1 Russell’s Paradox and the Halting Problem Lecture 24 Section 5.4 Wed, Feb 23, 2005

2 Trends Homework Trend 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% 1234 Assignment Average Grade

3 Russell’s Paradox Let A be any set that you have ever seen. Then, most likely, A  A. For example A set of integers is not itself an integer. A set of rectangles is not itself a rectangle. A set of points in the plane is not itself a point in the plane. Is it possible that A  A for some set A?

4 Russell’s Paradox Let S = {A | A  A}. Let P(x) be the predicate “x  x.” Is S  S? If S  S, then S satisfies the predicate. So P(S) is true. But P(S) says that S  S.

5 Russell’s Paradox If S  S, then S does not satisfy the predicate. So P(S) is false But that means that S  S. Therefore, “S  S” is neither true nor false. This is a paradox.

6 The Barber Paradox In a certain town, there is a barber who cuts the hair of every person (them and only them) in the town who does not cut his own hair. Question: who cuts the barber’s hair?

7 The Halting Problem Let P be a computer program, encoded in binary. Let I be input to the program, encoded in binary. We can “run P on I.” There are two possibilities P halts on I. P runs forever on I.

8 The Program P with Input I P I P halts on I P I P runs forever on I

9 The Halting Problem Does there exist a computer program that can read any computer program P and any input I, both in binary, and determine whether P will halt on I? Suppose there is such a program. Call it CheckHalt. When we run CheckHalt(P, I), it determines whether P halts on I.

10 The Program CheckHalt CheckHalt P, I P halts on I CheckHalt P, I P runs forever on I yesno

11 The Halting Problem Write a program called Test that will Read a program P in binary. Run CheckHalt(P, P). If CheckHalt reports that P halts on P, then Test goes into an infinite loop. P runs forever on P, then Test halts.

12 The Program Test CheckHalt P P, P Test yes noyes

13 The Halting Problem What happens when we run Test(Test)? If CheckHalt reports that Test halts on Test, then Test runs forever. Test runs forever on Test, then Test halts.

14 The Program Test CheckHalt Test Test, Test Test yes noyes

15 The Program Test CheckHalt Test Test, Test Test yes noyes

16 The Program Test CheckHalt Test Test, Test Test yes noyes If CheckHalt says Test halts on Test…

17 The Program Test CheckHalt Test Test, Test Test yes noyes …then Test runs forever on Test.

18 The Program Test CheckHalt Test Test, Test Test yes noyes If CheckHalt says Test runs forever on Test…

19 The Program Test CheckHalt Test Test, Test Test yes noyes …then Test halts on Test.

20 The Halting Problem Both possibilities are contradictions. Therefore, no such program CheckHalt exists. That is, it is impossible to write a program that has the ability to inspect any program and any input and determine whether the program will halt on that input.

21 The Halting Problem This does not mean that we can never tell whether a given program halts on a given input. It just says that we cannot always tell.

22 Other Undecidable Problems It is also impossible to write a program that has the ability to inspect any other program and determine whether it Halts on all inputs. Halts on input 0. Outputs 2x on input x (computes f(x) = 2x). Outputs 1 on input 0. These problems are called undecidable.

23 An Interesting “Theorem” Theorem: This theorem has no proof. Can you prove this theorem? Is this theorem true? If this theorem were false, then it would have a proof. But you can’t prove a false theorem. Therefore, it must be true. Doesn’t that constitute a proof?

24 The Berry Paradox Consider the set A of all positive integers that can be described using fifty English words or less. “one” “the square of eleven” “the millionth prime” “the millionth prime times the billionth prime, plus ten”

25 The Berry Paradox Let B = N – A. That is, B is the set of all positive integers that cannot be described using fifty English words or less. B is not empty. (Why?) What is the smallest number in B? It is called the Berry number, after G. G. Berry, an Oxford University librarian.

26 The Berry Paradox Whatever it is, it is “the smallest positive integer that cannot be described using fifty English words or less.” But that description uses less than 50 English words and it describes that number. See The Berry Paradox.The Berry Paradox


Download ppt "Russell’s Paradox and the Halting Problem Lecture 24 Section 5.4 Wed, Feb 23, 2005."

Similar presentations


Ads by Google