# Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)

## Presentation on theme: "Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)"— Presentation transcript:

Fall 2003Costas Busch - RPI1 Decidability

Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider) that accepts the language and halts on every input string Turing Machine Input string Accept Reject Decider for Decision On Halt: Decidable Languages

Fall 2003Costas Busch - RPI3 Is number prime? Corresponding language: Problem:

Fall 2003Costas Busch - RPI4 On input number : Divide with all possible numbers between and If any of them divides Then reject Else accept Decider for :

Fall 2003Costas Busch - RPI5 We also say that the corresponding prime number problem is solvable: we can give an answer (positive or negative) for every input instance of the problem Thus, PRIMES is decidable

Fall 2003Costas Busch - RPI6 (Input string) Accept Reject is number prime? Decider for PRIMES Input number YES NO the decider for the language solves the corresponding problem (Accept) (Reject)

Fall 2003Costas Busch - RPI7 Problem: Does DFA accept the empty language ? Corresponding Language: Description of DFA as a string (For example, we can represent as a binary string, as we did for Turing machines)

Fall 2003Costas Busch - RPI8 Determine whether there is a path from the initial state to any accepting state Decider for : On input : DFA Reject Decision: Accept

Fall 2003Costas Busch - RPI9 Problem: Does DFA accept a finite language? Corresponding Language: Decidable language

Fall 2003Costas Busch - RPI10 Decider for : On input : DFA Reject Decision: Accept Check if there is a walk with cycle from the initial state to an accepting state infinitefinite

Fall 2003Costas Busch - RPI11 Problem: Does DFA accept string ? Corresponding Language: Decidable language

Fall 2003Costas Busch - RPI12 Decider for : On input string : Run DFA on input string If accepts Then accept (and halt) Else reject (and halt)

Fall 2003Costas Busch - RPI13 Problem: Do DFAs and accept the same language? Corresponding Language: Decidable language

Fall 2003Costas Busch - RPI14 Let be the language of DFA Decider for : On input : Construct DFA such that: (combination of DFAs)

Fall 2003Costas Busch - RPI15 and

Fall 2003Costas Busch - RPI16 or

Fall 2003Costas Busch - RPI17 Therefore, we only need to determine whether which is a solvable problem for DFAs:

Fall 2003Costas Busch - RPI18 Undecidable Languages there is no Turing Machine that reaches a decision (halts) for all input strings of the language undecidable language = language is not decidable There is no decider for the language: (decision may be reached for some strings)

Fall 2003Costas Busch - RPI19 For an undecidable language, the corresponding problem is unsolvable: there is no Turing Machine (Algorithm) that gives an answer (solves the problem) for all input instances of the problem (answer may be given for some input instances)

Fall 2003Costas Busch - RPI20 We have shown before that there are undecidable languages: Decidable Turing recognizable is Turing recognizable but not decidable

Fall 2003Costas Busch - RPI21 We will prove that two particular problems are unsolvable: Membership problem Halting problem

Fall 2003Costas Busch - RPI22 Membership Problem Input:Turing Machine String Question: Does accept ? Corresponding language:

Fall 2003Costas Busch - RPI23 Theorem: (The membership problem is unsolvable) Proof: We will assume that is decidable; We will then prove that every decidable language is also Turing recognizable is undecidable Basic idea: A contradiction!

Fall 2003Costas Busch - RPI24 Suppose that is decidable YES accepts NO rejects Decider for Input string

Fall 2003Costas Busch - RPI25 Let be a Turing recognizable language Let be the Turing Machine that accepts We will prove that is also decidable: we will build a decider for

Fall 2003Costas Busch - RPI26 NO YES accept reject Decider for (and halt) Decider for Input string accepts ?

Fall 2003Costas Busch - RPI27 Therefore,is decidable But there are Turing recognizable languages which are not decidable Contradiction!!!! Since is chosen arbitrarily, every Turing recognizable language is also decidable END OF PROOF

Fall 2003Costas Busch - RPI28 We have shown: Decidable Undecidable

Fall 2003Costas Busch - RPI29 We can actually show: Decidable Turing recognizable

Fall 2003Costas Busch - RPI30 Turing machine that accepts : Run on input If accepts then accept is Turing recognizable

Fall 2003Costas Busch - RPI31 Halting Problem Input:Turing Machine String Question: Does halt while processing input string ? Corresponding language:

Fall 2003Costas Busch - RPI32 Theorem: (The halting problem is unsolvable) Proof: Suppose that is decidable; we will prove that every decidable language is also Turing recognizable is undecidable Basic idea: A contradiction!

Fall 2003Costas Busch - RPI33 YES halts on input doesn’t halt on input NO Suppose that is decidable Decider for Input string

Fall 2003Costas Busch - RPI34 Let be a Turing recognizable language Let be the Turing Machine that accepts We will prove that is also decidable: we will build a decider for

Fall 2003Costas Busch - RPI35 halts and accepts halts on ?YES NO Run with input reject accept reject Decider for Input string Decider for and halt halts and rejects and halt

Fall 2003Costas Busch - RPI36 Thereforeis decidable But there are Turing recognizable languages which are not decidable Contradiction!!!! Since is chosen arbitrarily, every Turing recognizable language is also decidable END OF PROOF

Fall 2003Costas Busch - RPI37 Theorem: Proof: Assume for contradiction that the halting problem is decidable; (The halting problem is unsolvable) is undecidable we will obtain a contradiction using a diagonilization technique An alternative proof Basic idea:

Fall 2003Costas Busch - RPI38 YEShalts on doesn’t halt on NO Suppose that is decidable Decider for Input string

Fall 2003Costas Busch - RPI39 Input string: YES NO Looking inside Decider for halts on ?

Fall 2003Costas Busch - RPI40 NO Loop forever YES Construct machine : If halts on input Then Loop Forever Else Halt halts on ?

Fall 2003Costas Busch - RPI41 Construct machine : Copy on tape If halts on input Then loop forever Else halt

Fall 2003Costas Busch - RPI42 Run with input itself Copy on tape If halts on input Then loops forever on input Else halts on input END OF PROOF CONTRADICTION!!!

Fall 2003Costas Busch - RPI43 We have shown: Decidable Undecidable

Fall 2003Costas Busch - RPI44 We can actually show: Decidable Turing recognizable

Fall 2003Costas Busch - RPI45 Turing machine that accepts : Run on input If halts on then accept is Turing recognizable

Download ppt "Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)"

Similar presentations