Data Structure Lect10

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Discrete Structure

Lecture 10
Topics
 Mathematical Induction

 Mathematical Induction with Examples

 Principal of Mathematical Induction

 Mathematical Induction using All Positive odd integers

 Mathematical Induction using All Positive odd integers


Mathematical Induction

Suppose that we have an infinite ladder, as shown in next slide, and we want to
know whether we can reach every step on this ladder. We know two things:
 1. We can reach the first rung of the ladder.
 2. If we can reach a particular rung of the ladder, then we can reach the next
rung. Can we conclude that we can reach every rung?
By (1), we know that we can reach the first rung of the ladder. Moreover,
because we can reach the first rung,
by (2), we can also reach the second rung; it is the next rung after the first rung.
Applying (2) again, because we can reach the second rung, we can also reach the
third rung.
Climbing an Infinite Ladder
Example of Dominoes
Mathematical Induction

For example, after 100 uses of (2), we know that we can reach the 101st rung.
But can we conclude that we are able to reach every rung of this infinite ladder?

The answer is yes, something we can verify using an important proof technique
called mathematical induction.

That is, we can show that P(n) is true for every positive integer n, where P (n) is
the statement that we can reach the nth rung of the ladder.
Uses of Induction
 Proves the results about the Complexity of Algorithm

 Correctness of certain type of Computer Programs

 Theorem about the Graphs and Trees

 Identities and inequalities


PRINCIPLE OF MATHEMATICAL INDUCTION

To prove that P (n) is true for all positive integers n, where P (n) is a
propositional function, we complete two steps:

BASIS STEP: We verify that P (1) is true.

INDUCTIVE STEP: We show that the conditional statement P (k) → P (k + 1) is true


for all positive integers k.
Example
Show that if n is a positive integer, then
1 + 2 +···+ n = n(n + 1)
2
Prove that P (n) is true for n = 1, 2, 3,....
P (1)is true and that the conditional statement P (k) implies P (k + 1) is true for k
= 1, 2, 3,....
BASIS STEP: P (1) is true, because 1 = 1(1 + 1)/ 2 .
(The left-hand side of this equation is 1 because 1 is the sum of the first positive
integer. The right-hand side is found by substituting 1 for n in n(n + 1)/2.)
INDUCTIVE STEP: For the inductive hypothesis we assume that P (k) holds for an
arbitrary positive integer k. That is, we assume that
1+ 2 +···+ k = k(k +1)/2.
Proof By Mathematical Induction
Under this assumption, it must be shown that P (k + 1) is true, namely, that
1 + 2 +···+ k + (k + 1) = (k + 1)[(k + 1) + 1] = (k + 1)(k + 2)
2 2
is also true. When we add k + 1 to both sides of the equation in P (k), we obtain
1 + 2 +···+ k + (k + 1) = k(k + 1) + (k + 1)
2
= k(k + 1) + 2(k + 1)
2
= (k + 1)(k + 2)
2.
This last equation shows that P (k + 1) is true under the assumption that P (k) is true.
This completes the inductive step.
So by mathematical induction we know that P(n) is true for all positive integers n.
That is, we have proven that 1 + 2 +···+ n = n(n + 1)/2 for all positive integers n.
Sums of Geometric Progressions
Use mathematical induction to prove this formula for the sum of a finite number
of terms of a geometric progression with initial term a and common ratio r:

𝑛
𝑗=0 arj = a + ar + ar2 +···+ arn = arn+1 − a when r ≠ 1,
r−1
where n is a nonnegative integer.
Solution: To prove this formula using mathematical induction, let P (n) be the
statement that the sum of the first n + 1 terms of a geometric progression in this
formula is correct.
BASIS STEP: P(0) is true, because
ar0+1 − a = ar − a = a (r − 1) = a.
r−1 r−1 r−1
Inductive Step
The inductive hypothesis is the statement that P (k) is true, where k is an
arbitrary nonnegative integer. That is, P (k) is the statement that
a + ar + ar2 +···+ ark = ark+1 − a
r−1
To complete the inductive step we must show that if P (k) is true, then P (k + 1)
is also true. To show that this is the case, we first add ark+1 to both sides of the
equality asserted by P (k). We find that
a + ar + ar2 +···+ ark + ark+1 = ark+1 − a + ark+1
r−1
Rewriting the right-hand side of this equation shows that
ark+1 − a + ark+1 = ark+1 − a + ark+2 − ark+1
r−1 r−1 r−1
= ark+2 − a
r−1
Continued
Combining these last two equations gives
a + ar + ar2 +···+ ark + ark+1 = ark+2 − a
r−1
 This shows that if the inductive hypothesis P (k) is true, then P (k + 1) must
also be true. This completes the inductive argument.
Sum of All positive Odd Intergers
 Sum of the first n positive odd integers is nk, that is,
1 + 3 + 5 +··+ (2n − 1) = nk
BASIS STEP:
P (1) states that the sum of the first one odd positive integer is 12. This is true
because the sum of the first odd positive integer is 1. The basis step is complete.
INDUCTIVE STEP: To complete the inductive step we must show that the
proposition P (k) → P (k + 1) is true for every positive integer k. To do this, we
first assume the inductive hypothesis
1 + 3 + 5 +··+ (2n − 1) = nk
1+ 3 + 5 +···+ (2k − 1) = k2.
Continued
1 + 3 + 5 +···+ (2k − 1) + (2k + 1) = (k + 1) 2.

So, assuming that P (k) is true, it follows that

1 + 3 + 5 +···+ (2k − 1) + (2k + 1) = [1 + 3 +···+ (2k − 1)] + (2k + 1)


= k 2 + (2k + 1)
= k 2 + 2k + 1
= (k + 1) 2

You might also like