Escolar Documentos
Profissional Documentos
Cultura Documentos
Recursively Enumerable
and
Recursive
Languages
Let
and
For string
Definition:
A language is recursive
if some Turing machine accepts it
and halts on any input string
w:
if
w L
then
if
w L
then
In other words:
A language is recursive if there is
a membership algorithm for it
Let
be a recursive language
and
For string
We will prove:
1. There is a specific language
which is not recursively enumerable
(not accepted by any Turing Machine)
w:
if
w L
then
if
w L
then
1
PDF created with pdfFactory Pro trial version www.pdffactory.com
Recursively Enumerable
Recursive
Proof:
Theorem:
if a language L is recursive then
there is an enumeration procedure for it
Enumeration Machine
~
M
Enumerates all
strings of input alphabet
Accepts
L
10
Enumeration procedure
Repeat:
a
b
aa
ab
ba
bb
aaa
aab
~
M generates a string w
checks if
w L
YES: print
NO:
......
11
ignore
End of Proof
w to output
12
2
PDF created with pdfFactory Pro trial version www.pdffactory.com
Theorem:
Example:
~
M
Enumeration
Output
L (M )
a
b
aa
ab
ba
bb
aaa
aab
......
ab
ab
bb
aaa
bb
aaa
......
......
13
Proof:
Enumeration Machine
~
M
14
a
b
aa
ab
ba
bb
aaa
aab
Enumerates all
strings of input alphabet
Accepts L
15
16
NAIVE APPROACH
BETTER APPROACH
Enumeration procedure
Repeat:
~
M
generates a string
checks if
~
M Generates first string w1
w L
YES: print
NO:
w to output
ignore w
w1
~
M Generates second string w2
M
Problem: If w L
machine M
17
w2
second step on
w1
18
3
PDF created with pdfFactory Pro trial version www.pdffactory.com
~
M Generates third string w3
w3
second step on
w2
third step on
w1
Step
in
string
And so on............
19
w1
w2
w3
w4
20
Theorem:
If for language L
there is an enumeration procedure
then L is recursively enumerable
End of Proof
Proof:
21
Input Tape
Repeat:
Machine that
accepts L
Enumerator
for L
22
Compare
End of Proof
24
4
PDF created with pdfFactory Pro trial version www.pdffactory.com
We have proven:
A language is recursively enumerable
if and only if
there is an enumeration procedure for it
A Language which
is not
Recursively Enumerable
25
26
Consider alphabet
Strings:
a1 a 2
{a}
a3
a4
27
28
{a}
L ( M i ) = {a 2 , a 4 , a 6 }
Alternative representation
M 1, M 2 , M 3 , M 4 ,
a1
L(M i ) 0
29
a2
a3
a4
a5
a6
a7
30
5
PDF created with pdfFactory Pro trial version www.pdffactory.com
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
L = {a i : a i L( M i )}
31
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
L = {a i : a i L( M i )}
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
L = {a1 , a 2 , }
33
a1
L = {a i : a i L( M i )}
L = {a , a , }
3
32
34
Theorem:
Language
35
36
6
PDF created with pdfFactory Pro trial version www.pdffactory.com
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
Proof:
Assume for contradiction that
is recursively enumerable
Mk
Question: M k = M1 ?
L(M k ) = L
37
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
Answer:
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
a1 L ( M k )
M k M1
a1 L ( M 1)
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
Answer:
Mk M2
38
Question: M k = M 2 ?
39
40
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
a 2 L(M k )
a 2 L(M 2 )
Question: M k = M 3 ?
41
42
7
PDF created with pdfFactory Pro trial version www.pdffactory.com
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
Similarly:
a i L( M k )
a i L( M i )
a L(M k )
Mk M3
a3 L ( M 3 )
Mk
for any
Because either:
Answer:
M k Mi
or
a i L( M k )
a i L( M i )
43
cannot exist
44
Observation:
There is no algorithm that describes
End of Proof
45
46
A Language which is
Recursively Enumerable
and not Recursive
Recursively Enumerable
Recursive
47
48
8
PDF created with pdfFactory Pro trial version www.pdffactory.com
L = {a i : a i L( M i )}
But not
recursive
There is a
Turing Machine
that accepts
the language
Is recursively enumerable
but not recursive
The machine
doesnt halt
on some input
49
a1
a2
a3
a4
L ( M 1)
L(M 2 )
L( M 3 )
L(M 4 )
L = {a 3 , a 4 , }
50
Theorem:
The language
L = {a i : a i L( M i )}
is recursively enumerable
51
52
Proof:
w = ai
Mi
Simulate
If
Mi
53
Mi
on input
ai
w
54
9
PDF created with pdfFactory Pro trial version www.pdffactory.com
Theorem:
Observation:
Recursively enumerable
L = {a i : a i L( M i )}
The language
L = {a i : a i L( M i )}
is not recursive
Proof:
Assume for contradiction that
L is recursive
56
Therefore:
L is recursive
Then
is recursive:
that accepts
But we know:
M
M
CONTRADICTION!!!!
57
58
L
Therefore,
is not recursive
Recursively Enumerable
L
Recursive
End of Proof
59
60
10
PDF created with pdfFactory Pro trial version www.pdffactory.com