Professional Documents
Culture Documents
Mathematical Induction and Recursion
Mathematical Induction and Recursion
Recursion
Mathematical Induction
In general, mathematical induction can be used to prove statements that assert that P(n) is
true for all positive integers n, where P(n) is a propositional function.
A proof by mathematical induction has two parts, a basis step, where we show that P(1) is
true, and an inductive step, where we show that for all positive integers k, if P(k) is true,
then P(k + 1) is true
Project 1
The Recursion and Iteration both repeatedly execute the set of instructions.
Recursion is when a statement in a function calls itself repeatedly.
The iteration is when a loop repeatedly executes until the controlling
condition becomes false.
Recursive vs Iterative Algorithms
Recursive vs Iterative Algorithms
Recursive vs Iterative Algorithms
Programming Projects
Write programs with these input and
output
1. Given a nonnegative integer n, find the nth Fibonacci number using iteration and recursion
2. Given a list of integers and an element x, locate x in this list using a recursive
implementation of a binary search.