Recursive and Enumerable Sets
Chapter overview: This chapter distinguishes sets/languages that can be decided completely from those that can merely be enumerated or recognized. The distinction is fundamental to computability theory.
6.1 Recursive Sets
Introduction / Definition
A recursive set is a set whose membership can be decided by an algorithm that halts on every input. Equivalently, its characteristic function is total computable. For a language L, a decider accepts strings in L and rejects strings not in L, always terminating.
Syntax / Structure / Formula
χ_L(x) = 1 if x ∈ L
χ_L(x) = 0 if x ∉ L
and χ_L is computable and total.
Detailed Explanation
For the language of even-length binary strings, count the input length and return yes if the length is even. The procedure always terminates.
Example
Input: 1010 → length 4 → accept
Input: 101 → length 3 → reject
Output / Result
Every input receives an answer and the algorithm halts.
Important Points / Notes
- Recursive/decidable means total decision procedure.
- Every recursive language is recognizable.
- Complement of a recursive language is also recursive.
Mini Practice Question
Why is guaranteed termination important in a decider?
6.2 Enumerable Sets
Introduction / Definition
An enumerable, or recursively enumerable (RE), set is a set for which members can be generated or recognized effectively, although the procedure may fail to halt for inputs outside the set. A recognizer accepts members and may loop forever on nonmembers.
Syntax / Structure / Formula
x ∈ L ⇒ recognizer eventually accepts x
x ∉ L ⇒ may reject or run forever
Detailed Explanation
The distinction from recursive sets is termination. Every recursive set is enumerable, but not every enumerable set is recursive.
Example
Recognizer for a set of program-input pairs that eventually halt:
Simulate the program; accept if it halts.
Output / Result
For a halting pair, the recognizer eventually accepts; for a non-halting pair, simulation may continue forever.
Important Points / Notes
- RE does not guarantee rejection/termination for nonmembers.
- Recursive ⊂ RE.
- The halting problem provides a classic non-recursive RE example.
Mini Practice Question
State the main difference between recursive and recursively enumerable sets.
6.3 Generators
Introduction / Definition
A generator is a computational procedure that systematically produces members of a set or language. For a countable enumerable language, a generator can list its members, possibly with no fixed time limit for when a particular member appears. Generators are closely connected with enumerable sets.
Syntax / Structure / Formula
- Generator: output x₀, x₁, x₂, ... such that each generated item belongs to L
Detailed Explanation
A generator for natural numbers can output 0,1,2,3,... forever. A generator for even numbers outputs 0,2,4,6,...
Example
0 → 2 → 4 → 6 → 8 → ...
Output / Result
The generator produces exactly members of the intended set.
Important Points / Notes
- Enumeration may continue forever.
- Ordering is not necessarily important.
- Generators are useful for countable sets and search procedures.
Mini Practice Question
Design a generator that outputs all positive multiples of 3.
6.4 Recognizers
Introduction / Definition
A recognizer is an algorithm or machine that accepts every member of a language. For a nonmember, it is allowed to reject or run forever. This differs from a decider, which must halt on every input.
Syntax / Structure / Formula
R(x):
if x ∈ L → accept eventually
if x ∉ L → reject or loop forever
Detailed Explanation
A recognizer for strings containing a particular pattern can scan the string and accept once the pattern appears. For more difficult enumerable problems, the recognizer may simulate another process and wait for evidence of membership.
Example
Input: 001011
Pattern: 101
Recognizer scans and accepts when 101 is found.
Output / Result
Input is accepted once evidence of membership is found.
Important Points / Notes
- Recognizers need not halt on nonmembers.
- Deciders are recognizers with guaranteed halting.
- Recognizers correspond to enumerable languages.
Mini Practice Question
How does a recognizer differ from a decider?