Something I have been incorperating into my seed ai
Recursion is the process of repeating items in a self-similar way. For instance, when the surfaces of two mirrors are exactly parallel with each other the nested images that occur are a form of infinite recursion. The term has a variety of meanings specific to a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics and computer science, in which it refers to a method of defining functions in which the function being defined is applied within its own definition. Specifically this defines an infinite number of instances, using a finite expression that for some instances may refer to other instances, but in such a way that no loop or infinite chain of references can occur. The term is also used more generally to describe a process of repeating objects in a self-similar way.
Formal definitions of recursion
In mathematics and computer science, a class of objects or methods exhibit recursive behavior when they can be defined by two properties:
# A simple base case, and
# A set of rules which reduce all other cases toward the base case.
For example, the following is a recursive definition of a person's ancestors:
One's parents are one's ancestors .
The parents of one's ancestors are also one's ancestors .
The Fibonacci sequence is a classic example of recursion:
Fib is 0
Fib is 1
For all integers n > 1: Fib is + Fib
Many mathematical axioms are based upon recursive rules. For example, the formal definition of the natural numbers in set theory follows: 1 is a natural number, and each natural number has a successor, which is also a natural number. By this base case and recursive rule, one can generate the set of all natural numbers
A more humorous illustration goes: "To understand recursion, you must first understand recursion." Or perhaps more accurate is the following, from Andrew Plotkin: "If you already know what recursion is, just remember the answer. Otherwise, find someone who is standing closer to Douglas Hofstadter than you are; then ask him or her what recursion is."
Recursively defined mathematical objects include functions, sets, and especially fractals.
Recursion in language
Linguist Noam Chomsky theorizes that unlimited extension of any natural language is possible using the recursive device of embedding clauses within sentences. For example, two simple sentences—"Dorothy met the Wicked Witch of the West in Munchkin Land" and "The Wicked Witch's sister was killed in Munchkin Land"—can be embedded in a third sentence, "Dorothy liquidated the Wicked Witch with a pail of water," to obtain a recursive sentence: "Dorothy, who met the Wicked Witch of the West in Munchkin Land where her sister was killed, liquidated her with a pail of water."