1 / 38

Reductions (Section 5.1)

Reductions (Section 5.1). H éctor Muñoz-Avila. Summary of Previous Lectures. The Halting problem is undecidable: HALT = {< M,w > | M is a Turing machine, w  *, M halts on input w } The proof involved a paradox. Proving that Other Problems are Undecidable. We use the reductions method

trella
Download Presentation

Reductions (Section 5.1)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Summary of Previous Lectures • The Halting problem is undecidable: • HALT = {<M,w> | 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 ≤redB) • 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 ≤redB 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 ≤redB 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 ≤redB 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 Software library SolutionA() { } solutionB1() solutionB2() solutionB3()

  7. Intuition • A ≤redB 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 Software library SolutionA() { … solutionB2() …. } solutionB1() solutionB2() solutionB3()

  8. Intuition • A ≤redB 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 ≤redB 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 ≤redB 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 ≤redB 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 ≤redB 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 ≤redDEAD-Code • Hence, DEAD-Code is undecidable • Lets construct a decider MH for HALT assuming a decider MD 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? Foo() P(w) { Foo() return accept }

  20. Example: Do-Nothing Problem • We are going to show HALT ≤redDo-Nothing • Hence, Do-Nothing is undecidable • Lets construct a decider MH for HALT assuming a decider MDNfor Do-Nothing is available

  21. Summary of the Previous Lecture (I) • A ≤redB 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

  22. Summary of the Previous Lecture (II) • A ≤redB 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 ≤redDEAD-Code • HALT ≤redDo-Nothing • Hence, DEAD-Code and Do-Nothing are undecidable

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

  24. 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

  25. 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?

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

  27. Equivalence • Given two programs P, P’ are they equivalent? • For every input w, P(w) = P(w’) • We can prove that HALT ≤redEquivalence • Lets construct a decider MH for HALT assuming a decider MEfor Equivalence is available • Hence, Equivalence is not decidable • As it turns out Equivalence is not even recognizable

  28. HALT ≤red Equivalence MH :- on input <M,w> Maux1 :- on input x 1. reject Maux2 :- on input x 1. Run M on input w 2. reject 1. Run ME on <Maux1,Maux2> 2. if accept then accept else reject

  29. The AI Question Héctor Muñoz-Avila

  30. Informally • Can we construct a machine that exhibits “human level” intelligence?

  31. 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

  32. Example of AI: The Case Base Reasoning Cycle Allentown to NYC? Problem Driving fromAllentown to NYC? New Case (Allentown, NYC) (Allentown,most of the way to JC, using by pass highway, NYC) Learned Case (Allentown,Jersey City) Retrieved Case (Allentown, NYC) New Case previous cases Driving Cases General Knowledge Jerry’s Knowledge (Allentown,most of the way to JC, using bypass highway, NYC) Tested/Repaired Case (Allentown, Jersey City, NYC) Solved Case

  33. We Certainly Have seen Impressive Examples of Machine’s Capabilities

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

  35. And Now You Understand the Limitations of Computation

  36. What is your opinion?

More Related