Presentation is loading. Please wait.

Presentation is loading. Please wait.

David Evans CS200: Computer Science University of Virginia Computer Science Class 25: Computability Halting Problems Hockey.

Similar presentations


Presentation on theme: "David Evans CS200: Computer Science University of Virginia Computer Science Class 25: Computability Halting Problems Hockey."— Presentation transcript:

1 David Evans http://www.cs.virginia.edu/evans CS200: Computer Science University of Virginia Computer Science Class 25: Computability Halting Problems Hockey Team Logo

2 22 March 2004CS 200 Spring 20042 Menu Quiz Answers Review: –Gödel’s Theorem –Proof in Axiomatic Systems Computability: Are there some problems that it is impossible to write a program to solve?

3 22 March 2004CS 200 Spring 20043 Quiz Answers

4 22 March 2004CS 200 Spring 20044 1. How far have you read in GEB? –Not through Chapter 5: 6 –Through Ch 5: 2 –Through Ch 6: 2, Through Ch 7: 2 –All of Part I: 3, Beyond Part I: 1 Reading GEB might not be necessary to get a good grade in this class, but I really hope you will read it and enjoy reading it! Ch 13 is the last assigned reading in it for this class (but I hope you’ll read the rest during your summer vacation!)

5 22 March 2004CS 200 Spring 20045 2. Problem Set 7 ─More practical (“Illiberal Students”)12 ─More theoretical (“Liberal students”) 2 ─Write-in: both (“Jeffersonian students”) 1 Problem Set 7 will be both, but will include learning some tools you will use to build dynamic web sites in PS8.

6 22 March 2004CS 200 Spring 20046 3. So far, class is going: –Way too fast 0 –Too fast 6.5 –Just about right 9.5 –Too slow 0

7 22 March 2004CS 200 Spring 20047 4. How far have you gotten in PS6: –Finished0 –Question 62 –Question 45 –Question 21 –Started1 –Read it 5 –Haven’t started2

8 22 March 2004CS 200 Spring 20048 5. What should be different? “Maybe deal with stuff similar to our PS's more in class???” “Notes more applicable to problem sets.” “Just use more concrete examples. I get very lost on the abstract stuff, and can't put it together with what we're learning until I sit in the lab for 5 hours staring at the screen.” “I generally like how the class is going. More discussion of GEB would be nice though (but perhaps not "practically" useful).”

9 22 March 2004CS 200 Spring 20049 “I mean the thing is, I always FEEL like I don't know what's going on, so I think "ahhh! slow down!" but, at the end of the day (or a PS), I'm amazed at what I can do. So should you do anything? I'm learning a lot, so maybe it's good I'm confused. I do like language stuff a lot though - I like it when we talk about that. Sometimes it's hard for me to pick it right up in class, though. I have to go home and digest it.”

10 22 March 2004CS 200 Spring 200410 Perhaps a little less slower and a means for practicing concepts beyond the problem sets, on a smaller scale. Do more ourselves. Have simpler problems but have us do more of them. One can struggle through a PS without really understanding what's going on; whereas if we write it all ourselves, we must know what's happening. Compensate for this challenge with simpler problems to solve. Just a thought; I'm actually quite content.

11 22 March 2004CS 200 Spring 200411 6. What is Computer Science? A method of thinking about solving problems using machines. Using machines (you can define that as you will) to solve problems. A way of thinking about problems and their solutions, then using computers to solve those problems which are solvable. The engineering of problem solving strategies by way of computer programs. Applying techniques of computer programming to solve real world problems Mechanized problem solving

12 22 March 2004CS 200 Spring 200412 Applying a system of thought or logic according to its stated rules. Solving problems via a systematic way of thinking The study of the science of computation: the ways in which we find solutions for problems. Solving problems the simplest way possible using a language. It is the study of command-based languages that solve a problem and the examination of how these problems are solves. Basically, the study of solving problems in the most efficient and accurate manner, generally using languages created for this purpose. The application of multiple disciplines to design and construct formalized systems of logic and evaluation. 6. What is Computer Science? Language/logic problem solving

13 22 March 2004CS 200 Spring 200413 6. What is Computer Science? I'm more confused about its definition now than I was before this class! A way of life A painstakingly annoying subject that uses crazy computer languages that leave you endlessly frustrated for hours, until you figure out the last part of the code and feel like a genius or realize you have parentheses in the wrong spot and feel like an idiot. But it's still ok I guess. (Possibly) true statements, but not definitions

14 22 March 2004CS 200 Spring 200414 What is Computer Science? My answer would be: “Study of ways to describe procedures and reason about the processes they produce.” “Study of mechanized ways to solve symbolic problems.” Today’s topic fits, since it concerns reasoning about whether or not a procedure will terminate.

