CS21 Decidability and Tractability

Slides:



Advertisements
Similar presentations
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
Advertisements

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,
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 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
The diagonalization method The halting problem is undecidable Decidability.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
The Halting Problem Sipser 4.2 (pages ). CS 311 Mount Holyoke College 2 Taking stock All languages Turing-recognizable Turing-decidable Context-free.
The Halting Problem Sipser 4.2 (pages ).
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Lecture 8 Recursively enumerable (r.e.) languages
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
CS21 Decidability and Tractability
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
A Universal Turing Machine
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
Recursively Enumerable and Recursive Languages
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
1 Recursively Enumerable and Recursive Languages.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Decidability and Undecidability Proofs
The Acceptance Problem for TMs
A Universal Turing Machine
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
CIS Automata and Formal Languages – Pei Wang
Recursively Enumerable and Recursive Languages
CSCI 2670 Introduction to Theory of Computing
This statement is false.
CSCI 2670 Introduction to Theory of Computing
Lecture12 The Halting Problem
CSCI 2670 Introduction to Theory of Computing
BCS 2143 Theory of Computer Science
The diagonalization method The halting problem is undecidable
MCC 2093 Advanced Theoretical Computer Science
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Summary.
Computability & Complexity I
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
CS21 Decidability and Tractability
CS21 Decidability and Tractability
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
Intro to Theory of Computation
Decidability and Tractability
CS21 Decidability and Tractability
Cpt S 317: Spring 2009 Reading: Chapter 8 & 9
Instructor: Aaron Roth
Instructor: Aaron Roth
MA/CSSE 474 Theory of Computation
Intro to Theory of Computation
CIS Automata and Formal Languages – Pei Wang
Presentation transcript:

CS21 Decidability and Tractability Lecture 11 February 1, 2019 February 1, 2019 CS21 Lecture 11

Outline Church-Turing Thesis decidable, RE, co-RE languages the Halting Problem reductions many-one reductions February 1, 2019 CS21 Lecture 11

Undecidability decidable ⊆ RE ⊆ all languages regular languages context free languages RE decidable ⊆ RE ⊆ all languages our goal: prove these containments proper February 1, 2019 CS21 Lecture 11

Countable and Uncountable Sets the natural numbers N = {1,2,3,…} are countable Definition: a set S is countable if it is finite, or it is infinite and there is a bijection f: N → S February 1, 2019 CS21 Lecture 11

Countable and Uncountable Sets Theorem: the positive rational numbers Q = {m/n : m, n ∈ N } are countable. Proof: … 1/1 1/2 1/3 1/4 1/5 1/6 … 2/1 2/2 2/3 2/4 2/5 2/6 … 3/1 3/2 3/3 3/4 3/5 3/6 … 4/1 4/2 4/3 4/4 4/5 4/6 … 5/1 … February 1, 2019 CS21 Lecture 11

Countable and Uncountable Sets Theorem: the real numbers R are NOT countable (they are “uncountable”). How do you prove such a statement? assume countable (so there exists bijection f) derive contradiction (some element not mapped to by f) technique is called diagonalization (Cantor) February 1, 2019 CS21 Lecture 11

Countable and Uncountable Sets Proof: suppose R is countable list R according to the bijection f: n f(n) _ 1 3.14159… 2 5.55555… 3 0.12345… 4 0.50000… … February 1, 2019 CS21 Lecture 11

Countable and Uncountable Sets Proof: suppose R is countable list R according to the bijection f: n f(n) _ 1 3.14159… 2 5.55555… 3 0.12345… 4 0.50000… … set x = 0.a1a2a3a4… where digit ai ≠ ith digit after decimal point of f(i) (not 0, 9) e.g. x = 0.2312… x cannot be in the list! February 1, 2019 CS21 Lecture 11

