Base clause and recursive clause
The base gives the starting values outright; the recursive clause builds larger objects from smaller ones. Both are required.
A recursive definition has a base clause and a recursive clause, and together they must reach every object exactly once. Sequences, sets and structures are all defined this way.
Core ideas
A recursive definition is well formed when every object it defines is built from the base in finitely many steps, and nothing is defined twice.
The base gives the starting values outright; the recursive clause builds larger objects from smaller ones. Both are required.
Each application must move toward the base. A clause that refers to a larger or equal object defines nothing.
A recursive definition with k base clauses is proved about by an induction with k base cases. The shapes match exactly, and that is the point.
The material
Sequences, sets and structures, and the condition that makes a definition legitimate.
Fibonacci needs two base values because its recursive clause reaches back two. The number of base clauses is determined by the recursion, not chosen: one fewer and some values would be undefined, one more and the definition might contradict itself.
A recursive definition is well formed when every object in its domain is produced by finitely many applications of the clauses starting from a base object, and the clauses do not assign two different values to one object.
"f(0) = 1 and f(n) = f(n+1) − 1" defines nothing: computing f(1) requires f(2), which requires f(3), and the recursion never reaches the base. The clause must decrease.
Sets are defined the same way: name some elements outright, then give rules for building more.
BASE: 0 ∈ E. RECURSIVE: if n ∈ E then n + 2 ∈ E. Nothing else is in E. That last sentence is not optional — without it the definition permits any superset.
BASE: the empty string is well formed. RECURSIVE: if s is well formed then so is (s), and if s and t are well formed then so is st. This generates (), (()), ()(), (()()) and nothing else. The Catalan numbers count them, and this path does not reach those.
BASE: the empty tree is a binary tree. RECURSIVE: if L and R are binary trees and v is a value, then the tree with root v, left subtree L and right subtree R is a binary tree. “Rooted Trees and Traversals” in Graphs and Trees traverses exactly this object.
This is where recursion earns its place. A binary tree has no obvious "size parameter" to induct on, but it does have a structure, and “Structural Induction”'s structural induction proves things about it directly.
Given a base value and a rule producing f(n) from f(n−1), there is exactly one function satisfying both. Existence and uniqueness both follow from induction — which is why recursive definitions are legitimate rather than merely suggestive.
Interactive
Iterated and solved, then compared
Method
Base first, then the rule, then the closing sentence.
As many as the recursive clause reaches back. Fibonacci needs two; a three-term recurrence needs three.
Every application must move toward a base. A clause referring to a larger argument defines nothing.
For a recursively defined set, the sentence "and nothing else is in S" is what makes the definition determinate.
Computing the first four or five entries catches an off-by-one in the base or the clause immediately.
Moving n discs between three pegs, never placing a larger on a smaller.
The recursive definition came directly from the structure of the problem — the largest disc can only move once everything above it is out of the way — and the closed form came afterwards. “Solving Linear Recurrences” shows how to derive 2ⁿ − 1 rather than guess it.
Define the set of binary strings with no two consecutive 1s recursively, and unroll the count for lengths 1 to 6. You should get 2, 3, 5, 8, 13, 21 — Fibonacci, which “Recurrence Relations” explains.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.