15 22 March 2004CS 200 Spring 200415 8. Barber paradox In Charlottansville, there is a barber who shaves every man who does not shave himself, and no one else. Who shaves the barber? Possible answers: 1. MU! Charlottansville doesn’t exist, there is a paradox since either the barber shaves himself in which case he can’t shave himself, or he doesn’t in which case he must. 2. The barber is a woman. She shaves herself just fine. Link to Hofstadter’s satire on sexist language on today’s notes. (Read it after you catch up on the GEB reading.)

16 22 March 2004CS 200 Spring 200416 Computer Scientists Everyone should know these: –Ada Byron, Countess of Lovelace First person to think about programming –John Backus FORTRAN, replacement (BNF) grammars for describing languages –Admiral Grace Murray Hopper First compiler –C. A. R. (Tony) Hoare Quicksort, language designer, verification –Alan Turing (today) Everyone should list themselves too! –2 of you did on the quiz

17 22 March 2004CS 200 Spring 200417 Review Axiomatic System –Set of axioms –Set of inference rules Example: MIU-System from GEB –Axioms: MI –Inference rules: 4 rules for making new strings An axiomatic system is a formal system where the string we can generate are meant to represent “true theorems”

18 22 March 2004CS 200 Spring 200418 Proof A proof of S in an axiomatic system is a sequence of strings, T 0, T 1, …, T n where: –The first string is the axioms –For all i from 1 to n, T n is the result of applying one of the inference rules to T n-1 –T n is S How much work is it to check a proof?

19 22 March 2004CS 200 Spring 200419 Proof Checking Problem Input: an axiomatic system (a set of axioms and inference rules), a statement S, and a proof P containing n steps of S Output: true if P is a valid proof of S false otherwise How much work is a proof-checking procedure? We can write a proof-checking procedure that is  (n)

20 22 March 2004CS 200 Spring 200420 Finite-Length Proof Finding Problem Input: an axiomatic system (a set of axioms and inference rules), a statement S, n (the maximum number of proof steps) Output: A valid proof of S with no more then n steps if there is one. If there is no proof of S with <= n steps, unprovable. How much work? At worst, we can try all possible proofs: r inference rules, 0 - n steps ~ r n possible proofs Checking each proof is  (n) So, there is a procedure that is  (nr n ) but, it might not be the best one.

21 22 March 2004CS 200 Spring 200421 Proof Finding Problem Input: an axiomatic system, a statement S Output: If S is true, output a valid proof. If S is not true, output false. How much work? It is impossible! “It might take infinite work.” Gödel’s theorem says it cannot be done.

22 22 March 2004CS 200 Spring 200422 Gödel’s Statement G: This statement of number theory does not have any proof in the system of Principia Mathematica. G is unprovable, but true!

23 22 March 2004CS 200 Spring 200423 What does it mean for an axiomatic system to be complete and consistent? Derives all true statements, and no false statements starting from a finite number of axioms and following mechanical inference rules.

24 22 March 2004CS 200 Spring 200424 What does it mean for an axiomatic system to be complete and consistent? It means the axiomatic system is weak. Its is so weak, it cannot express “This statement has no proof.”

25 22 March 2004CS 200 Spring 200425 Computability

26 22 March 2004CS 200 Spring 200426 Algorithms What’s an algorithm? A procedure that always terminates. What’s a procedure? A precise (mechanizable) description of a process. Question 6 answer: “Using algorithms to solve problems”

27 22 March 2004CS 200 Spring 200427 Computability Is there an algorithm that solves a problem? Decidable (computable) problems: –There is an algorithm that solves the problem. –Make a photomosaic, sorting, drug discovery, winning chess (it doesn’t mean we know the algorithm, but there is one) Undecidable problems: –There is no algorithm that solves the problem. There might be a procedure, but it doesn’t always terminate.

28 22 March 2004CS 200 Spring 200428 Are there any undecidable problems? The Proof-Finding Problem: Input: an axiomatic system, a statement S Output: If S is true, output a valid proof. If S is not true, output false.

29 22 March 2004CS 200 Spring 200429 Any others? How would you prove a problem is undecidable?

30 22 March 2004CS 200 Spring 200430 Undecidable Problems We can prove a problem is undecidable by showing it is at least as hard as the proof- finding problem Here’s a famous one: Halting Problem Input: a procedure P (described by a Scheme program) and its input I Output: true if executing P on I halts (finishes execution), false otherwise.

31 22 March 2004CS 200 Spring 200431 Charge Wednesday: Why does this mean there cannot be a perfect computer virus scanner?


Download ppt "David Evans CS200: Computer Science University of Virginia Computer Science Class 25: Computability Halting Problems Hockey."

Similar presentations


Ads by Google