Recursion
Merriam Webster: of, relating to, or constituting a procedure that can repeat itself
indefinitely,
Example: a recursive rule in a grammar
Recursive definition of the natural numbers, N:
- 1 is in N
- If n is in N, then n + 1 is in N
- The set of natural numbers is the smallest set of real numbers satisfying the previous two properties.
Factorial:
1! = 1
2! = 1*2
3! = 1*2*3
N!= 1*2*3*...*(N-1)*N
Recursive definition of factorial, N!:
- 0! = 1
- If N> 0, then N! = N*(N-1)!
Programming: the ability of a function to call itself
Wikepedia: a method of defining functions in which the function being defined is applied within its own definition. The term is also used more generally to describe a process of repeating objects in a self-similar way. For instance, when the surfaces of two mirrors are
almost parallel with each other the nested images that occur are a form of recursion.