Lesson 7 - Induction & Recursion
Lesson 7 - Induction & Recursion
Lesson 7 - Induction & Recursion
7.1 Induction
There are many mathematical statements, which state that a certain property holds for all
positive integers. Some examples of such proofs include that for each positive integer n: the
sum of the first n positive integers equals n(n+1)/2, n3 – n is divisible by 3, and 4n+1 >
(n+2)2. The principle of mathematical induction is a proof technique used to verify such
statements. A proof by mathematical induction consists of two parts, namely the basis step
and inductive step. In the basis step, we show that the statement is true for the positive integer
1. Secondly, in the inductive step, we show that if the statement is true for an arbitrary
positive integer, then it must also be true for the next larger integer. The technique can be
mathematically represented as follows;
Remark 1: Note that in the inductive step, we prove that for each integer k, if P(k) is true,
then P(k+1) is also true. That is, we assume that P(k) holds for an arbitrary integer k, and
based on this assumption, known as the inductive hypothesis, we show that P(k+1) also
holds.
1
In a proof by mathematical induction, we learn that P(1) is true through the basis step. Then
by the inductive step, we get to know that P(2) is true because P(1) implies P(2). Similarly,
we know that P(3) is true, because P(2) implies P(3). Continuing along this line of
arguments, it is easy to conclude that P(n) holds true for every positive integer n.
Example 7.1.1
Show that if n is a positive integer, then 1+2+···+n = n(n+1)/2.
Solution:
Let P(n) be the proposition that the sum of the first n positive integers is n(n + 1)/2.
2
Basis Step: Since 1 = 1 (1+1) / 2, it follows that P(1) is true. This completes the basis step.
Inductive Step: We assume that P(k) holds for an arbitrary positive integer k. That is,
1+2+···+k = k(k+1)/2.
Under this assumption, it needs to be proven that P(k + 1) is true, namely, 1 + 2 + ··· + k + (k
+ 1) = (k + 1) [(k + 1) + 1]/2 = (k + 1) (k + 2)/2.
This last equation shows that P(k + 1) is true under the inductive hypothesis that P(k) is true.
This completes the inductive step of the proof.
Since we finished both the basis step and the inductive step, we now conclude that 1+2+···+n
= n(n+1)/2 for all positive integers n.
Example 7.1.2
Use mathematical induction to show that if n is a positive integer, then
1+3+5+7+···+(2n-1) = n2.
Solution:
Let P(n) be the proposition that the sum of the first n odd integers is n2.
Basis Step: Since 1 = 12, it follows that P(1) is true. This completes the basis step.
Inductive Step: We assume that P(k) holds for an arbitrary positive integer k. That is,
1+3+5+7+···+2k-1 = k2.
This last equation shows that P (k + 1) is true under the inductive hypothesis that P (k) is
true. This completes the inductive step of the proof.
Since we finished both the basis step and the inductive step, we now conclude that
1+3+5+7+···+(2n-1) = n2 for all positive integers n.
3
Example 7.1.3
Use mathematical induction to prove the inequality, n < 2n for all positive integers n.
Solution:
Let P(n) be the proposition that n < 2n.
Basis Step: Notice that P(1) is true, because 1 < 21 = 2. This completes the basis step.
Inductive Step: We first assume the inductive hypothesis that P(k) is true for the positive
integer k. That is, k < 2k arbitrary integer k.
Now we need to show that if P(k) is true, then P(k + 1) is also true.
That is, we need to prove the conditional statement that if k < 2k, then k+1 < 2k+1.
To this end, we add 1 to both sides of the inequality in the inductive hypothesis.
Thus we have,
This shows that P(k + 1) holds under the assumption that P(k) is true. The induction step is
thus complete.
Therefore, by the principle of mathematical induction, it can be concluded that n < 2n for all
positive integers n.
Example 7.1.4
Use mathematical induction to prove that n3 - n is divisible by 3 where n is a positive integer.
Solution:
Let P(n) denote the proposition: "n3 - n is divisible by 3."
Basis Step: It is easy to see that the statement P(1) is true because 13 - 1 = 0 is divisible by 3.
This completes the basis step.
Inductive Step: For the inductive hypothesis, we assume that P(k) is true; that is, we assume
that k3 - k is divisible by 3. To complete the inductive step, we need to show that P(k + 1)
follows from P(k). That is to show that (k + 1)3 - (k + 1) is divisible by 3. Notice that
4
Since both terms in this sum are divisible by 3, it follows that (k + 1)3 - (k + 1) is also
divisible by 3.
Because we have finished both the basis step and the inductive step, by the principle of
mathematical induction, we can arrive at the conclusion that n3 - n is divisible by 3 whenever
n is a positive integer.
Most importantly, it can be shown that the well-ordering principle is equivalent to the
statement of the principle of mathematical induction.
Example 7.1.5
Consider the subset of positive integers given by A = {3, 11, 5, 9, 2, 8, 16, 21}. Notice that
the set A has a smallest element by the well-ordering principle. It is easy to observe that the
least element of A is 2.
Example 7.1.6
Let A = {n N: n > 7}. Notice that A is an infinite subset of the set of positive integers. Then,
by the well-ordering principle, the set A has a least element, namely 8.
5
Self-Assessment Exercises:
1. There are infinitely many rungs in a ladder. Suppose that a person climbs the first
rung, and also suppose that if a person can reach a particular rung of the ladder, then
he can reach the next rung. Use mathematical induction to show that the person can
reach every rung.
2. Let P(n) be the statement that 12 + 22 + . . . + n2 = n(n + 1)(2n + 1)/6 for the positive
integer n.
a) What is the statement P(1)?
b) Show that P(n) is true, completing the basis step of the proof.
c) What is the inductive hypothesis?
d) What do you need to prove in the inductive step?
e) Complete the inductive step.
f) Explain why these steps show that this formula is true whenever n is a positive
integer.
n
4. Let = [ ]. Use the principle of mathematical induction to show that M =
5. State the well-ordering property and find the least element of the following sets.
a) {n N: n < 17}.
b) {n N: n > 5}.
c) N − {1, 2, 3}.
6
7.2 Recursion
At times, it is difficult to define an object explicitly. That being said, it may be quite
convenient to define such an object in terms of itself. This process is known as recursion.
Most importantly, we can use recursion to define such mathematical objects as sequences,
functions, and sets. We have previously studied examples of sequences and functions using
an explicit formula. To define such a mathematical object recursively, we first specify some
initial elements in a basis step, and then provide a rule for constructing new elements from
those we already have in a recursive step.
Example 7.2.1
Consider the sequence of powers of 3 given by an = 3n for n = 0, 1, 2, .... Alternatively, this
sequence can be defined recursively by first giving the initial term of the sequence, namely,
ao = 1, and then a rule for finding a term of the sequence from the preceding one, namely,
an+1 = 3an for n = 0,1, 2, .... .
Recursive Step: Give a rule for finding its value at an integer from its values at smaller
integers.
7
Example 7.2.2
Example 8: Suppose that f is defined recursively by f(0) = 3, f(n+1) = 2 f(n) + 3. Find f(1),
f(2), f(3), and f(4).
Solution:
From the recursive definition, it follows that
f(1) = 2f(0) + 3 = 2·3 + 3 = 9,
f(2) = 2f(1) + 3 = 2·9 + 3 = 21,
f(3) = 2f(2) + 3 = 2·21 + 3 = 45,
f(4) = 2f(3) + 3 = 2·45 + 3 = 93.
Example 7.2.3
Give an inductive (recursive) definition of the factorial function F(n) = n!
Solution:
In order to inductively define the factorial function, we first specify the initial value of this
function, namely, F(0) = 1, and then give a rule for finding F(n + 1) in terms of F(n). It is
easy to observe that (n + 1)! = (n + 1) n!, and hence the desired rule is
F(n + 1) = (n + 1) F(n).
Therefore, the inductive definition of the factorial function is,
F(0) = 1;
F(n + 1) = (n + 1) F(n) where n is a positive integer.
Remark 2: It is important to note that recursively defined functions are well defined. This
means that the value of the function at every positive integer is determined in an
unambiguous way. This is a consequence of the principle of mathematical induction.
8
Example 7.2.4
Write a recursive definition of an, where a is a nonzero real number and n is a nonnegative
integer.
Solution:
The recursive definition contains two parts. First, we specify the initial term, namely, a0 = 1.
Then the rule for finding an+1 in terms of an, namely, an+1 = a an. Thus the recursive
definition of an, where a is a nonzero real number and n is a nonnegative integer is as follows,
a0 = 1;
an+1 = a an.
Example 7.2.5
Give a recursive definition for ∑ which is the sum of the first n terms of the sequence,
where k is a positive integer.
Solution:
In the basis step, we have ∑ .
In the inductive step, we write ∑ (∑ )+ .
Hence, the recursive definition is completed
Example 7.2.5
The Fibonacci numbers, f0, f1, f2, … , are defined by the equations, f0 = 0, f1 = 1, and fn = fn-1
+fn-2 for n = 2, 3, 4, … . Let’s find the Fibonacci numbers, f2, f3, f4, f5, and f6.
Solution:
Because the first part of the definition states that f0 = 0 and f1 = 1, it follows from the second
part of the definition that
f2 = f1 + f0 = 1 +0 = 1,
f3 = f2 + f1 = 1 + 1 = 2,
f4 = f3 + f2 = 2 + 1 = 3,
f5 = f4 + f3 = 3 + 2 = 5,
f6 = f5 + f4 = 5 + 3 = 8
9
Self-Assessment Exercises:
1. Give a recursive definition of the sequence {an}, n = 1, 2, 3, . . ., if,
a) an = 6n.
b) an = 2n + 1.
c) an = 5.
d) an = 4n - 2.
2. Find f(1), f(2), f(3), and f(4) if f(n) is defined recursively by f(0) = 1 and for n = 0, 1, 2, . . .
a) f (n + 1) = f(n) + 2.
b) f(n + 1) = 2f(n).
c) f(n + 1) = f(n)2 + f(n) + 1.
3. Find f(1), f(2), f(3), f(4), and f(5), if f(n) is defined recursively by f(0) = 3 and for n = 0, 1,
2, ...
a) f(n + 1) = -2f(n).
b) f(n + 1) = 3f(n) + 7.
c) f(n + 1) = f(n)2 - 2f(n) - 2.
d) f(n + 1) = 3f(n)/3.
Suggested Readings:
Chapter 4: Sections 4.1, 4.2 & 4.3, Kenneth Rosen, (2011) Discrete Mathematics and Its
Applications, 7th Edition, McGraw-Hill Education
10