1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 19 Instructor: Paul Beame.

Slides:



Advertisements
Similar presentations
Algorithm Analysis.
Advertisements

David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
NP-Hard Nattee Niparnan.
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
Lecture 19. Reduction: More Undecidable problems
Lecture 24 MAS 714 Hartmut Klauck
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.
Problem: Give as many proofs as you can for the Pythagorean Theorem. i.e., a 2 + b 2 = c 2 holds for any right triangle with sides a & b and hypotenuse.
1 The Limits of Computation Intractable and Non-computable functions.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
The Theory of NP-Completeness
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 20 Instructor: Paul Beame.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Circuits CSE 373 Data Structures Lecture 22. 3/12/03Circuits - Lecture 222 Readings Reading ›Sections and 9.7.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Hardness Results for Problems
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.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
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.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
1 Computational Complexity Classify problems according to the amount of computational resources used by the best algorithms that solve them Recall: worst-case.
Great Theoretical Ideas in Computer Science for Some.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity Computability With Alan! (not Turing) Mind-
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.
Copyright © Curt Hill Proofs An Introduction.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
C SC 573 Theory of Computation Theory of Computation Lecture 05 Reduction.
CSE 311: Foundations of Computing Fall 2014 Lecture 27: Cardinality.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
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.
CSE 311: Foundations of Computing Fall 2014 Lecture 28: Undecidability.
P & NP.
Busch Complexity Lectures: Reductions
CSE 311 Foundations of Computing I
Automata, Grammars and Languages
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CSE 105 theory of computation
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 8: Undecidability, Mapping Reductions
CSE 311 Foundations of Computing I
Decidable Languages Costas Busch - LSU.
Undecidable problems:
Proposed in Turing’s 1936 paper
CS21 Decidability and Tractability
Instructor: Aaron Roth
CSE 311: Foundations of Computing
Instructor: Aaron Roth
Instructor: Aaron Roth
Automata, Grammars and Languages
CSE 105 theory of computation
Algorithms CSCI 235, Spring 2019 Lecture 37 The Halting Problem
Intro to Theory of Computation
Intro to Theory of Computation
Presentation transcript:

1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 19 Instructor: Paul Beame

2 Halting Problem  Given: the code of a program P and an input x for P, i.e. given  Output: 1 if P halts on input x and 0 if P does not halt on input x  Theorem (Turing): There is no program that solves the halting problem “The halting problem is undecidable”

3 Undecidability of the Halting Problem  Suppose that there is a program H that computes the answer to the Halting Problem  We’ll build a table with all the possible programs down one side and all the possible inputs along the other and do a diagonal flip to produce a contradiction

4  input  program code Entries are 1 if program P given by the code halts on input x and 0 if it runs forever

5  input  program code Want to create a new program whose halting properties are given by the flipped diagonal

6 Diagonal construction  Suppose H exists  Now define a new program D such that  D on input x:  runs H checking if the program P whose code is x halts when given x as input; i.e. does P halt on input  if H outputs 1 then D goes into an infinite loop  if H outputs 0 then D halts.  The row for the program D would be like the flip of the diagonal

7 Code for D assuming subroutine for H  Function D(x):  if H(x,x)=1 then  while (true); /* loop forever */  else  no-op; /* do nothing and halt */  endif

8 Finishing the argument  D must be different from any program in the list:  Suppose it has code then  D halts on input  iff (by definition of D)  H outputs 0 given program D and input  iff (by definition of H)  D runs forever on input  Contradiction!

9 Relating hardness of problems  We have one problem that we know is impossible to solve  Halting problem  Showing this took serious effort  We’d like to use this fact to derive that other problems are impossible to solve  don’t want to go back to square one to do it

10 Reductions  Given two problems to solve, L and R.  (think Left and Right)  Suppose you had a translation program T so that the following would correctly solve L (if you happened to have code for R handy)  Function L(x)  Run program T to translate input x for L into an input y for R  Call a subroutine for problem R on input y  Output the answer produced by R(y)

11 Property that makes this correct  It better be the case that no matter what x is L(x)=R(y) i.e. L(x)=R(T(x))  T is called a reduction from problem L to problem R  If such a T exists we write L  R.

12 Reduction L  R inputs for Linputs for R T x y L(x)=R(T(x)) Intuition: L is at least as easy as R or, equivalently, R is at least as hard as L

13 Example: BFS  Shortest-Path  BFS: Given a graph G and a vertex v, output the BFS tree of G started at v  Shortest-Paths: Given a graph G with non- negative weights on its edges, and a vertex v output the shortest-path tree of G from v  Reduction T: Given G and v, create weights for all edges in G giving each edge weight 1   T

14 Properties of reductions  Given that I have any reduction T such that L(x)=R(T(x))  If I had a program that solves R then I would have a program that solves L  Therefore  If there is no program that solves L then there cannot be any program that solves R!  (statement is just equivalent to one above)

15 Another undecidable problem  1’s problem: Given the code of a program M does M output 1 on input 1? If so, answer 1 else answer 0.  Claim: the 1’s problem is undecidable  Proof: by reduction from the Halting Problem

16 What we want for the reduction  Halting problem takes as input a pair  1’s problem takes as input  Given can we create an so that M outputs 1 on input 1 exactly when P halts on input x?

17 Yes  Here is all that we need to do to create M  modify the code of P so that instead of reading x, x is hard-coded as the input to P and get rid of all output statements in P  add a new statement at the end of P that outputs 1.  We can write another program T that can do this transformation from to

18 Finishing things off  Therefore we get a reduction  Halting Problem  1’s problem  Since there is no program solving the Halting Problem there must be no program solving the 1’s problem.

19 Why the name reduction?  Weird: it maps an easier problem into a harder one  Same sense as saying Maxwell reduced the problem of analyzing electricity & magnetism to solving partial differential equations  solving partial differential equations in general is a much harder problem than solving E&M problems

20 A geek joke  An engineer  is placed in a kitchen with an empty kettle on the table and told to boil water; she fills the kettle with water, puts it on the stove, turns on the gas and boils water.  she is next confronted with a kettle full of water sitting on the counter and told to boil water; she puts it on the stove, turns on the gas and boils water.  A mathematician  is placed in a kitchen with an empty kettle on the table and told to boil water; he fills the kettle with water, puts it on the stove, turns on the gas and boils water.  he is next confronted with a kettle full of water sitting on the counter and told to boil water: he empties the kettle in the sink, places the empty kettle on the table and says, “I’ve reduced this to an already solved problem”.