non-RE languages Theorem: there exist languages that are not Recursively Enumerable. Proof outline: the set of all TMs is countable the set of all languages is uncountable the function L:{TMs} →{languages} cannot be onto February 1, 2019 CS21 Lecture 11

non-RE languages Lemma: the set of all TMs is countable. Proof: each TM M can be described by a finite-length string <M> can enumerate these strings, and give the natural bijection with N February 1, 2019 CS21 Lecture 11

non-RE languages Lemma: the set of all languages is uncountable Proof: fix an enumeration of all strings s1, s2, s3, … (for example, lexicographic order) a language L is described by its characteristic vector 𝜒 𝐿 whose ith element is 0 if si is not in L and 1 if si is in L February 1, 2019 CS21 Lecture 11

non-RE languages suppose the set of all languages is countable list characteristic vectors of all languages according to the bijection f: n f(n) _ 1 0101010… 2 1010011… 3 1110001… 4 0100011… … February 1, 2019 CS21 Lecture 11

non-RE languages suppose the set of all languages is countable list characteristic vectors of all languages according to the bijection f: n f(n) _ 1 0101010… 2 1010011… 3 1110001… 4 0100011… … set x = 1101… where ith digit ≠ ith digit of f(i) x cannot be in the list! therefore, the language with characteristic vector x is not in the list February 1, 2019 CS21 Lecture 11

So far… {anbn : n ≥ 0 } some language decidable all languages regular languages context free languages RE {anbncn : n ≥ 0 } This language might be an esoteric, artificially constructed one. Do we care? We will show a natural undecidable L next. February 1, 2019 CS21 Lecture 11

HALT = { <M, x> : TM M halts on input x } The Halting Problem Definition of the “Halting Problem”: HALT = { <M, x> : TM M halts on input x } HALT is recursively enumerable. proof? Is HALT decidable? February 1, 2019 CS21 Lecture 11

The Halting Problem Theorem: HALT is not decidable (undecidable). Proof: Suppose TM H decides HALT Define new TM H’: on input <M> if H accepts <M, <M>> then loop if H rejects <M, <M>> then halt February 1, 2019 CS21 Lecture 11

The Halting Problem Proof: define new TM H’: on input <M> if H accepts <M, <M>> then loop if H rejects <M, <M>> then halt consider H’ on input <H’>: if it halts, then H rejects <H’, <H’>>, which implies it cannot halt if it loops, then H accepts <H’, <H’>> which implies it must halt contradiction. February 1, 2019 CS21 Lecture 11

The Halting Problem box (M, x): does M halt on x? inputs Y Turing Machines n Y The existence of H which tells us yes/no for each box allows us to construct a TM H’ that cannot be in the table. n n Y n H’ : n Y n Y Y n Y February 1, 2019 CS21 Lecture 11

So far… Can we exhibit a natural language that is non-RE? {anbn : n ≥ 0 } some language decidable all languages regular languages context free languages RE HALT {anbncn : n ≥ 0 } Can we exhibit a natural language that is non-RE? February 1, 2019 CS21 Lecture 11

RE and co-RE The complement of a RE language is called a co-RE language some language {anbn : n ≥ 0 } co-RE decidable all languages regular languages context free languages RE {anbncn : n ≥ 0 } HALT February 1, 2019 CS21 Lecture 11

RE and co-RE Theorem: a language L is decidable if and only if L is RE and L is co-RE. Proof: (⇒) we already know decidable implies RE if L is decidable, then complement of L is decidable by flipping accept/reject. so L is in co-RE. February 1, 2019 CS21 Lecture 11

RE and co-RE Theorem: a language L is decidable if and only if L is RE and L is co-RE. Proof: (⇐) we have TM M that recognizes L, and TM M’ recognizes complement of L. on input x, simulate M, M’ in parallel if M accepts, accept; if M’ accepts, reject. February 1, 2019 CS21 Lecture 11

