310 likes | 326 Views
Delve into the fundamentals of computability and logic in computer science, understanding Gödel’s Theorem, proof in axiomatic systems, and the limits of program-solving. Discover the essence of computer science through systematic problem-solving strategies and the study of computation.
E N D
Class 25: Computability David Evans http://www.cs.virginia.edu/evans Halting Problems Hockey Team Logo CS200: Computer Science University of Virginia Computer Science
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? CS 200 Spring 2004
Quiz Answers CS 200 Spring 2004
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!) CS 200 Spring 2004
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. CS 200 Spring 2004
3. So far, class is going: • Way too fast 0 • Too fast 6.5 • Just about right 9.5 • Too slow 0 CS 200 Spring 2004
4. How far have you gotten in PS6: • Finished 0 • Question 6 2 • Question 4 5 • Question 2 1 • Started 1 • Read it 5 • Haven’t started 2 CS 200 Spring 2004
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).” CS 200 Spring 2004
“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.” CS 200 Spring 2004
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. CS 200 Spring 2004
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 CS 200 Spring 2004
6. What is Computer Science? • 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. Language/logic problem solving CS 200 Spring 2004
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 CS 200 Spring 2004
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. CS 200 Spring 2004
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.) CS 200 Spring 2004
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 CS 200 Spring 2004
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” CS 200 Spring 2004
Proof • A proof of S in an axiomatic system is a sequence of strings, T0, T1, …, Tnwhere: • The first string is the axioms • For all i from 1 to n, Tn is the result of applying one of the inference rules to Tn-1 • Tn is S • How much work is it to check a proof? CS 200 Spring 2004
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) CS 200 Spring 2004
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. At worst, we can try all possible proofs: r inference rules, 0 - n steps ~ rn possible proofs Checking each proof is (n) So, there is a procedure that is (nrn) but, it might not be the best one. How much work? CS 200 Spring 2004
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. CS 200 Spring 2004
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! CS 200 Spring 2004
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. CS 200 Spring 2004
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.” CS 200 Spring 2004
Computability CS 200 Spring 2004
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” CS 200 Spring 2004
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. CS 200 Spring 2004
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. CS 200 Spring 2004
Any others? How would you prove a problem is undecidable? CS 200 Spring 2004
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. CS 200 Spring 2004
Charge • Wednesday: Why does this mean there cannot be a perfect computer virus scanner? CS 200 Spring 2004