Recursively Enumerable and Recursive Languages 1 Definition A
Recursively Enumerable and Recursive Languages 1
Definition: A language is recursively enumerable if some Turing machine accepts it 2
Let be a recursively enumerable language and the Turing Machine that accepts it For string : if then halts in a final state if then halts in a non-final state or loops forever 3
Definition: A language is recursive if some Turing machine accepts it and halts on any input string In other words: A language is recursive if there is a membership algorithm for it 4
Let be a recursive language and the Turing Machine that accepts it For string : if then halts in a final state if then halts in a non-final state 5
We 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 6
Non Recursively Enumerable Recursive 7
We will first prove: • If a language is recursive then there is an enumeration procedure for it • A language is recursively enumerable if and only if there is an enumeration procedure for it 8
Theorem: if a language is recursive then there is an enumeration procedure for it 9
Proof: Enumeration Machine Enumerates all strings of input alphabet Accepts 10
If the alphabet is then can enumerate strings as follows: 11
Enumeration procedure Repeat: generates a string checks if YES: print NO: to output ignore End of Proof 12
Example: Enumeration Output 13
Theorem: if language is recursively enumerable then there is an enumeration procedure for it 14
Proof: Enumeration Machine Enumerates all strings of input alphabet Accepts 15
If the alphabet is then can enumerate strings as follows: 16
NAIVE APPROACH Enumeration procedure Repeat: generates a string checks if YES: print NO: Problem: If machine to output ignore may loop forever 17
BETTER APPROACH Generates first string executes first step on Generates second string executes first step on second step on 18
Generates third string executes first step on second step on third step on And so on. . . 19
Step in string 1 1 2 2 3 3 20
If for any string machine halts in a final state then it prints on the output End of Proof 21
Theorem: If for language there is an enumeration procedure then is recursively enumerable 22
Proof: Input Tape Machine that accepts Enumerator for Compare 23
Turing machine that accepts For input string Repeat: • Using the enumerator, generate the next string of • Compare generated string with If same, accept and exit loop End of Proof 24
We have proven: A language is recursively enumerable if and only if there is an enumeration procedure for it 25
A Language which is not Recursively Enumerable 26
We want to find a language that is not Recursively Enumerable This language is not accepted by any Turing Machine 27
Consider alphabet Strings: 28
Consider Turing Machines that accept languages over alphabet They are countable: 29
Example language accepted by Alternative representation 30
31
Consider the language consists from the 1’s in the diagonal 32
33
Consider the language consists from the 0’s in the diagonal 34
35
Theorem: Language is not recursively enumerable 36
Proof: Assume for contradiction that is recursively enumerable There must exist some machine that accepts 37
Question: 38
Answer: 39
Question: 40
Answer: 41
Question: 42
Answer: 43
for any Similarly: Because either: or 44
Therefore, the machine cannot exist Therefore, the language is not recursively enumerable End of Proof 45
Observation: There is no algorithm that describes (otherwise would be accepted by some Turing Machine) 46
Non Recursively Enumerable Recursive 47
A Language which is Recursively Enumerable and not Recursive 48
We want to find a language which Is recursively enumerable There is a Turing Machine that accepts the language But not recursive The machine doesn’t halt on some input 49
We will prove that the language Is recursively enumerable but not recursive 50
51
Theorem: The language is recursively enumerable 52
Proof: We will give a Turing Machine that accepts 53
Turing Machine that accepts For any input string • Compute , for which • Find Turing machine (using the enumeration procedure for Turing Machines) • Simulate • If on input accepts, then accept End of Proof 54
Observation: Recursively enumerable Not recursively enumerable (Thus, also not recursive) 55
Theorem: The language is not recursive 56
Proof: Assume for contradiction that Then is recursive: Take the Turing Machine that accepts halts on any input: If If accepts then rejects then accept 57
Therefore: is recursive But we know: is not recursively enumerable thus, not recursive CONTRADICTION!!!! 58
Therefore, is not recursive End of Proof 59
Non Recursively Enumerable Recursive 60
- Slides: 60