1 / 26

Russell’s Paradox and the Halting Problem

Russell’s Paradox and the Halting Problem. Lecture 24 Section 5.4 Wed, Feb 23, 2005. Trends. Homework Trend. 100%. 90%. 80%. 70%. 60%. Average Grade. 50%. 40%. 30%. 20%. 10%. 0%. 1. 2. 3. 4. Assignment. Russell’s Paradox. Let A be any set that you have ever seen.

yered
Download Presentation

Russell’s Paradox and the Halting Problem

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. Russell’s Paradox and the Halting Problem Lecture 24 Section 5.4 Wed, Feb 23, 2005

  2. Trends Homework Trend 100% 90% 80% 70% 60% Average Grade 50% 40% 30% 20% 10% 0% 1 2 3 4 Assignment

  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. P P I I P halts on I P runs forever on I The Program P with Input 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 CheckHalt yes no P, I P, I P halts on I P runs forever on I

  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. Test yes CheckHalt P, P P no yes The Program Test

  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. Test yes CheckHalt Test, Test Test no yes The Program Test

  15. The Program Test Test yes CheckHalt Test, Test Test no yes

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

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

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

  19. The Program Test Test yes CheckHalt Test, Test Test no yes …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.

More Related