Mod 4
Mod 4
P (n) 1 +2 + + n =
n(n + 1)
2
; 8 2Nn ;
P (n) 1
2
+ 2
2
+ +n
2
=
n(n + 1)(2n + 1)
6
; 8 2N
n ;
8 2N
2
P (n) 1
3
+2
3
+ +n
3
=
n(n + 1)
2
; n ;
X n n
i a 8 2N
+1
1
P (n) a = ; n ;
i=0
a 1
P (n) n! > 2
n for n 4;
P (n) 1
2
+
1
4
+
1
8
+ +
1
2
n < 1; n 1
1
But how can we prove that P (n) is true for all n 2 N?
The principle of mathematical induction (PMI) can be used to prove statements about natural
numbers.
The principle of mathematical induction: Let A be a set of natural numbers such that
the following two properties hold:
(1) 1 2 A;
(2) for every natural number n
if n 2 A then n+ 1 2 A: (1)
Then
A = N f = g
1; 2; : : : ;
that is, A is the set of natural numbers for which P is true. The goal is to show that A is the same as
the set of all natural numbers, that is, A = N. Imagine that one verifies that P (1) is true. Then we
can set A = f1g. Let’s now assume that one can prove step (2) of PMI (that we shall call the inductive
step). Thus since we know that 1 2 A , and we know the inductive step is valid, say for n = 1 , we
conclude that 2 2 A. Therefore, A = f g, that is,
1; 2 P (1) and P (2) are true. But using again the
inductive step, we conclude that 3 2 A . Etc. Actually, PMI allows us to replace the imprecise “etc”
by A = N, that is, P (n) is true for all natural numbers!
But why is PMI true, in the first place? We demonstrate its truth using the proof by contradiction.
Suppose that (1) and (2) of PMI hold but A is not equal to N. Hence, it must be at least one natural
number is omitted from N. Let n0 be the first number (smallest) among omitted from N. We 1; 2; : : :
know that n0 cannot be 1 since we assumed that 1 2 A by (1) of PMI. But by our construction, n0
1 2 A . Then by step (2) of PMI we must conclude that n0 2 A , which is the desired contradiction.
Therefore, A = N.
Let us introduce some additional notation. The first step (1) of PMI is called the basis step, while
the second step is known as the inductive step. It is usually trivial to verify the basis step, and most
work has to be done to prove the inductive step. We shall illustrate it on the following example.
Example 2: Prove the first identity above about the sum of n consecutive natural numbers, that is,
n
X
i =
n(n + 1)
; n 1:
i =1
2
2
In this case, the property P (n) is a predicate saying that the above is true for n, and
We prove P (n) is true for all n (i.e., A = N) using PMI. We need to go through the basis step and
the inductive step.
Basis Step: We must prove P (1) is true, but this was already established before.
Inductive Step: We now assume that P (n) is true for a fixed but arbitrary n. The above assumption
is called the inductive hypothesis and in our case it takes the following form
n
X n(n + 1)
S n := i =
i=1
2
for arbitrary n. (In the above symbol := means equal by definition.) The reader must understand that
the statement immediately above and the statement that we want to prove are not the same, even if
they look alike. In the statement above we assume that the identity to be proved (about all sums of
the first n consecutive natural numbers) is true for one value of n (but an arbitrary one).
We now perform the inductive step. We must establish the inductive step, that is, to show that the
formula for Sn above implies that
nX +1
(n + 1)(n + 2)
S n +1 = i =
i=1
2
is true, too. Observe that above we replaced n by n + 1 (on the left-hand side of the equation as well
as on the right-hand side). Indeed, we have
n
X
S n +1 = 1 + 2 + + n + (n + 1) = i + (n + 1)
i =1
n(n + 1)
= + (n + 1)
2
n
= (n + 1) + 1
2
(n + 1)(n + 2)
= ;
2
where in the second line above we invoked the induction hypothesis, in the third line we factored out
the term (n + 1) , and then added what is left. This is exactly what we need to prove the inductive
step.
But, there is actually another, direct, proof originally proposed by the 18th century mathematician
Pn
Carl Friedrich Gauss. Let, as before, Sn =
i =1
i . We write the sum Sn twice one starting the sum
from 1 up to n, and the second time starting from n down to 1. Then, we add the individual elements
vertically. Here is what comes out:
3
Sn = 1 + 2 + + (n 1) + n
Sn = n + n 1 + + 2 + 1
2S n = (n + 1) + (n + 1) + + (n + 1) + (n + 1)
2S n = n(n + 1):
Again, we recover the same identity.
i =1
6
i=1
2
In the PMI discussed above in the first step we assumed that 1 2 A, however, if we start the induction
from another natural number, say k , then it holds for all n k . This is shown in the next example.
(n + 1)! > 2
n +1
(n + 1)! = n!(n + 1)
>
n
2 (n + 1)
> 2
n +1
:
4
The next two examples require a little bit of work before the induction can be applied.
(1 + x)
n 1 + nx: (2)
Proof. The proof is by induction. In the basis step, we assume n = 1 and verify that (1+x)n 1+nx
is true for 1 + x > 0. Now, we assume (inductive hypothesis) that (1 + x)n 1 + nx is true for an
arbitrary n, and we must prove that
(1 + x)
n+1
1 + (n + 1)x
(1 + x)
n
+1
= (1 + x) (1 + x)
n
by induction
(1 + nx)(1 + x) since 1 +x > 0
2
= 1 + (n + 1)x + nx
1 + (n + 1)x;
where the first inequality is a consequence of the induction assumption (i.e., we know that (1 + x)n
1 + nx so we can replace (1 + x)n by 1 + nx because 1 + x > 0; observe that if 1 + x < 0, then we
had to reverse the inequality sign1 ). The next step is simple algebra, while the last step follows from
the fact that nx2 is nonnegative; it doesn’t matter what the value of x, because a + nx2 a for any
a. This proves the theorem.
2
+
1
4
+
1
8
+ +
1
2
n < 1 (3)
for n 1 . We prove it by induction. The first step for n = 1 is easy to check, so we concentrate on
the inductive step. We adopt the inductive hypothesis, which in this case is
1
2
+
1
4
+
1
8
+ +
1
2
n < 1;
2
+
1
4
+
1
8
+ +
1
2
n +
2
1
n+1
< 1:
A natural approach fails. If we invoke the induction hypothesis to the first n terms of the above, we
will get
1
1 +
2
n +1
1
Think of 3 5 that after multiplying by 3 becomes 9 15.
5
which does not imply that it is less than or equal to 1 since 1=2n+1 > 0 . Here’s how we proceed
1
2
+
1
4
+
1
8
+ +
1
2
n +
2
n
1
+1
=
1
2
+
1
2
1
2
+
1
4
+
1
8
+ +
1
2
n
by induction 1 1
< +
2 2
1;
where in the first line on the right-hand side we factor 1=2 and observe that what is left in the paren-
thesis must be smaller than 1 by the inductive hypothesis. The rest is simple algebra. This proves the
inequality.
In some cases, we must use a generalized mathematical induction that we formulate in a little
different form than before.
If a statement P (n) is true for n = 1 , and if for every n > 1 , the truth of P (n) for all
natural numbers < n implies the truth of P (n) for n, then P (n) is true for all natural
numbers.
The only difference between the basis PMI and the above is that in in the inductive step of the gen-
eralized mathematical induction we assume that the truth of P (1); P (2); : : : ; P (n 1) implies the
truth of P (n). In other words, the second step of the generalized PMI can be written as
f 1; 2; : : : ; n 1g A then n 2 A
Recurrences2
We now apply mathematical induction to establish some facts about recurrences. We come back to
recurrences in Theme 3.
We start with an example that illustrates an application of the generalized mathematical induction.
T (n) = 1 +
2
T (i); n 1: (4)
n
i =0
This is an example of a recurrence that we shall study in some details later in this module. Observe
that we can compute consecutive values T (1), T (2) and so on from the recurrence itself. For example,
2
T (1) = 1 + T (0) = 3;
1
2
T (2) + 1 + (T (0) + T (1)) = 5;
2
T (3) = 7:
2
This subsection can be omitted in the first reading.
6
But can we guess how T (n) grows for arbitrary n. In the table below we computed some numerical
values of T (n) and compared them to the growth of n and n2 .
2
n T (n) n
1 3 1
3 7 9
6 13 36
9 19 81
12 25 144
15 31 225
18 37 324
2
From this table we should observe that T (n) grows faster than n and much slower than n . Let us
then conjecture that3
T (n) 4n log 2 n; n 2: (5)
We now use mathematical induction to prove this guess. Observe that T (2) = 5 8 log 2 2 = 8
(since log2 2 = 1), but T (1) = 3 > 4 log2 1 = 0, therefore, we must start the induction from n = 2.
To carry out the inductive step we shall assume that for all j n 1 the above guess is is true.
We now prove that this guess is also true for n. Indeed,
2 6 2
nX 1
T (n) = 1 + + + T (j)
n n n
j =2
nX 1
induction 8 2
= 1 + + 4j log2 j
n n
j =2
nX
j n
1
log log 8 8
= 1 + + log 2 n j
n n
j
=2
8 8 n(n 1)
= 1 + + log 2 n 1
n n 2
8 8
= 1 + log 2 n 4 log 2 n + 4n log 2 n
n n
n
log2 n; n 2;
4n log 2 n; n 2;
where (i) in the first step we use the recurrence and extract the first two terms from the sum; (ii) in the
second line we use the induction assumption in its general form and bound every T (j) by 4j log2 j
3
We recall that y = logb x is a logarithm to base b of x, that is, it is the exponent to which b must be raised to obtain x
as shown here by = x.
7
for 2 j < n ; (iii) in the third line we observe that log2 j log2 n (since j n) and factor the
constant term log2 n in front of the sum; (iv) in the fourth line we apply the formula for the sum of
the first n 1 consecutive integers proved in Example 2; (v) the fifth line is simple algebra; (vi) in
the sixth line we observe that
8
n
8
n
log2 n
for n 2 and therefore cancel out the terms 8=n; finally the last inequality follows from the fact that
1 4 log 2 n 0 for n 2. (As we said at the beginning of this subsection, if this derivation is too
involved in the first reading, the student can move forward to the next section since it will not be used
in the forthcoming discussion.)
8
Theme 2: Newton’s Summation Formula
From high school we know that
2 2 2
(a + b) = a + 2ab + b ;
3 3 2 2 3
(a + b) = a + 3a b + 3ab + b ;
4 4 3 2 2 3 4
(a + b) = a + 4a b + 6a b + 4ab +b :
for arbitrary n. We shall derive it here, and it is called Newton’s summation formula.
Before we handle the general case of (a+b)n , we must introduce some new notation. In particular,
binomial coefficients also known as Newton’s coefficients. We define for natural k and n k
C (n; k) :=
n!
=
n(n 1) (n k + 1)
;
k!(n k)! k!
C (n; 0) = 1
C (n; 1) = n
(n 1)!(n k) (n 1)!k
= +
k!(n k 1)!(n k) (k 1)!k(n k)!
(n 1)!
= (n k + k)
k!(n k)!
n!
=
k!(n k)!
= C (n; k)
9
where in the second line we multiply and divide the first term by n k and the second term by k .
Then we factorize k nn k and after some simple algebra obtain the desired result.
(
!(
1)!
)!
Now, we are ready to formulate and prove the Newton summation formula.
Proof.4 The proof is by induction with respect to n. The basis step for n = 1 is easy to check since
C (1; 0) = C (1; 1) = 1 .
We now start the inductive step, and postulate that if (7) is true for arbitrary n, then
nX +1
(a + b)
n +1
= C (n + 1; k)a b
k n +1 k
k =0
X n X n
(a + b)
n +1
=
n
(a + b) (a + b) = C (n; k)a
k b
n k +
k n
C (n; k)a b
+1 +1 k
k =0 k =0
= C (n + 1; 0)b
n n +1
+ ab [C (n; 0) + C (n; 1)]
+
2
a b
n 1
[C (n; 1) + C (n; 2)] +
+
k n k
a b
+1
[C (n; k 1) + C (n; k)] +
+
n
a b [C (n; n) + C (n; n 1)] + C (n + 1; n + 1)a
n +1
nX
+1
Lemma1
=
k n k:
C (n + 1; k)a b
+1
k
=0
In the first line above we use mathematical induction and then multiply out. In the next few lines
we group terms with the same power, that is ai bn+1 i for all i. Finally, we applied Lemma 1 (i,e.,
C (n; k) + C (n; k 1) = C (n + 1; k) ) to finish the derivation.
2 4
(1 + x ) :
The above formula can lead to surprisingly interesting identities. Here are two of them
n n
X
2
n = (8)
i =0
i
X n n
0 = ( 1)
i (9)
i =0
i
4
The proof can be omitted in the first reading.
10
The first identity follows immediately from the Newton formula applied to
(1 + 1) ;
n
We shall re-derive these identities using combinatorial arguments in one of the next modules.
11
Theme 3: Recursion and Recurrences
Sometimes it is difficult to define an object explicitly. In such cases, it is better to define this object
in terms of itself but of a smaller size. (Actually, we have seen this principle at work in mathematical
induction.) This process is called recursion and often it is described mathematically by a recurrence.
a n
+1 = 2a : n
a1 = 2;
a2 = 2a1 = 4;
3
a3 = 2a2 = 2(2a1 ) = 8 = 2 ;
4
a4 = 2a3 = 2(2a2 ) = 2(2(2a1 )) = 2 :
In the above we successively used the recurrence ai = 2a i 1 until we reached the initial value a0 and
we know that a0 = 1 . Observe that without knowing a0 we can neither start the recurrence nor finish
it.
Exercise 4D: Derive an explicit formula for the following recurrence for n 1
a n = 3an 1
with a0 = 1 .
We can define some other functions recursively. For example, F (n) = n! can be defined recur-
sively as follows
F (0) = 1;
F (n + 1) = (n + 1)F (n); n 0:
Furthermore, let
n
X
S n= a k
k =0
12
where f k gnk
a
=0
is a given sequence. For a computer to understand such a sum, we must define it
recursively. For example, we can do it this way
S0 = a0 ;
S n +1 = S n + an +1 ; n 0:
But, let us consider a more general recurrences. We underline that in order to start a recurrence we
must define some initial values, and to provide a “method” how to compute the next value. Consider
the following recurrence
a0 = 1;
a n = a n 1 + 2 ;
n n 1:
but what is a general formula for an ? Let us move the term an 1 to the other side of the recurrence
and write down all the values as follows
a1 a0 = 2
2
a2 a1 = 2
3
a3 a2 = 2
:::
a i a i 1 = 2
i
:::
a n 1 a n 2 = 2
n 1
a n a n 1 =
n
2 :
Now, when we add all these equations together most of them will cancel out (we say that the sum
telescopes) except an and a0 giving us
X n
a n a0 =
i
2 ;
i =1
Is this better than the original recurrence? Not yet since we must compute the sum. Actually, in
Module 2 we defined the geometric progression as follows
bn = rn; n = 0; 1; : : :
13
and we derived
X n n
i 6
+1
1 r
S n := r = ; r = 1: (11)
i=0
1 r
Actually, we shall re-prove this formula using mathematical induction. It is easy to check its truth for
n = 0 (the basis step). Let us move to the inductive step. We first assume that the statement above is
true for arbitrary n, and we try to prove that this would imply that
nX +1 n
i
+2
1 r
S n +1 = r = :
i
=0
1 r
We proceed as follows
nX +1
S n +1 = r
i
i =0
X n
=
i n
r + r
+1
i =0
induction 1 r n n
+1
+1
= + r
1 r
1 r
n+1
+r
n +1
r
n+2
= ;
1 r
where in the second line we extract the last term from the sum and write it separately as r n+1 , then
in the next line we apply to the first sum the inductive hypothesis, and finally after some algebra we
prove the desired formula.
Now, we can return to (10) to conclude that
n
X
a n = = 2
n +1
1:
i
=0
Let us solve some more recurrences. This is the only way to learn how to handle them. Let b0 = 0
and
b n = bn 1 + n; n 1:
b n = b n 1 + n
= (b n 2 +n 1) + n
= b n 3 + (n 2) + (n 1) + n
:::
= i
b + (i + 1) + (i + 2) + +n
:::
14
= b0 + 1 + 2 + 3 + (n 1) + n
n
X
= i
i =1
n(n + 1)
=
2
where in the second line we substitute bn 1 = b n 2 + (n 1) , in the third line we start observing
a pattern in which bi is followed by the sum of the first i + 1 natural numbers. Then we apply the
sum of n consecutive natural numbers derived in Example 2. In every step of the above derivation we
used the recurrence itself to reduce it until we reach the value that we know, that is, b0 . We can do it
since in step i we know that bi = b i 1 +i .
Consider now a more complicated recurrence:5
c0 = 0;
c n = 2c n 1 + n:
Let us start the telescoping process and try to find a general pattern. We have
c n = 2c n 1 +n
= 2(2c n 2 + n 1) + n = 2 c
2
n 2 + 2(n 1) + n
=
2
2 (2c n 3 + n 2) + 2(n 1) + n
=
3
2 c n 3 + 2 (n
2
2) + 2(n 1) + n
=
3
2 (2c n 4 + n 3) + 2 (n
2
2) + 2(n 1) + n
=
4
2 c n 4 + 2 (n
3
3) + 2 (n
2
2) + 2(n 1) + n
:::
=
i n i + 2i (n
2 c i) + 2
i 1
cn i +1 + + 2 (n
2
2) + 2(n 1) + n
:::
=
n
2 c0 + 2
n 1
[n (n 1)] + 2
n 2
[n (n 2)] + + 2 (n
2
2) + 2(n 1) + n
nX 1
=
k
2 (n k):
k=0
In the second line above, we substitute cn 1 by 2cn 2 + n 1 and observe that the “additive term”
is now n + 2(n 1) (the additive term is the one that does not involve ci ). After another substitution
the additive term is enlarged to 22 (n 2) + 2(n 1) + n . Now you should be able to see the pattern
which becomes 2i (n i) + 2
i 1
n i
c +1 + + 2 (n
2
2) + 2(n 1) + n . After the last substitution
the additive term is finally 2n 1
[n (n 1)] + 2
n 2
[n (n 2)] + 2
+ 2 (n 2) + 2(n 1) + n .
5
The next two examples can be omitted in the first reading.
15
Now to finish the recurrence we must find a formula for the following sum
nX 1 n
X 1 nX 1
c n= k
2 (n k) = n 2
k k
k2 :
k
=0 k
=0 k =0
Observe that in the first sum we could factorize n since the summation is over k , thus n is fixed. After
this observation, the first sum is easy to estimate. We just found above that it is equal to 2n 1 . But
the second one is harder. To estimate it we first observe that
2
k +1 k = 2k (2
2 1) = 2 :
k
Then
n
X X n
S n =
k
k2 = k2
k
k =0 k =1
X n
= k(2
k k
2 )
+1
k =1
X n X n
= k2
k +1
k2
k
k =1 k =1
X n nX
A
1
(
=
)
k k2
+1
(k + 1)2
k +1
k =1 k =0
X n nX 1
X n
= k2
k +1
k2
k +1
2
k +1
k =0 k =0 k=0
B nX 1 nX 1
X n
(
=
)
k2
k +1
+ n2
n +1
k2
k +1
2
k +1
k =0 k =0 k=0
( C )
n +1 n +1
= n2 0 (2 2)
= (n 1)2
n+1
+ 2:
In line (A) we change the index of summation from k to k + 1, in line (B) we expand the first sum
and observe that it cancels out the second sum, finally in line (C) we apply the geometric sum that we
already discussed above.
Coming back to the recurrence, putting everything together we have
n = 2n
c
+1
n 2
a n = 3an 2
1
; n 1
6
The forthcoming analysis may be completely omitted, and come back only if a student is interested in a better under-
standing of non-linear recurrences.
16
where a0 = 1. It is a non-linear recurrence since an 1 is squared. Telescoping might be difficult for
this recurrence. So we first simplify it. Define bn = log2 a n . Then we have
b0 = 1
bn = 2b n 1 + log 2 3
since log(xy) = log x + log y . Now we are on familiar grounds. Using telescoping we find
b n = (2n 1) log 2 3;
which implies
n n
a n=2 (2 1) log2 3
= 3
2 1
:
Finally, we should say it is always a good idea to verify numerically our solution by comparing its
some initial values to the values computed from the recurrence itself.
17