Hard problems November 29. 2001 Administrivia Ps 8 –Handed out Tuesday (12/4) –Due Tuesday (12/11) or Tuesday (12/18) your choice Ps 9 –Handed out Thursday.

Slides:



Advertisements
Similar presentations
Complexity. P=NP? Who knows? Who cares? Lets revisit some questions from last time – How many pairwise comparisons do I need to do to check if a sequence.
Advertisements

CS211 Problems: unsolvable, unfeasible and unsolved Topic 2: Halting problem.
Announcements You survived midterm 2! No Class / No Office hours Friday.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
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.
1 The Limits of Computation Intractable and Non-computable functions.
Limitations. Limitations of Computation Hardware precision Hardware precision Software - we’re human Software - we’re human Problems Problems –complex.
CSE115/ENGR160 Discrete Mathematics 02/28/12
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Humans, Computers, and Computational Complexity J. Winters Brock Nathan Kaplan Jason Thompson.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
Today - Limits of computation - Complexity analysis examples.
What computers just cannot do. (Part II) COS 116: 3/5/2008 Sanjeev Arora.
Analysis of Algorithms CS 477/677
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 29: Computability, Turing Machines, Can Computers Think?
Distributed Algorithms. Distributed computing Key idea –Buying 1000 machines of speed x is significantly cheaper than buying one machine of speed 1000x.
What computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora.
Propositional Logic Lecture 2: Sep 9. Conditional Statement If p then q p is called the hypothesis; q is called the conclusion “If your GPA is 4.0, then.
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.
Propositional Logic.
Computability and Modeling Computation What are some really impressive things that computers can do? –Land the space shuttle (and other aircraft) from.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
1 Growth of Functions CS 202 Epp, section ??? Aaron Bloomfield.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
CSE 311 Foundations of Computing I Lecture 30 Computability: Other Undecidable Problems Autumn 2012 CSE 3111.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
Great Theoretical Ideas in Computer Science for Some.
Course Overview and Road Map Computability and Logic.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity Computability With Alan! (not Turing) Mind-
Halting Problem Introduction to Computing Science and Programming I.
1 Theory: Models of Computation  Readings:  Chapter 11 & Chapter 3.6 of [SG]  Content:  What is a Model  Model of Computation  Model of a Computing.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
Georgia Institute of Technology Speed part 6 Barb Ericson Georgia Institute of Technology May 2006.
Great Theoretical Ideas in Computer Science.
1 Computability CS 101E Spring 2007 Michele Co. 2 So Far In Class We’ve seen the following programming constructs –if, if-else, if-else-if –switch –for.
Great Theoretical Ideas in Computer Science.
What computers just cannot do. (Part II) COS 116: 3/1/2011 Sanjeev Arora.
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.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Tyler Robison Summer
The Halting Problem Can we design a program that, given any other program and its input, tells whether that program will halt when run on that input?
CS 3813: Introduction to Formal Languages and Automata Chapter 12 Limits of Algorithmic Computation These class notes are based on material from our textbook,
Module #7: Algorithmic Complexity Rosen 5 th ed., §2.3.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
Powerpoint Templates Page 1 Powerpoint Templates Impossible Math Problems (or should we say, undecidable) Math Club 4/16/2012.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Thales’ Legacy: What Is A Proof? Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 27April 22, 2004Carnegie Mellon.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
CompSci Today’s Topics Computer Science Noncomputability Upcoming Special Topic: Enabled by Computer -- Decoding the Human Genome Reading Great.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Introduction to Computing Science and Programming I
Self-Reference And Undecidability
Discrete Mathematics for Computer Science
CSE 311 Foundations of Computing I
Unsolvable Problems December 4, 2017.
Great Theoretical Ideas in Computer Science
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
CSE 311 Foundations of Computing I
Halting Problem.
CSE 311: Foundations of Computing
Great Theoretical Ideas in Computer Science
Class 24: Computability Halting Problems Hockey Team Logo
CSE 311: Foundations of Computing
Computability and Undecidability
Lecture 23: Computability CS200: Computer Science
Presentation transcript:

Hard problems November

Administrivia Ps 8 –Handed out Tuesday (12/4) –Due Tuesday (12/11) or Tuesday (12/18) your choice Ps 9 –Handed out Thursday (12/6) –In 3 parts Part a due 12/11 Part b due 12/13 Part c due 12/14

The big picture We built a computer We built an operating system We attached the computer to a network We wrote a compiler We designed algorithms We attached the computer to a network Next, we want to see if there are limitations –Mathematical proofs that things cannot be done???

Simple unsolvable problem This sentence is false.

