Title: Recursively Enumerable and Recursive Languages
1- Recursively Enumerable and Recursive Languages
- Slides based on RPI CSCI 2400
- Thanks to Costas Busch
2Definition
A language is recursively enumerable if there is
a Turing machine that accepts it
Also known as Turing Recognizable languages
or Turing Acceptable languages
3Let be a recursively enumerable language
and the Turing Machine that accepts it
For any string
if
then halts in an accept state
then halts in a non-accept state
if
or loops forever
4Definition
A language is recursive if there is a Turing
machine accepts it and the machine halts on
every input string
Also known as decidable languages
5Let be a recursive language
Then there is a Turing machine
that accepts such that
For any string
if
then halts in an accept state
if
Then M halts in a non-accept state
6We will prove
1. There is a specific language which is not
recursively enumerable (not accepted by any
Turing Machine)
2. There is a specific language which is
recursively enumerable but not recursive
7Non Recursively Enumerable
Recursively Enumerable
Recursive
8A Language which is notRecursively Enumerable
9Consider alphabet
Strings
10Consider Turing Machines that accept languages
over alphabet
They are countable
(There is an enumeration procedure that
generates them)
11Each machine accepts some language over
Note that it is possible to have
for
Since, a language could be accepted by more than
one Turing machine
12Example language accepted by
Binary representation
13Example of binary representations
14Consider the language
consists of the 1s in the diagonal
15(No Transcript)
16Consider the language
consists of the 0s in the diagonal
17(No Transcript)
18Theorem
Language is not recursively enumerable
Proof
Assume for contradiction that
is recursively enumerable
There must exist some machine that accepts
19Question
20Answer
21Question
22Answer
23Question
24Answer
25for any
Similarly
Because either
or
the machine cannot exist
is not recursively enumerable
End of Proof
End of Proof
26Non Recursively Enumerable
Recursively Enumerable
Recursive
27A Language which is Recursively Enumerableand
not Recursive
28We will prove that the language
Is recursively enumerable
But not recursive
There is a Turing Machine that accepts
Every machine that accepts doesnt halt on some
input string
29(No Transcript)
30The language
Theorem
is recursively enumerable
Proof
We will give a Turing Machine that accepts
31Turing Machine that accepts
For any input string
(using the enumeration procedure for Turing
Machines)
End of Proof
32Observation
Recursively enumerable
Not recursively enumerable
(Thus, is not recursive either)
33Theorem
If a language is recursive, then its
complement is recursive too
Proof
Build a Turing machine that accepts
and halts on every input
34(accepts and halts on every input string)
Turing Machine
On any input string do
1. Let be the Turing machine that accepts
and halts on every input string
2. Run with input string
If accepts then reject If rejects
then accept
35For all tape symbols not read in the other
transitions of
Transform to
END OF PROOF
36Theorem
is not a recursive language
Proof
If is recursive
The complement of a recursive language is
recursive
Then is recursive
However, is not Turing acceptable!
Contradiction!!!!
37Non Recursively Enumerable
Recursively Enumerable
Recursive
38Turing acceptable languages and Enumeration
Procedures
39We will prove
(weak result)
- If a language is recursive then
- there is an enumeration procedure for it
(strong result)
- A language is recursively enumerable
- if and only if
- there is an enumeration procedure for it
40Theorem
if a language is recursive then there is
an enumeration procedure for it
Proof
Let be the Turing machine that accepts and
halts on every input
Use to build the enumeration procedure for
41Let be an enumerator that prints all
strings from input alphabet in proper order
Example alphabet is
(proper order)
42Enumeration procedure for
Repeat
generates a string
checks if
YES print to output
NO ignore
This part terminates, because is recursive
43Enumeration Machine for
Give me next string
Enumerates all strings of input alphabet
output
If accepts then print to output
string
All strings of
Generates all Strings in alphabet
Tests each string if it is accepted by
44Example
Enumeration Output
reject
accept
reject
accept
reject
accept
accept
reject
END OF PROOF
45Theorem
if language is recursively enumerable
then there is an enumeration procedure for it
Proof
Let be the Turing machine that accepts
Use to build the enumeration procedure for
46Enumeration Machine for
Enumerates all strings of input alphabet in
proper order
Accepts
47NAIVE APPROACH
Enumeration procedure for
Repeat
generates a string
checks if
YES print to output
NO ignore
If machine may loop
forever
Problem
48BETTER APPROACH
Generates first string
executes first step on
Generates second string
executes first step on
second step on
49Generates third string
executes first step on
second step on
third step on
And so on............
50String
1
1
1
1
Step in computation of string
2
2
2
2
3
3
3
3
4
4
4
4
51If for any string machine halts in
an accepting state then it prints on the
output
End of Proof
52Theorem
If for language there is an enumeration
procedure then is recursively enumerable
Proof
Using the enumerator for we will build a Turing
machine that accepts
53Input Tape
Turing Machine that accepts
Compare
Enumerator for
If same, Accept and Halt
Give me the next string in the enumeration
sequence
54Turing machine that accepts
For any input string
Loop
- Using the enumerator of ,
- generate the next string of
- Compare generated string with
If same, accept and exit loop
End of Proof
55By Combining the last two theorems, we have
proven
A language is recursively enumerable if and only
if there is an enumeration procedure for it