- Asked 2/7
- 2072 Chaitra
- 2073 Chaitra
Recursive language and its properties
Short answer
A recursive language is decidable: a Turing machine halts on all inputs and accepts exactly the strings in L. Properties: closed under complement, union, intersection, difference; recursive ⊂ RE; L is recursive iff L and its complement are RE; membership is decidable; hierarchy: regular ⊂ CFL ⊂ CSL ⊂ recursive ⊂ RE.
What is a recursive language? Mention its properties.
Definition
A language L is recursive (also called decidable or Turing-decidable) if there is a Turing machine M that halts on every input and accepts exactly the strings of L: M accepts w if w ∈ L and halts in a rejecting state (or with no move) if w ∉ L. Such a TM is called a decider or an algorithm for L.
This differs from a recursively enumerable (RE) language, where the TM must halt and accept for w ∈ L but may loop forever for w ∉ L.
Examples: every regular language and every CFL; { aⁿbⁿcⁿ }; the set of prime numbers in binary.
Properties
- Closed under complement. Run the decider and swap accept and reject.
- Closed under union and intersection. Run both deciders on the input (one after the other) and accept if either (union) or both (intersection) accept. Both always halt.
- Closed under difference (L1 − L2 = L1 ∩ L2ᶜ), concatenation, Kleene star and reversal.
- Recursive ⊂ RE. Every recursive language is RE, but not conversely (the halting language is RE but not recursive).
- L is recursive if and only if both L and its complement Lᶜ are RE.
- Membership is decidable: for a recursive L, the question "is w in L?" always has an algorithmic yes/no answer.
- Hierarchy: regular ⊂ CFL ⊂ context sensitive ⊂ recursive ⊂ RE ⊂ all languages.
- Recursive languages are not closed under arbitrary homomorphism (RE languages are).
If L is RE but not recursive, then its complement is not RE.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Recursive iff language and complement are RE · Theory of Computation, chapter 4 · asked 2×
- Recursive and recursively enumerable languages · Theory of Computation, chapter 4
- BST properties and recursive search · Data Structure and Algorithm, chapter 6
- Recursion properties, Fibonacci, TOH algorithm · Data Structure and Algorithm, chapter 5
- Closure properties of regular languages · Discrete Structure, chapter 2 · asked 2×
- Ideal op-amp properties; non-inverting gain · Basic Electronics Engineering, chapter 4 · asked 3×