110 likes | 387 Views
Lecture 6 Decidability. Jan Maluszynski , IDA, 200 7 http://www.ida.liu.se/~janma janma @ ida.liu.se. Outline. 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
E N D
Lecture 6Decidability Jan Maluszynski, IDA, 2007 http://www.ida.liu.se/~janma janma @ ida.liu.se Jan Maluszynski - HT 2007
Outline 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
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
Example Problems and their languages Acceptance Problem for DFA: check if a given DFA accepts a given string. Language: ADFA = {<B,w> | B is aDFA 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
Decidable Problems An algorithm for a Computational Problem R is a Turing Machine that recognizes/generates the language <R> A problem Ris 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
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
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
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
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
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 Turing-recognizable Hence the complement of ATM is Turing-unrecognizable Jan Maluszynski - HT 2007