Limitations of Computers? Possible impossible tasks for computers? Emotion Beating the world chess champion Creative thought Others?

Limitations of Computers? How to show that such tasks are impossible? Find a cleanly defined problem Prove a theorem that says it can’t be solved Theorem is proved using axioms (like logic gates) that are assembled (like state machines and computers) to justify the result The underlying field is called mathematical logic

Simple task --The “Hello” Assignment You write a computer program which outputs “Hello!” and stops. Assignment promises full credit for ANY program that outputs “Hello!” and then halts, and no credit otherwise. Assignment is to be done on a computer that is as fast as you like and has as much memory as you like.

The “Hello” Assignment Can I write a program that automatically grades your homework?

The “Hello” Assignment Can I write a program that automatically grades your homework? Sample homework Function GradeHELLO (Program P) Execute P, and store output in output If (output = “Hello!”) Then Return “Pass” Else Return “Fail” End If End Function

The “Hello” Assignment Possible glitch –What if the program never stops? Program P Do While (1 > 0) Print “Hello!” End While End Program

The “Hello” Assignment Student’s program runs forever! This means the grading program would run forever. It would never tell me that the student should fail… Program P Do While (1 > 0) Print “Hello!” End While End Program

The “Hello” Assignment Can just stop the Program after 1 hour and fail the student if the program hasn’t stopped yet. Program P Do While (1 > 0) Print “Hello!” End While End Program Program P Print “Hello!” Do While (1 hour hasn’t passed) Do Nothing End While End Program

The “Hello” Assignment Other kind of program you could write Program P Initialize x = 0 Do While (x is not a proof of Fermat’s Last Theorem) x = x + 1 End While Print “Hello!” End Program

The “Hello” Assignment Other kind of program you could write Program P Initialize x = 0 Do While (x is not a proof of Fermat’s Last Theorem) x = x + 1 End While Print “Hello!” End Program Interpret x as a sequence of mathematical statements…

The “Hello” Assignment Other kind of program you could write Grading program might say to fail you. But technically you deserve to Pass. Unless the proof is wrong Program P Initialize x = 0 Do While (x is not a proof of Fermat’s Last Theorem) x = x + 1 End While Print “Hello!” End Program

The “Hello” Assignment We keep running in to problems… Could it be that writing a computer program to grade such a simple assignment is impossible? YES! Moreover we can prove that it is impossible.

The Halting Problem Can we design a program that tells whether other programs ever halt on their own input. So, for program P Output “halts” if P(P) eventually halts Output “never halts” if P(P) never halts Theorem (Alan Turing 1937): No computer program can solve the halting problem.

Proof by Contradiction Suppose there was a computer program called HALT, which solved the halting problem. Consider the following program: Program NonConformist (Program P) If ( HALT(P) = “never halts” ) Then Halt Else Do While (1 > 0) Print “Hello!” End While End If End Program

Proof by Contradiction Does NonConformist(NonConformist) halt? Yes? That means HALT(NonConformist) = “never halts” No? That means HALT(NonConformist) = “halts” Program NonConformist (Program P) If ( HALT(P) = “never halts” ) Then Halt Else Do While (1 > 0) Print “Hello!” End While End If End Program Contradiction!

Undecidability Halting Problem: Given a computer program P: Output “halts” if P(P) eventually halts Output “never halts” if P(P) never halts We’ve shown that the Halting Problem is Undecidable – no computer program can ever solve it, no matter how powerful the computer is.

Undecidability Many other problems are undecidable, too. Moreover, the same ideas that we used to prove undecidability can be used to prove a very disturbing statement.

GÖDEL’S INCOMPLETENESS THEOREM Gödel stunned the world by proving that in any logical framework in which you can express basic facts about numbers, there exists a true statement that cannot be proved in that framework.In 1931, Gödel stunned the world by proving that in any logical framework in which you can express basic facts about numbers, there exists a true statement that cannot be proved in that framework. “Not every true statement has a proof”“Not every true statement has a proof”

GÖDEL’S INCOMPLETENESS THEOREM Gödel stunned the world by proving that in any logical framework in which you can express basic facts about numbers, there exists a true statement that cannot be proved in that framework.In 1931, Gödel stunned the world by proving that in any logical framework in which you can express basic facts about numbers, there exists a true statement that cannot be proved in that framework. But wait, if it can’t be proved, how do we know it is true?But wait, if it can’t be proved, how do we know it is true?

GÖDEL’S INCOMPLETENESS THEOREM We can prove that it is true by “jumping” outside the original logical framework to a “larger” logical framework…We can prove that it is true by “jumping” outside the original logical framework to a “larger” logical framework…

