Decidability Fall 2003 Costas Busch RPI 1 Decidable
Decidability Fall 2003 Costas Busch - RPI 1
Decidable Languages Recall: A language is decidable (recursive), if there is a Turing machine (decider) that accepts the language and halts on every input string Decision On Halt: Turing Machine Input string Fall 2003 Accept Decider for Reject Costas Busch - RPI 2
Problem: Is number prime? Corresponding language: Fall 2003 Costas Busch - RPI 3
Decider for On input number Divide between : : with all possible numbers and If any of them divides Then reject Else accept Fall 2003 Costas Busch - RPI 4
Thus, PRIMES is decidable 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 Fall 2003 Costas Busch - RPI 5
the decider for the language solves the corresponding problem Decider for PRIMES Accept Input number (Input string) is number prime? Reject Fall 2003 Costas Busch - RPI YES (Accept) NO (Reject) 6
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 2003 Costas Busch - RPI 7
Decider for On input : : Determine whethere is a path from the initial state to any accepting state DFA Decision: Fall 2003 DFA Accept Reject Costas Busch - RPI 8
Problem: Does DFA accept a finite language? Corresponding Language: Decidable language Fall 2003 Costas Busch - RPI 9
Decider for On input : : Check if there is a walk with cycle from the initial state to an accepting state DFA infinite Decision: Fall 2003 finite Accept Reject Costas Busch - RPI 10
Problem: Does DFA accept string ? Corresponding Language: Decidable language Fall 2003 Costas Busch - RPI 11
Decider for : On input string Run DFA : on input string If accepts Then accept Else reject Fall 2003 (and halt) Costas Busch - RPI 12
Problem: Do DFAs and accept the same language? Corresponding Language: Decidable language Fall 2003 Costas Busch - RPI 13
Decider for On input Let : : be the language of DFA Construct DFA such that: (combination of DFAs) Fall 2003 Costas Busch - RPI 14
and Fall 2003 Costas Busch - RPI 15
or Fall 2003 Costas Busch - RPI 16
Therefore, we only need to determine whether which is a solvable problem for DFAs: Fall 2003 Costas Busch - RPI 17
Undecidable Languages undecidable language = language is not decidable There is no decider for the language: there is no Turing Machine that reaches a decision (halts) for all input strings of the language (decision may be reached for some strings) Fall 2003 Costas Busch - RPI 18
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 2003 Costas Busch - RPI 19
We have shown before that there are undecidable languages: Turing recognizable Decidable is Turing recognizable but not decidable Fall 2003 Costas Busch - RPI 20
We will prove that two particular problems are unsolvable: Membership problem Halting problem Fall 2003 Costas Busch - RPI 21
Membership Problem Input: • Turing Machine • String Question: Does accept ? Corresponding language: Fall 2003 Costas Busch - RPI 22
Theorem: is undecidable (The membership problem is unsolvable) Proof: Basic idea: We will assume that is decidable; We will then prove that every decidable language is also Turing recognizable A contradiction! Fall 2003 Costas Busch - RPI 23
Suppose that Input string Fall 2003 is decidable Decider for YES accepts NO rejects Costas Busch - RPI 24
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 2003 Costas Busch - RPI 25
Decider for YES accept (and halt) accepts ? NO Input string Fall 2003 reject (and halt) Costas Busch - RPI 26
Therefore, is decidable Since is chosen arbitrarily, every Turing recognizable language is also decidable But there are Turing recognizable languages which are not decidable Contradiction!!!! Fall 2003 END OF PROOF Costas Busch - RPI 27
We have shown: Undecidable Decidable Fall 2003 Costas Busch - RPI 28
We can actually show: Turing recognizable Decidable Fall 2003 Costas Busch - RPI 29
is Turing recognizable Turing machine that accepts Run : on input If accepts then accept Fall 2003 Costas Busch - RPI 30
Halting Problem Input: • Turing Machine • String Question: Does halt while processing input string ? Corresponding language: Fall 2003 Costas Busch - RPI 31
Theorem: is undecidable (The halting problem is unsolvable) Proof: Basic idea: Suppose that is decidable; we will prove that every decidable language is also Turing recognizable A contradiction! Fall 2003 Costas Busch - RPI 32
Suppose that is decidable Input string Decider for YES NO Fall 2003 Costas Busch - RPI halts on input doesn’t halt on input 33
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 2003 Costas Busch - RPI 34
Decider for NO reject and halts on ? YES Input string Fall 2003 Run with input Costas Busch - RPI halts and accepts accept halts and rejects reject and halt 35
Therefore is decidable Since is chosen arbitrarily, every Turing recognizable language is also decidable But there are Turing recognizable languages which are not decidable Contradiction!!!! Fall 2003 END OF PROOF Costas Busch - RPI 36
An alternative proof Theorem: is undecidable (The halting problem is unsolvable) Proof: Basic idea: Assume for contradiction that the halting problem is decidable; we will obtain a contradiction using a diagonilization technique Fall 2003 Costas Busch - RPI 37
Suppose that Input string Fall 2003 is decidable Decider for YES halts on NO doesn’t halt on Costas Busch - RPI 38
Looking inside Decider for YES Input string: halts on ? NO Fall 2003 Costas Busch - RPI 39
Construct machine : Loop forever YES halts on ? NO If Fall 2003 halts on input Then Loop Forever Else Halt Costas Busch - RPI 40
Construct machine : Copy on tape If halts on input Then loop forever Else halt Fall 2003 Costas Busch - RPI 41
Run with input itself Copy on tape If halts on input Then Else loops forever on input halts on input CONTRADICTION!!! Fall 2003 Costas Busch - RPI END OF PROOF 42
We have shown: Undecidable Decidable Fall 2003 Costas Busch - RPI 43
We can actually show: Turing recognizable Decidable Fall 2003 Costas Busch - RPI 44
is Turing recognizable Turing machine that accepts Run : on input If halts on then accept Fall 2003 Costas Busch - RPI 45
- Slides: 45