CS Master Introduction to the Theory of Computation

  • Slides: 10
Download presentation
CS Master – Introduction to the Theory of Computation Lecture 6 Decidability Jan Maluszynski,

CS Master – Introduction to the Theory of Computation Lecture 6 Decidability Jan Maluszynski, IDA, 2007 http: //www. ida. liu. se/~janma @ ida. liu. se Jan Maluszynski - HT 2007 1

CS Master – Introduction to the Theory of Computation Outline 1. 2. 3. 4.

CS Master – Introduction to the Theory of Computation Outline 1. 2. 3. 4. 5. 6. 7. 8. 9. Lecture 6 : Decidability (Sipser 4. 1 – 4. 2) Motivation What is a problem? Problem vs. Language Decidable and semi-decidable problems. Examples of decidable problems Undecidability: the diagonalization method The halting problem is undecidable More examples of undecidable problems Existence of unrecognizable languages. Reducibility and examples of its application Jan Maluszynski - HT 2007 2

CS Master – Introduction to the Theory of Computational problems vs. Languages Computational problem:

CS Master – Introduction to the Theory of Computational problems vs. Languages Computational problem: a function from input data to output data more generally a relation R on data Data encoded as strings Relations encoded as set of strings For a given encoding R is represented as a language <R> Computing R => generating strings of <R> Jan Maluszynski - HT 2007 3

CS Master – Introduction to the Theory of Computation Example Problems and their languages

CS Master – Introduction to the Theory of Computation Example Problems and their languages Acceptance Problem for DFA: check if a given DFA accepts a given string. Language: ADFA = {<B, w> | B is a. DFA that accepts w} Emptiness Problem for DFA EDFA = {<A> | A is a DFA and L(A) is empty} Equivalence Problem for DFA EQDFA = {<A, B> | A, B are DFAs and L(A)=L(B)} Jan Maluszynski - HT 2007 4

CS Master – Introduction to the Theory of Computation Decidable Problems An algorithm for

CS Master – Introduction to the Theory of Computation Decidable Problems An algorithm for a Computational Problem R is a Turing Machine that recognizes/generates the language <R> A problem R is decidable iff there exists a TM that decides <R>. Encoding is a one-one onto function. Thus there is a correspondence between different encodings. Jan Maluszynski - HT 2007 5

CS Master – Introduction to the Theory of Computation Examples of Decidable Problems •

CS Master – Introduction to the Theory of Computation Examples of Decidable Problems • All problems in slide 4, e. g. : DFA Acceptance Problem: Construct a TM that on input <B, w> simulates B on w If the simulation ends in accept state accept, otherwise reject • Parsing problem for CFG argue why • Emptiness problem for CFG argue why Jan Maluszynski - HT 2007 6

CS Master – Introduction to the Theory of Computation An Undecidable Problem Given a

CS Master – Introduction to the Theory of Computation An Undecidable Problem Given a TM M and a string w check if M accepts w ATM = {<M, w> | M is a TM that accepts w} Simulation of M on w may loop! But ATM is Turing-recognizable Jan Maluszynski - HT 2007 7

CS Master – Introduction to the Theory of Computation ATM is undecidable Assume the

CS Master – Introduction to the Theory of Computation ATM is undecidable Assume the contrary: there exists a TM H that accepts <M, w> if M accepts w rejects <M, w> otherwise Construct TM D that runs on descriptions of TM’s: on input <M> D runs H on input <M, <M>> and: accepts if M does not accept <M> rejects if M accepts <M> D(<D>) accepts if D does not accept <D> rejects if D accepts <D> : contradiction Jan Maluszynski - HT 2007 8

CS Master – Introduction to the Theory of Computation Turing-unrecognizable languages The set of

CS Master – Introduction to the Theory of Computation Turing-unrecognizable languages The set of all Turing machines is countable The set of all languages over a given alphabet is not countable! There are languages not recognizable by a TM! Turing-unrecognizable languages Jan Maluszynski - HT 2007 9

CS Master – Introduction to the Theory of Computation A Turing-unrecognizable language L is

CS Master – Introduction to the Theory of Computation A Turing-unrecognizable language L is decidable iff both L and its complement are Turing-recognizable. Explain why! ATM = {<M, w> | M is a TM that accepts w} We proved ATM is undecidable and Turingrecognizable Hence the complement of ATM is Turingunrecognizable Jan Maluszynski - HT 2007 10