GÖDEL’S INCOMPLETENESS THEOREM We can prove that it is true by “jumping” outside the original logical framework to a “larger” logical framework…We can prove that it is true by “jumping” outside the original logical framework to a “larger” logical framework… But that larger logical framework also has a true statement that cannot be proved!But that larger logical framework also has a true statement that cannot be proved!

GÖDEL’S INCOMPLETENESS THEOREM We can prove that it is true by “jumping” outside the original logical framework to a “larger” logical framework…We can prove that it is true by “jumping” outside the original logical framework to a “larger” logical framework… But that larger logical framework also has a true statement that cannot be proved!But that larger logical framework also has a true statement that cannot be proved! …and so on, and so on……and so on, and so on… No matter when we stop, there will always be some true statement that doesn’t have a proof!No matter when we stop, there will always be some true statement that doesn’t have a proof!

GÖDEL’S INCOMPLETENESS THEOREM Until Gödel came along, Mathematicians were searching for the “one true logical framework” in which everything could be proved.Until Gödel came along, Mathematicians were searching for the “one true logical framework” in which everything could be proved. Their faith was shattered by Gödel.Their faith was shattered by Gödel. For more on this and its philosophical implications, see Gödel, Escher, Bach by Douglas Hofstadter.For more on this and its philosophical implications, see Gödel, Escher, Bach by Douglas Hofstadter.

What Computers Can’t Do In Your Lifetime We’ve now seen an example of a problem that computers can’t solve, even if computers have unlimited speed and unlimited time. Are there more real world problems (eg that arise in business, science, … ) that can be solved but take billions of years?

“Search” Problems We’ll focus on what we’ll call “search problems”. (In CS terms, we’ll be talking about what are termed NP problems) Intuitively, a search problem is a problem where you are looking for something which you can recognize quickly if you find it.

Example: Coloring

Example: Coloring with 3 colors Suppose we are given a collections of circles. Some circles are connected to others. Rule: No connected circles can have the same color. You only have three colors (Green, Red, Yellow) Is there a valid coloring? Note: easy to check validity. Hard to find?

Search Problems: More Precise Definition Intuitively, a search problem is a problem where you are looking for something which you can recognize quickly if you find it. A bit more precisely, we require that there is a small circuit that can quickly check the validity of a solution. For coloring, it would just be a circuit that checks that for every pair of connected circles, the colors are different.

Example: Traveling Salesman Problem A salesman wants to visit n different cities. He knows the costs associated with flights between each city. Can he visit all the cities spending less than $B total? Note: Easy to check that a given flight plan visits all the cities and costs less than $B. Seems hard to find…

Search Problems… Unfortunately, we don’t know how to solve these and many other search problems with a computer in our lifetimes for large inputs. For many years, computer scientists wondered which search problems could be solved, and which couldn’t. Just because computer scientists couldn’t solve the Coloring problem for 40 years doesn’t mean it is impossible, right? Proof of Fermat’s theorem took over 300 years

Search Problems… We still don’t know how to prove that it is impossible to solve them quickly… But now we are much more confident that they really are impossible to solve quickly.

Breakthrough Another surprise: In the early 70’s, Cook, Levin, and Karp showed us that if we can solve the Coloring problem quickly, then we can solve ALL search problems quickly! But general search problems are defined in terms of circuits, not colors…

Coloring Circuits? Suppose we think of : Green as meaning True. Red as meaning False Yellow as meaning nothing

Coloring Circuits? TF X making a NOT gate by coloring NOT X

T F X Y Output XY FF FT TF TT

T F X Y XY FF FT TF TT T F

T F X Y XY FF FT TF TT

T F X Y XY FF FT TF TT

T F X Y XY FF FT TF TT

T F X Y XY FF FT TFT TT

XY FFF FTT TFT TTT T F X Y

XYOR FFF FTT TFT TTT = T F X Y Output

Coloring ! And you thought coloring was for kids.. In fact, we can encode any circuit into a collection of connected circles waiting to be colored. Thus, we can efficiently reduce any search problem to Coloring. If we can solve Coloring quickly, we can solve any search problem quickly!

Many more Traveling Salesman Problem is also as “hard” as any search problem. Search Problems with this property are called complete problems Although we don’t know how to prove that they are hard, we know that if we solve one of them, we solve all search problems! Gives us more confidence that they really are hard.

Wrap-up Today we saw problems that computers can’t solve at all, and also problems that computers probably can’t solve in our lifetimes. Too much bad news? Could it ever be useful to have hard problems? Yes! Next time: Cryptography