Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reductions (Section 5.1) Héctor Muñoz-Avila. Summary of Previous Lectures The Halting problem is undecidable: –HALT = { | M is a Turing machine, w  

Similar presentations


Presentation on theme: "Reductions (Section 5.1) Héctor Muñoz-Avila. Summary of Previous Lectures The Halting problem is undecidable: –HALT = { | M is a Turing machine, w  "— Presentation transcript:

1 Reductions (Section 5.1) Héctor Muñoz-Avila

2 Summary of Previous Lectures The Halting problem is undecidable: –HALT = { | M is a Turing machine, w   *, M halts on input w} The proof involved a paradox

3 Proving that Other Problems are Undecidable We use the reductions method –A is reduced into B (written: A ≤ red B) –Implies: deciding B is at least as hard as as deciding A This method requires that we know at least one problem to be undecidable Reductions are also used to prove intractability –E.g., NP-completeness

4 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A

5 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A Example?

6 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A Example 1: when we use software libraries to solve a problem A SolutionA() { } Software library solutionB1() solutionB2() solutionB3()

7 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A Example 1: when we use software libraries to solve a problem A SolutionA() { … solutionB2() …. } Software library solutionB1() solutionB2() solutionB3()

8 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A Example 2: How to use a solution of B to solve A if: –A = “find the largest number among an array of integers array[1..n]” –B = “find the smallest number among an array of integers array[1..n]”

9 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A Example 3: How to use a solution of B to solve A if: –A = “find if there is a zero in an array of integers array[1..n]” –B = “determine the product of all numbers in an array of integers array[1..n]” (e.g., if array[…] contains 2, 3, 7 then the result will be 42.

10 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A Relations: Assume A is undecidable, is B undecidable? Assume A is decidable, is B decidable? Assume B is decidable, is A decidable? Assume B is undecidable, is A undecidable?

11 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A If B is decidable Then A is decidable

12 Intuition A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A If B is decidable Then A is decidable If A is undecidable Then B is undecidable

13 Example: Dead-Code Problem Given a program P, an input w for P, and a line of code i in P, will P ever execute line I when running with input w?

14 Example: Dead-Code Problem Given a program P, an input w for P, and a line of code i in P, will P ever execute line I when running with input w? P(w) { if (w == 1) then println(“yes”) else printlin(“no”) }

15 Example: Dead-Code Problem Given a program P, an input w for P, and a line of code i in P, will P ever execute line I when running with input w? P(w) { Foo() if (w == 1) then println(“yes”) else printlin(“no”) } Foo()

16 Example: Dead-Code Problem We are going to show HALT ≤ red DEAD-Code Hence, DEAD-Code is undecidable Lets construct a decider M H for HALT assuming a decider M D for DEAD-Code is available

17 Example: Do-Nothing Problem Given a program P, will P reject every input w?

18 Example: Do-Nothing Problem Given a program P, will P reject every input w? P(w) { return reject }

19 Example: Do-Nothing Problem Given a program P, will P reject every input w? P(w) { Foo() return accept } Foo()

20 Example: Do-Nothing Problem We are going to show HALT ≤ red Do-Nothing Hence, Do-Nothing is undecidable Lets construct a decider M H for HALT assuming a decider M DN for Do-Nothing is available

21

22 Summary of the Previous Lecture (I) A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A If B is decidable Then A is decidable If A is undecidable Then B is undecidable

23 Summary of the Previous Lecture (II) A ≤ red B if I can use a decider for B (assuming one exists) to construct a decider for A Implies: deciding B is at least as hard as as deciding A We proved: HALT ≤ red DEAD-Code HALT ≤ red Do-Nothing Hence, DEAD-Code and Do-Nothing are undecidable

24 Observations HALT is recognizable Dead-Code is recognizable We can easily proof this Is there a problem that is not recognizable?

25 Equivalence Given two programs P, P’ are they equivalent? –For every input w, P(w) = P(w’) –For example, if P and P’ return either true or false then: For every input w, P(w) is true iff P(w’) is true

26 Equivalence Given two programs P, P’ are they equivalent? –For every input w, P(w) = P’(w) The following 2 programs receive as input an array of integers (a[1..n] in the left and A[0..MAXDIN] in the right). Are they equivalent?

27 Equivalence Given two programs P, P’ are they equivalent? –For every input w, P(w) = P(w’) So what you think is Equivalence decidable?

28 Equivalence Given two programs P, P’ are they equivalent? –For every input w, P(w) = P(w’) We can prove that HALT ≤ red Equivalence Lets construct a decider M H for HALT assuming a decider M E for Equivalence is available Hence, Equivalence is not decidable As it turns out Equivalence is not even recognizable

29 HALT ≤ red Equivalence M H :- on input M aux1 :- on input x 1. reject M aux2 :- on input x 1. Run M on input w 2. reject 1. Run M E on 2. if accept then accept else reject

30

31 The AI Question Héctor Muñoz-Avila

32 Informally Can we construct a machine that exhibits “human level” intelligence?

33 We Certainly Have Come a Long Way Many AI paradigms are constructed from our understanding of how humans think –E.g., case-based reasoning: recall past experiences –Neural networks: simulate connectionism of brain cells

34 previous cases General Knowledge New Case Problem Retrieved Case New Case Solved Case Tested/Repaired Case Learned Case Jerry’s Knowledge Driving Cases Allentown to NYC? (Allentown, NYC) (Allentown, Jersey City) (Allentown, NYC) (Allentown, Jersey City, NYC) (Allentown, most of the way to JC, using by pass highway, NYC) (Allentown, most of the way to JC, using bypass highway, NYC) Driving from Allentown to NYC? 34

35 We Certainly Have seen Impressive Examples of Machine’s Capabilities

36 Impressive But… Could humans “solve” HALT? –E.g., “Crowdsourcing” Humans have been able to solve problems that are difficult for computers

37 And Now You Understand the Limitations of Computation

38 What is your opinion?


Download ppt "Reductions (Section 5.1) Héctor Muñoz-Avila. Summary of Previous Lectures The Halting problem is undecidable: –HALT = { | M is a Turing machine, w  "

Similar presentations


Ads by Google