




























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth exploration of recursion and recursive definitions, covering various applications such as sets, strings, sequences, functions, and algorithms. Topics include recursive definitions for sets and strings, recursive algorithms for factorial, n choose k, and gcd, and the conversion of recursive definitions to recursive algorithms.
Typology: Study notes
1 / 68
This page cannot be seen from the preview
Don't miss anything!





























































Sets Strings
Recursive definition and inductive proofs are complement each other: a recursive definition usually gives rise to natural proofs involving the recursively defined sequence.
This is follows from the format of a recursive definition as consisting of two parts:
In both induction and recursion, the domino analogy is useful.
It is possible to think of any function with domain
N as a sequence of numbers, and vice-versa.
Such functions can then be defined recursively by
using recursive sequence definition. EG:
To compute the value of a recursive function, e.g. 5!, one plugs into the recursive definition obtaining expressions involving lower and lower values of the function, until arriving at the base case.
To compute the value of a recursive function, e.g. 5!, one plugs into the recursive definition obtaining expressions involving lower and lower values of the function, until arriving at the base case.
recursion
To compute the value of a recursive function, e.g. 5!, one plugs into the recursive definition obtaining expressions involving lower and lower values of the function, until arriving at the base case.
recursion
To compute the value of a recursive function, e.g. 5!, one plugs into the recursive definition obtaining expressions involving lower and lower values of the function, until arriving at the base case.
recursion
L16 13
To compute the value of a recursive function, e.g. 5!, one plugs into the recursive definition obtaining expressions involving lower and lower values of the function, until arriving at the base case.
recursion
initializatio
L16 14