1
1.
Basic reminder on induction
2.
Definition of recursion
3
Illustration with the computation of the factorial
Lecture 6: Recursion
3.
4.
Illustration with Fibonacci numbers
5.
The quicksort algorithm
6.
Recursive implementation of the quicksort algorithm
What is induction?
There are some properties which you cannot prove or derive
for all cases, but which can be handled sequentially. For
example, if you want to prove that the following holds
n
(
n
+1)
for all n. First, you would prove a base case, i.e. this relation is
true for n=1 (you can check that this is the case).
Then you will prove this fact by induction, i.e. you will assume
that the property is true up to n, and show that it implies that
1 + 2 + 3 + 4 +
· · ·
+
n
=
2
the property is true up to n+1.
This proves the property by induction.

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*