CSCI 2824: Lecture 9

In this lecture we will talk about the principle of mathematical induction and attempt to prove properties of numbers using induction.

This lecture corresponds to section 2.3 of Ensley and Crawley's book.

Mathematical Induction

Mathematical induction is a very common technique for proving properties of natural numbers (and other discrete structures such as sets, relations and trees that we will study very soon).

Here is a video of falling dominoes: Click here.

Let us imagine an infinitely long sequence of tiles arranged in a straight line (close enough to each other), and let us tip domino number 1.

We wish to argue that every domino will fall. Here is how we can argue:

  • Base case: The first domino falls (we kicked it, so it falls).

  • Inductive Step: Whenever a domino numbered n falls, then its successor numbered n+1, also falls. Therefore, we conclude that all the dominoes will fall.

The argument above is the crux of induction. To prove a property over all natural numbers k, we may argue as follows:

  • The property is true for k=0 (the first natural number).

  • If the property is true for some natural number n then it is true for natural number n+1.


Induction can be really useful to guess and prove closed forms of sequences. Consider a simple one:

 a_n = a_{n-1} + (2 n -1)  mbox{for} n geq 1, mbox{with} a_0 = 0

We have a_0 = 0, a_1 =1, a_2 = a_1 + 3 = 4, a_3 = a_2 + 5 = 9, a_4 = a_3 + 7 = 16,cdots . Therefore here is our guess: a_n = n^2. How do we prove it?

Claim: a_n = n^2.


Proof is by induction on n.

  • Base Case: We verify that a_0 = 0 = 0^2. So this works.

  • Induction Hypothesis: For all n geq 0, If a_n = n^2 then a_{n+1} = (n+1)^2.

    • Proof of induction hypothesis: Let n be any given natural number such that a_n = n^2. We seek to prove that a_{n+1} = (n+1)^2.

 begin{array}{rcll}  a_{n+1} &=& a_n + (2 (n+1) - 1) & [mbox{Apply the recurrence relation}] &=& a_n + 2n + 1  & [mbox{Simpliciation} ]  &=& n^2 + 2n + 1  & [ a_n = n^2, mbox{by induction hypothesis}] &=& (n+1)^2   end{array}

Therefore, we have proved that a_n = n^2 for all n in mathbb{N} by induction.


Theorem The sum of first n numbers Sigma_{j=0}^n j = frac{n (n+1)}{2} .


We prove this fact by induction just like we did for the dominoes.

Base Case: We will verify the fact for n=0. Note that Sigma_{j=0}^0 j  = 0 = frac{0 (0+1)}{2}.

Inductive Hypothesis: For all n in mathbb{N}, If underset{mbox{Theorem holds for n}}{underbrace{Sigma_{j=0}^n j = frac{n (n+1)}{2}}}, then  underset{mbox{Theorem holds for n+1}}{underbrace{sum_{j=1}^{n+1} j = frac{(n+1)(n+2)}{2}}}.

Proof of Inductive Hypothesis

Let n be any given natural number such that Sigma_{j=0}^n j = frac{n (n+1)}{2} holds. We wish to show

 Sigma_{j=0}^{n+1} j = frac{(n+1)(n+2)}{2}

We note that

 begin{array}{rcll} Sigma_{j=0}^{n+1} j &=& left( Sigma_{j=0}^n j right) + (n+1) & [mbox{Peel off last term of the summation}]  &=& frac{n(n+1)}{2} + (n+1)  & [mbox{Assume the induction hypothesis}]  &=& frac{n (n+1) + 2 (n+1)}{2}  & [mbox{Algebra}] &=& frac{ (n+2)(n+1)}{2}  end{array}

Example 3

Let us try the sequence a_n = a_{n-1} + 2n,  n geq 1  mbox{with} a_0 = 0.

First, we guess what the closed form could be:  a_0 = 0, a_1 = 2 = 1 times 2, a_2 = 6 = 2 times 3, a_3 = 12=3 times 4, a_4 = 20 = 4 times 5, a_5= 30 = 5 times 6, ldots .

Claim a_n = n times (n+1), forall n geq 1.


We prove by induction. The base case is for n=0.

  • Base Case: For n=0, we verify a_0 = 0 = 0 times 1.

  • Inductive Hypothesis: For all n geq 0, If a_n = n(n+1) then a_{n+1} = (n+1)(n+2).

 a_{n+1} = underset{mbox{expand}}{underbrace{a_n + 2 (n+1)}} = underset{mbox{ind. hyp.}}{underbrace{n(n+1)}} + 2 (n+1) = (n+2)(n+1)

Weak Induction Proofs

We wish to prove a property P(n) for all natural numbers n. I.e, (forall n in mathbb{N}) P(n).

Proof by (weak) induction proceeds by establishing a base case:

  • Base Case: Verify that P(0) holds.

  • Induction Hypothesis: (forall n geq 0) mbox{IF} P(n) mbox{THEN} P(n+1).

So far, we have been working with weak induction. We will now work with strong induction proofs.

Strong Induction Proofs

In weak induction, we prove that the number n+1 satisfies P by assuming that n (its immediate predecessor) does. That may not always yield the simplest proof.

