P14-Induction.mws

High School Modules > Precalculus by Gregory A. Moore

     Mathematical Induction


An exploration of the method of mathematical induction to prove formulae.

[Directions : Execute the Code Resource section first. Although there will be no output immediately, these definitions are used later in this worksheet.]

  0. Code

>    restart; with(plots):

Warning, the name changecoords has been redefined

>   

>    StandardPlot  :=  proc( expr )
   
 end proc:

  1. The Concept - Sum of Integers Formula


Here is a formula the sum of the first n positive integers.

>    `1 + 2 + 3 + .... + n` = n*(n+1)/2;

`1 + 2 + 3 + .... + n` = 1/2*n*(n+1)


In a sense this formula is a function. Given an integer n, the sum of the first n integers is the value of this formula

>    S := n -> n*(n+1)/2;

S := proc (n) options operator, arrow; 1/2*n*(n+1) end proc


It appears to work for n = 1, n = 2, in fact all n values through 15 at least.

>    S(1); 1;

1

1

>    S(2); 1 + 2;

3

3

>    for k from 1 to 15 do
       `when k = `, k,`, the sum is `,
        sum( j, j = 1..k),` and the formula gives `, S(k); od;

`when k = `, 1, `, the sum is `, 1, ` and the formula gives `, 1

`when k = `, 2, `, the sum is `, 3, ` and the formula gives `, 3

`when k = `, 3, `, the sum is `, 6, ` and the formula gives `, 6

`when k = `, 4, `, the sum is `, 10, ` and the formula gives `, 10

`when k = `, 5, `, the sum is `, 15, ` and the formula gives `, 15

`when k = `, 6, `, the sum is `, 21, ` and the formula gives `, 21

`when k = `, 7, `, the sum is `, 28, ` and the formula gives `, 28

`when k = `, 8, `, the sum is `, 36, ` and the formula gives `, 36

`when k = `, 9, `, the sum is `, 45, ` and the formula gives `, 45

`when k = `, 10, `, the sum is `, 55, ` and the formula gives `, 55

`when k = `, 11, `, the sum is `, 66, ` and the formula gives `, 66

`when k = `, 12, `, the sum is `, 78, ` and the formula gives `, 78

`when k = `, 13, `, the sum is `, 91, ` and the formula gives `, 91

`when k = `, 14, `, the sum is `, 105, ` and the formula gives `, 105

`when k = `, 15, `, the sum is `, 120, ` and the formula gives `, 120


So it
appears  that this formula works - however, how do we know it doesn't fail for some larger value of n? We can't check an infinite number of possible values.

Here is a way. Since we know it works for some values of n, that is a good start. But now if we can show that whenever it works for one value, it also works for the next value, then we'll be certain that it always works. What we are saying is that if it works for n, then if we the next integer, n+1, we should get the value of the formula for S(n+1). Lets see if these two are equal.

>    S(n+1) = S(n) + (n+1);

1/2*(n+1)*(n+2) = 1/2*n*(n+1)+n+1

>    expand(lhs(%)) = expand(rhs(%)) ;

1/2*n^2+3/2*n+1 = 1/2*n^2+3/2*n+1

>    verify(lhs(%), rhs(%), testeq);

true


They are! We have proven the formula is true for all integers n ³ 1. This is, in essence, the method of mathematical induction. There are two indispensable steps :
            

            Mathematical Induction - to Verify a Formula

            1. Show that it works for at least one value of n
            2. Show that whenever it works for a general value of n, it also works for the next value.


The first step is usually very easy - simply plug in a value and show it works for that one value. The second step involves expressing the same value in two different ways, as we did above.

  2. More Examples of Equalities


Here is another example. Lets do this in a more streamlined way following the two steps above.

        Example 2.1  : Prove that 1/(1*2)  + 1/(2*3)  + 1/(3*4)  +...+ 1/(n*(n+1))  = n/(n+1)   
                                 is true for all integers n > 0.

>    S := n -> n/(n+1);

S := proc (n) options operator, arrow; n/(n+1) end proc


                 
Step 1  : Verify for n = 1

>    S(1) = 1/(1*2);

1/2 = 1/2

               

                Step 2 : Show that the formula for S(n+1) holds if it holds for S(n).

>    S(n+1) = S(n) + 1/( (n+1)*( (n+1) + 1) );

(n+1)/(n+2) = n/(n+1)+1/((n+1)*(n+2))

>    simplify(lhs(%)) = simplify(rhs(%)) ;

(n+1)/(n+2) = (n+1)/(n+2)

>    testeq( lhs(%) = rhs(%) );

true


Done!



        Example 2.2  :   1^3+2^3+3^3+%?  .... + n^3 = (1+2+3+%?+n)^2


This one is a little trickier, because we can't simply add another term to find S(n+1) because S(n) is a square. To get around this, we can take the sqareroot of S(n), add (n+1)^3, then square that result to demonstrate the veracity of this formula.

>    restart:
S := n -> sum( k, k = 1..n)^2 ;

S := proc (n) options operator, arrow; sum(k,k = 1 .. n)^2 end proc


                 
Step 1  : Verify for n = 1

>    S(1) = 1^3;

