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