Example 1

Floor and Ceiling Functions

The function lfloor x rfloor is also called the floor of x. It gives the smallest integer that is less than or equal to x.

The function lceil x rceil is also called the ceil of x. It gives the smallest integer that is greater than or equal to x.

As examples, lfloor{2.9}rfloor = 2 whereas lceil{2.9}rceil = 3. For negative numbers, it is a little counter intuitive: lfloor{-3.1}rfloor = -4 whereas lceil{-3.1}rceil = -3.

Consider the recurrence a_n = a_{lfloor{frac{n}{2}} rfloor} + 1, a_0 = 0.

Here is the result of performing the recurrence on a few values of n.

 begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} hline 0 & 1 & 2 & 3 & 4 & 5 & 6& 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16  hline 0 & 1 & 2 & 2 & 3 & 3 & 3& 3 & 4 & 4 & 4  & 4  & 4  & 4 &  4 & 4 & 5 hline end{array}

Some of you may recognize the pattern (it is rather important one for CS). Here is the guess: a_n = 1+ lfloor log_2 n rfloor for n geq 1 with a_0 = 0.

We can now try proving it by induction. We will first use weak induction.

Theorem For all n in mathbb{N}, If n geq 1 then a_n = 1+ lfloor log_2 n rfloor.

The theorem only applies to natural numbers n geq 1. We handle this by simply allowing the base case of induction to start at n= 1.

Failure of Proof by Weak Induction

Base-Case For n=1, we verify that a_1 = 1 = 1+ log_2 1 .

Inductive Hypothesis: (forall n in mathbb{N}) a_n = 1+ lfloor{log_2 n}rfloor Rightarrow a_{n+1} = 1+lfloorlog_2( n+1 )rfloor.

This is not easy to prove and infact is strictly not true. This is because a_n depends on a_{frac{n}{2}} and not on a_{n-1} like our previous sequences.

Proof by Strong Induction

Strong induction is different from weak in the inductive hypothesis.

  • Weak Induction: Assume P(n) prove P(n+1).

  • Strong Induction: Assume P(k) for all k leq n and prove P(n+1).

Going back to dominoes, we assume in weak induction that the n^{th} domino falls and prove that so does the n+1^{th}. In strong induction, we assume that all dominoes numbered 1,ldots,n fall and prove that in that case the n+1^{th} also falls.

Claim: For all n in mathbb{N}, If n geq 1 then a_n = 1+lfloor log_2 nrfloor.


Proof is by strong induction over n.

Base-Case For n=1 we verify that a_1 = 1 = 1+ log_2 1.

(Advanced note: For strong induction, the base case is really not needed but we will go through it for the sake of uniformity, anyway).

Strong Inductive Hypothesis:

For all n in mathbb{N} If a_k = 1 + lfloorlog_2 krfloor for all k leq n then a_{n+1} = lfloor log_2 (n+1) rfloor.

We will prove the strong induction hypothesis.

 a_{n+1} = a_{leftlfloorfrac{n+1}{2}rightrfloor} + 1

We will split this into two cases based on n being odd or not.

Case-1 Assume n is odd, i.e, n= 2 m +1 for some natural number m. Then lfloor frac{n+1}{2} rfloor = lfloor frac{2m+1+1}{2} rfloor = m + 1 . We have

 a_{n+1} = a_{leftlfloorfrac{n+1}{2}rightrfloor} + 1  = a_{m+1} + 1 = underset{mbox{ind. hyp.}}{underbrace{1 + lfloorlog_2 (m+1) rfloor}} + 1 =  lfloor log_2 (2 (m+1)) rfloor +1 = lfloor log_2 (n+1) rfloor .

Case-2 Assume n is even. I.e, n = 2m for some m in mathbb{N}. Therefore, lfloor frac{n+1}{2} rfloor = lfloor frac{2m +1}{2} rfloor = m .

 a_{n+1} = a_{leftlfloorfrac{n+1}{2}rightrfloor} + 1 = a_m +1 = underset{mbox{ind. hyp.}}{underbrace{1 + lfloorlog_2 m rfloor}} + 1 = lfloor log_2 (2m) rfloor +1 = 1 + lfloor log_2 n rfloor = 1+ lfloor log_2 (n+1) rfloor

There is now an extra proof needed on the side that argues that whenever n is even, log_2 n = log_2 (n+1).

For completeness, here is the proof of the side claim.

Side-Claim: For all natural numbers n geq 1, if n is even, then lfloor log_2 n rfloor = lfloor log_2 (n+1) rfloor.

Side Proof

This is an example of a proof by contradiction.

Let us assume otherwise. I.e., lfloor log_2 n rfloor =k and lfloor log_2 (n+1) rfloor = k+1. In other words, we have

 2^k leq n < 2^{k+1} leq n+1

Since n+1 is odd, we cannot have 2^{k+1} = n+1. Therefore,  n < 2^{k+1} < n+1. As a result, there is a natural number between n and n+1. This is a contradiction. Therefore, it has to be the case that lfloor log_2 n rfloor = lfloor log_2 (n+1) rfloor.