Describing functions by recursion
Factorial
Factorial
The factorial function, , defined recursively is: ?
Link to original
- Basis step: and .
- Recursive step: If then .
Fibonacci
Fibonacci function
Leonardo Fibonacci asked in 1202: Let’s start with a pair of rabbits that needs one month to mature, and assume that every month each pair produces a new pair that becomes productive after one month. How many new pairs are produced each month?
The Fibonacci function, defined recursively is:
- Basis step: and .
- Recursive step: If then .
This generates a series of integers:
Link to original