1 = 1

               

                Step 2 : Show that the formula for S(n+1) holds if it holds for S(n).

>    S(n+1) = sqrt( S(n) + (n+1)^3) ^2;

(1/2*(n+2)^2-1/2*n-1)^2 = 1/4*(2+3*n+n^2)^2

>    simplify(lhs(%)) = simplify(rhs(%)) ;

1/4*(2+3*n+n^2)^2 = 1/4*(2+3*n+n^2)^2

>    testeq( lhs(%) = rhs(%) );

true


Done!



        Example 2.3  : Prove that 1  + 2  + 2^2  +...+ 2^n  = 2^(n+1)-1   
                                 is true for all integers n > 0.

>    S := n -> 2^(n+1) - 1;

S := proc (n) options operator, arrow; 2^(n+1)-1 end proc


                 
Step 1  : Verify for n = 1

>    S(1) = 1;

3 = 1

               

                Step 2 : Show that the formula for S(n+1) holds if it holds for S(n).

>    S(n+1) = S(n) + 2^(n+1);

2^(n+2)-1 = 2*2^(n+1)-1

>    simplify(lhs(%)) = simplify(rhs(%)) ;

4*2^n-1 = 4*2^n-1

>    testeq( lhs(%) = rhs(%) );

true


Done!

  3. Induction & Inequalities


When we are trying to prove an inequality rather than an equation, we go through the same two general steps, but we can't express the result as a function.

       Example 3.1  : Prove that    2*n+1 <= n^2    is true for all integers 3 <= n .

>    Inequal :=  2*n + 1 <= n^2;

Inequal := 2*n+1 <= n^2


                 
Step 1  : Verify for n = 3 (the smaller number we can start at in this case)

>    subs( n = 3, Inequal);
verify(lhs(%), rhs(%) ,{'less_than','equal'});

7 <= 9

true

               

                Step 2 : Show that the formula for S(n+1) holds if it holds for S(n).  Let's substitute n+1 for n, in the left side of the inequality,
               with the hope of showing it is less than the right side.

>    LHS := subs( n = n+1, lhs(Inequal) );

LHS := 2*n+3

>    % = '(2*n + 1),` + `,2';

2*n+3 = (2*n+1, ` + `, 2)


                Since we know the the inequality is true for n, we can make this statement :

>    LHS < ''n^2 + 2'';

2*n+3 < ('n^2+2')

              Also, by hypothesis :

>    2 < n;

2 < n

>    2 < 2*n + 1;

0 < 2*n-1

>    'LHS' < 'n^2 + (2*n+1)';

LHS < n^2+2*n+1

>    n^2 + (2*n+1): % = factor(%) ;

n^2+2*n+1 = (n+1)^2

>    LHS < (n+1)^2;

2*n+3 < (n+1)^2

>    subs( n = n+1, Inequal);

2*n+3 <= (n+1)^2

So we have demonstrated the inequality is also true for n+1!


        Example 3.2  : Prove that    n^2 <= 2^n  is true for all integers 4 <= n .

>    Inequal := n^2 <= 2^n;

Inequal := n^2 <= 2^n


                 
Step 1  : Verify for n = 4

>    subs( n = 4, Inequal);
verify(lhs(%), rhs(%) ,{'less_than','equal'});

16 <= 16

true

               

                Step 2 : Show that S(n+1) follows if S(n) is true. We can assume that n^2 <= 2^n .

>    LHS := subs( n = n+1, lhs(Inequal) );

LHS := (n+1)^2

>    expand(%);

n^2+2*n+1


                   Using the inequality above in example 3.1....

>    LHS := %; LHS <= n^2 + n^2;

LHS := n^2+2*n+1

n^2+2*n+1 <= 2*n^2

                   Using the fact that n^2 <= 2^n

>    2*n^2 <= 2*(2^n);

2*n^2 <= 2*2^n

>    2*n^2 <= 2^(n+1);

2*n^2 <= 2^(n+1)


Done!



 

  4. Divisibility


Here is another variation - demonstrating that an expression is divisible by some number for all integers plugged into the formula.

       Example 4.1  : Prove that   n^3+14*n+3  is divisible by 3 for all integers n > 0.

>    S := n -> n^3 + 14*n + 3;

S := proc (n) options operator, arrow; n^3+14*n+3 end proc


                 
Step 1  : Verify for n = 1

>    S(1);
%/3;

18

6

               

                Step 2 : Show that the formula for S(n+1) holds if it holds for S(n).

>    S(n+1);

(n+1)^3+14*n+17

>    expand(%);

n^3+3*n^2+17*n+18


              Lets take the difference of S(n+1) and S(n) - this will eliminate the
n^3 .

>    difference := S(n+1) - S(n);

difference := (n+1)^3+14-n^3

             We expand the difference and find that each term is divisible by three!

>    expand(%);

3*n^2+3*n+15

>    %/3;

n^2+n+5

             This proves it. Do you see how? S(n+1) = S(n) + a polynomial divisible by three. Since both polynomials
             on the right are divisible by 3, then so is the left side, since they are equal.

>    S(n+1) = 'S(n) + 3*(%)';

(n+1)^3+14*n+17 = S(n)+3*n^2+3*n+15


         © 2002 Waterloo Maple Inc