A natural non-RE language Theorem: the complement of HALT is not recursively enumerable. Proof: we know that HALT is RE suppose complement of HALT is RE then HALT is co-RE implies HALT is decidable. Contradiction. February 1, 2019 CS21 Lecture 11

Main point: some problems have no algorithms, HALT in particular. Summary co-HALT some language {anbn : n ≥ 0 } co-RE decidable all languages regular languages context free languages RE {anbncn : n ≥ 0 } HALT Main point: some problems have no algorithms, HALT in particular. February 1, 2019 CS21 Lecture 11

Reductions Given a new problem NEW, want to determine if it is easy or hard right now, easy typically means decidable right now, hard typically means undecidable One option: prove from scratch that the problem is decidable, or prove from scratch that the problem is undecidable (dream up a diag. argument) February 1, 2019 CS21 Lecture 11

Reductions A better option: called a reduction to prove NEW is decidable, show how to transform it into a known decidable problem OLD so that solution to OLD can be used to solve NEW. to prove NEW is undecidable, show how to transform a known undecidable problem OLD into NEW so that solution to NEW can be used to solve OLD. called a reduction February 1, 2019 CS21 Lecture 11

Reductions Reductions are one of the most important and widely used techniques in theoretical Computer Science. especially for proving problems “hard” often difficult to do “from scratch” sometimes not known how to do from scratch reductions allow proof by giving an algorithm to perform the transformation February 1, 2019 CS21 Lecture 11

Example reduction Try to prove undecidable: ATM = {<M, w> : M accepts input w} We know this language is undecidable: HALT = {<M, w> : M halts on input w} Idea: suppose ATM is decidable show that we can use ATM to decide HALT conclude HALT is decidable. Contradiction. reduction February 1, 2019 CS21 Lecture 11

Example reduction How could we use procedure that decides ATM to decide HALT? given input to HALT: <M, w> Some things we can do: check if <M, w> ∈ ATM construct another TM M’ and check if <M’, w> ∈ ATM February 1, 2019 CS21 Lecture 11

Example reduction Deciding HALT using a procedure that decides ATM (“reducing HALT to ATM”). on input <M, w> check if <M, w> ∈ ATM if yes, the M halts on w; ACCEPT if no, then M either rejects w or it loops on w construct M’ by swapping qaccept/qreject in M check if <M’, w> ∈ ATM if yes, then M’ accepts w, so M rejects w; ACCEPT if no, then M neither accepts nor rejects w; REJECT February 1, 2019 CS21 Lecture 11

Example reduction Preceding reduction proved: Theorem: ATM is undecidable. Proof (recap): suppose ATM is decidable we showed how to use ATM to decide HALT conclude HALT is decidable. Contradiction. February 1, 2019 CS21 Lecture 11

ETM = {<M> : L(M) = Ø} Another example Try to prove undecidable: ETM = {<M> : L(M) = Ø} which problem should we reduce from? HALT = {<M, w> : M halts on input w} ATM = {<M, w> : M accepts input w} Some things we can do: check if <M> ∈ ETM construct another TM M’ and check if <M’> ∈ ETM February 1, 2019 CS21 Lecture 11

Another example We are given input <M, w> We want to use a procedure that decides ETM to decide if <M, w> ∈ ATM Idea: check if <M> ∈ ETM if not? helpful if could make M reject everything except possibly w. February 1, 2019 CS21 Lecture 11

Is this OK? finite # of states? Another example Is this OK? finite # of states? Construct TM M’: on input x, if x ≠ w, then reject else simulate M on x, and accept if M does. on input <M, w> construct M’ from description of M check if M’ ∈ ETM if no, M must accept w; ACCEPT if yes, M cannot accept w; REJECT February 1, 2019 CS21 Lecture 11

Another example Preceding reduction proved: Theorem: ETM is undecidable. Proof (recap): suppose ETM is decidable we showed how to use ETM to decide ATM conclude ATM is decidable. Contradiction. February 1, 2019 CS21 Lecture 11