Documente Academic
Documente Profesional
Documente Cultură
qaccept
qreject
x x ,R qaccept
x x ,R x x,L
x x ,R
Multiple
reject states One reject state
Fall 2006 Costas Busch - RPI 8
For a decidable language L:
Decision
Decider for L On Halt:
qaccept
Accept
Input
string
Reject
qreject
Corresponding language:
PRIMES {1, 2, 3, 5, 7, }
Proof:
Build a Turing machine M that
accepts L and halts on every input string
( M is decider for L )
Fall 2006 Costas Busch - RPI 14
Transform accept state to reject
and vice-versa
M M
qaccept qreject
qa qa
qreject qaccept
qr qr
L is Turing-acceptable
the complement of a
decidable language is decidable
Therefore, L is undecidable
Fall 2006 Costas Busch - RPI 18
Non Turing-Acceptable L
Turing-Acceptable L
Decidable
Strings of {a } :
M1 , M 2 , M 3 , M 4 ,
L( M1), L( M 2 ), L( M 3 ), L( M 4 ),
L( M i ) {a , a , a }
2 4 6
Binary representation
1 2 3 4 5 6 7
a a a a a a a
L( M i ) 0 1 0 1 0 1 0
Fall 2006 Costas Busch - RPI 24
Example of binary representations
1 2 3 4
a a a a
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
L {a : a L( M i )}
i i
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
L {a , a ,}
3 4
Fall 2006 Costas Busch - RPI 27
Consider the language L
L {a : a L( M i )}
i i
L {a : a L( M i )}
i i
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
L {a , a ,}
1 2
Fall 2006 Costas Busch - RPI 29
Theorem:
Language L is not Turing-Acceptable
Proof:
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
Question: M k M1 ? L( M k ) L
Fall 2006 Costas Busch - RPI 31
1 2 3 4
a a a a
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
1
a L( M k )
Answer: M k M1 1
a L ( M1 )
Fall 2006 Costas Busch - RPI 32
1 2 3 4
a a a a
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
Question: M k M 2 ? L( M k ) L
Fall 2006 Costas Busch - RPI 33
1 2 3 4
a a a a
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
2
a L( M k )
Answer: Mk M2
2
Fall 2006 Costas Busch - RPI
a L( M 2 ) 34
1 2 3 4
a a a a
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
Question: M k M 3 ? L( M k ) L
Fall 2006 Costas Busch - RPI 35
1 2 3 4
a a a a
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
3
a L( M k )
Answer: M k M3
3
Fall 2006 Costas Busch - RPI
a L( M 3 ) 36
Similarly: M k Mi for any i
Because either:
a L( M k )
i
a L( M k )
i
or
a L( M i )
i
a L( M i )
i
L is not Turing-Acceptable
End of Proof
Fall 2006 Costas Busch - RPI 37
Non Turing-Acceptable
L
Turing-Acceptable
Decidable
Is Turing-
Undecidable
Acceptable
L ( M1 ) 0 1 0 1
L( M 2 ) 1 0 0 1
L( M 3 ) 0 1 1 1
L( M 4 ) 0 0 0 1
L {a , a ,}
3 4
Fall 2006 Costas Busch - RPI 41
Theorem: The language
L {a : a L( M i )}
i i
Is Turing-Acceptable
i
Simulate M i on input a
Turing-Acceptable
L {a : a L( M i )}
i i
Not Turing-acceptable
L {a : a L( M i )}
i i
(Thus, L is undecidable)
Fall 2006 Costas Busch - RPI 44
Non Turing-Acceptable
L
Turing-Acceptable
L
Decidable
L?
Fall 2006 Costas Busch - RPI 45
Theorem: L {a : a L( M i )}
i i
is undecidable
Proof: If L is decidable
the complement of a
decidable language is decidable
Then L is decidable
However, L is not Turing-Acceptable!
Contradiction!!!!
Fall 2006 Costas Busch - RPI 46
Not Turing-Acceptable
L
Turing-Acceptable
L
Decidable
(strong result)
A language is Turing-acceptable
if and only if
there is an enumerator for it
Proof:
Let M be the decider for L
a
b
Example:
aa
ab
alphabet is {a, b} (proper order)
ba
bb
aaa
aab
......
Fall 2006 Costas Busch - RPI 51
Enumerator for L
Repeat:
~
1. M generates a string w
2. M checks if w L
YES: print w to output
NO: ignore w
This part terminates,
because L is decidable
Fall 2006 Costas Busch - RPI 52
Enumerator for L
~ M
M Give me
Enumerates all next string
If M accepts wi output
strings of
then print wi to
input alphabet string wi All strings
output
of L
bb accept bb
aaa accept aaa
aab reject
Proof:
~ M
M
Enumerates all
Accepts L
strings of input alphabet
in proper order
Fall 2006 Costas Busch - RPI 56
NAIVE APPROACH
Enumerator for L
Repeat:
~ generates a string w
M
M checks if w L
YES: print w to output
NO: ignore w
Problem: If w L
machine M may loop forever
Fall 2006 Costas Busch - RPI 57
BETTER APPROACH
And so on............
1 1 1 1
Step in
2 2 2 2
computation
of string
3 3 3 3
4 4 4 4
End of Proof
Fall 2006 Costas Busch - RPI 61
Theorem:
If for language L
there is an enumerator
then L is Turing-Acceptable
Proof:
End of Proof
Fall 2006 Costas Busch - RPI 64
By combining the last two theorems,
we have proven:
A language is Turing-Acceptable
if and only if
there is an enumerator for it