Busch Complexity Lectures: Undecidable Problems (unsolvable problems) Prof. Busch - LSU 1
Decidable Languages Recall that: A language A is decidable, if there is a Turing machine that accepts the language halts on every input string Turing Machine A M Input string Decider for A M (decider) and Decision On Halt: YES Accept NO Reject Prof. Busch - LSU 2
A computational problem is decidable if the corresponding language is decidable We also say that the problem is solvable Prof. Busch - LSU 3
Problem: Does DFA M accept the empty language? L(M) = Corresponding Language: EMPTY DFA = X { M : M is a DFA that accepts empty language } Description of DFA M (Decidable) as a string (For example, we can represent M as a binary string, as we did for Turing machines) Prof. Busch - LSU 4
Decider for : On input M : EMPTY DFA Determine whether there is a path from the initial state to any accepting state DFA M DFA M L(M) L(M) = Decision: Reject M Accept M Prof. Busch - LSU 5
Problem: Does DFA M a finite language? accept Corresponding Language: X (Decidable) FINITE DFA = { M : M is a DFA that accepts a finite language} Prof. Busch - LSU 6
Decider for FINITE DFA : On input M : Check if there is a walk with a cycle from the initial state to an accepting state DFA M DFA M Decision: infinite finite Reject M (NO) Accept M (YES) Prof. Busch - LSU 7
Problem: Does DFA M accept string w? Corresponding Language: X (Decidable) A DFA = { M, w : M is a DFA that accepts stringw } Prof. Busch - LSU 8
Decider for : A DFA On input string M,w : Run DFA M on input string w If M accepts w Then accept M,w Else reject M,w (and halt) (and halt) Prof. Busch - LSU 9
Problem: Do DFAs M 1 and M 2 accept the same language? Corresponding Language: EQUAL DFA = { M, M2 : M1 and 2 1 M X the same languages} (Decidable) aredfas that accept Prof. Busch - LSU 10
Decider for : EQUAL DFA On input M,M 1 2 : Let Let L 1 L 2 be the language of DFA be the language of DFA M 1 M 2 Construct DFA M such that: L ( M) = ( L L ) ( L L ) 1 2 1 2 (combination of DFAs) Prof. Busch - LSU 11
( 2 L1 L2 ) ( L1 L ) = L 1 L 2 = and L 1 L 2 = L 1 L 2 L2 L L1 L1 2 L1 L 2 L2 L1 L 1 = L 2 Prof. Busch - LSU 12
( 2 L1 L2 ) ( L1 L ) L 1 L 2 or L 1 L 2 L 1 L L1 2 L 2 L1 L 2 L2 L1 L1 L 2 Prof. Busch - LSU 13
Therefore, we only need to determine whether L ( M) = ( L L ) ( L L ) 1 2 1 2 = which is a solvable problem for DFAs: EMPTY DFA Prof. Busch - LSU 14
Undecidable Languages undecidable language = not decidable language There is no decider: there is no Turing Machine which accepts the language and makes a decision (halts) for every input string (machine may make decision for some input strings) Prof. Busch - LSU 15
For an undecidable language, the corresponding problem is undecidable (unsolvable): there is no Turing Machine (Algorithm) that gives an answer (yes or no) for every input instance (answer may be given for some input instances) Prof. Busch - LSU 16
We have shown before that there are undecidable languages: L Turing-Acceptable L Decidable L is Turing-Acceptable and undecidable Prof. Busch - LSU 17
We will prove that two particular problems are unsolvable: Membership problem Halting problem Prof. Busch - LSU 18
Membership Problem Input: Turing Machine M String w Question: Does M accept w? w L(M )? Corresponding language: A { M, w : M TM = is a Turing machine that accepts stringw } Prof. Busch - LSU 19
Theorem: ATM is undecidable (The membership problem is unsolvable) Proof: Basic idea: We will assume that A TM We will then prove that is decidable; every Turing-acceptable language is also decidable A contradiction! Prof. Busch - LSU 20
Suppose that A TM is decidable Input string M,w Decider for A TM M YES M accepts w w H NO M rejects w Prof. Busch - LSU 21
Let L be a Turing recognizable language Let ML be the Turing Machine that accepts L We will prove that L is also decidable: we will build a decider for L Prof. Busch - LSU 22
String description of ML This is hardwired and copied on the tape next to input string s, and then the pair M L, s is input to H Decider for L s Input string M L Decider for A TM H ML accepts s? YES NO accept (and halt) reject (and halt) Prof. Busch - LSU 23 s s
Therefore, L is decidable Since L is chosen arbitrarily, every Turing-Acceptable language is decidable But there is a Turing-Acceptable language which is undecidable Contradiction!!!! END OF PROOF Prof. Busch - LSU 24
We have shown: Undecidable A TM Decidable Prof. Busch - LSU 25
We can actually show: Turing-Acceptable A TM Decidable Prof. Busch - LSU 26
A is Turing-Acceptable TM Turing machine that accepts A TM : 1. Run M on input w M,w 2. If accepts M then accept w M,w Prof. Busch - LSU 27
Halting Problem Input: Turing Machine M String w Question: Does M halt while processing input string? w Corresponding language: HALT TM = { M, w : M is a Turing machine that halts on input stringw } Prof. Busch - LSU 28
Theorem: HALTTM is undecidable (The halting problem is unsolvable) Proof: Basic idea: Suppose that we will prove that HALT TM is decidable; every Turing-acceptable language is also decidable A contradiction! Prof. Busch - LSU 29
Suppose that HALT TM is decidable Input string M,w M Decider for YES M halts on input w w HALT TM NO M doesn t halt w on input Prof. Busch - LSU 30
Let L be a Turing-Acceptable language Let ML be the Turing Machine that accepts L We will prove that L is also decidable: we will build a decider for L Prof. Busch - LSU 31
Decider for L s M L Decider for HALT TM M L halts on s? NO YES reject s and halt Input string Run M L with input s M L halts and accepts M L halts and rejects accept and halt reject and halt s s Prof. Busch - LSU 32
Therefore, L is decidable Since L is chosen arbitrarily, every Turing-Acceptable language is decidable But there is a Turing-Acceptable language which is undecidable Contradiction!!!! END OF PROOF Prof. Busch - LSU 33
An alternative proof Theorem: HALTTM 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 Prof. Busch - LSU 34
Suppose that HALT TM is decidable Input string M,w Decider for HALTTM M YES M halts on w H w NO M doesn t halt on w Prof. Busch - LSU 35
Looking inside H Decider for HALTTM Input string: H M, w q0 q accept q reject YES M halts on w? NO Prof. Busch - LSU 36
Construct machine H ʹ : H ʹ Loop forever H q accept YES qa qb M,w q 0 M halts on w? q reject NO w If M halts on input Then Loop Forever Else Halt Prof. Busch - LSU 37
Construct machine F : F M Copy M on tape M,M H ʹ If M halts on input M Then loop forever Else halt Prof. Busch - LSU 38
Run F with input itself F F Copy F on tape F,F H ʹ If F halts on input F Then F loops forever on input F Else F halts on input F CONTRADICTION!!! END OF PROOF Prof. Busch - LSU 39
We have shown: Undecidable HALTTM Decidable Prof. Busch - LSU 40
We can actually show: Turing-Acceptable HALT TM Decidable Prof. Busch - LSU 41
HALT TM is Turing-Acceptable Turing machine that accepts : HALT TM 1. Run M on input w M,w 2. If M halts on then accept w M,w Prof. Busch - LSU 42