Recursive definition
From Wikipedia, the free encyclopedia
A recursive definition is one that defines something in terms of itself, albeit in a useful way. For that to work, the definition in any given case must be well founded, avoiding an infinite regress. Sometimes inductive definition is used as a synonym.
The difference between a circular definition and a recursive definition is that a recursive definition must have base cases, cases that satisfy the definition without being defined in terms of the definition itself, and all other cases comprising the definition must be "smaller" (closer to those base cases that terminate the recursion).
An example: the prime numbers can be defined as consisting of:
- 2, the smallest prime;
- each positive integer which is not evenly divisible by any of the primes smaller than itself.
The integer 2 is our base case; checking the primality of any larger integer X requires us to know the primality of every integer between X and 2, but each such integer is closer to our base case of 2 than X is.
In contrast, a circular definition has no base cases and defines itself in terms of itself, rather than a version of itself closer to a base case. This leads to a vicious circle. Thus, the quip of "Recursive definition: see Recursive definition" is inaccurate: this is a circular definition.
It is chiefly in logic or computer programming that recursive definitions are found. For example, a "well formed formula" (WFF) can be defined as:
- a symbol which stands for a proposition - like p means "Fred is a lawyer."
- The negation symbol, followed by a WFF - like Np means "It is not true that Fred is a lawyer."
- Any of the four binary connectives (C, A, K, or E) followed by two WFFs. The symbol K means "both are true", so Kpq may mean "Fred is a lawyer and Mary likes music."
The value of such a recursive definition is that it can be used to determine whether any particular string of symbols is "well formed".
- Kpq is well formed, because it's K followed by the atomic WFFs p and q.
- NKpq is well formed, because it's N followed by Kpq, which is in turn a WFF.
- KNpNq is K followed by Np and Nq; and Np is a WFF, etc.
The computer language LISP has a similar definition, and some fans of LISP have playfully constructed acronyms which are recursive but with an infinite regress. Hackers seem to find this a source of immense amusement. For example,
- GNU means "GNU (is) Not Unix" (or "GNU's Not Unix").