0% found this document useful (0 votes)
44 views23 pages

Lec08-Induction and Recursion

Uploaded by

yusufyemez1907
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views23 pages

Lec08-Induction and Recursion

Uploaded by

yusufyemez1907
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Discrete

Mathematics

8. Induction and Recursion


Tentative Course Outline

1. Principles of Counting
2. Logic
3. Rules of Inference
4. Proof Methods
5. Set Theory
6. Relations
7. Functions
8. Induction and Recursion
9. Number Theory
10. Probability
11. Graph Theory
12. Graph Theory and Applications
13. Trees
14. Trees and Applications
Outline

1. Mathematical Induction
2. Principle of Mathematical Induction
3. Proving by Mathematical Induction
4. Proving Inequalities
5. Recursive Definitions and Structural Induction
6. Recursively Defined Functions
7. Difference Between Recursion and Induction
Can we conclude that we can reach every rung?
1. Mathematical Induction

Climbing an Infinite Ladder

Suppose we have an infinite ladder and we want to know whether we can reach
every step on this ladder.

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.

• From (1), we can reach the first rung. Then by applying (2), we can reach the
second rung. Applying (2) again, the third rung. And so on.
• We can apply (2) any number of times to reach any particular rung, no matter
how high up.
• This example motivates proof by mathematical induction.
1. Mathematical Induction

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.

“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. “
1. Mathematical Induction Base Case → Inductive Hypothesis→ Conclusion

Induction is the branch of mathematics that is used to prove a result, or a formula, or a statement, or a
theorem. It is used to establish the validity of a theorem or result.

It has two working rules:

1) Base Step: It helps us to prove that the given statement is true for some initial value.
2) Inductive Step: It states that if the theorem is true for the nth term, then the statement is true for
(n+1)th term.

Example: The assertion is that the nth Fibonacci number is at most 2n.

How to prove a statement using induction?


Step 1: Prove or verify that the statement is true for n = 1
Step 2: Assume that the statement is true for n = k
Step 3: Verify that the statement is true for n = k+1, then it can be concluded that the statement is true
for n.
1. Mathematical Induction

• Mathematical induction can be used to prove statements that assert that P (n) is true for all positive
integers n, where P (n) is a propositional function.
• A proof by mathematical induction has two parts, a basis step, where we show that P (1) is true, and
an inductive step, where we show that for all positive integers k, if P (k) is true, then P (k + 1) is
true.

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.
2. Principle of Mathematical Induction

Validity of Mathematical Induction


Remember How Mathematical Induction Works ?

Consider an infinite sequence of We know that the first domino is knocked


dominoes, labeled 1, 2, 3, …, down, i.e., P(1) is true .
where each domino is standing.
We also know that if whenever the kth domino
Let P(n) be the proposition that is knocked over, it knocks over the (k + 1)st
the nth domino is knocked over. domino, i.e, P(k) → P(k + 1) is true for all
positive integers k.

Hence, all dominos are knocked over.


P(n) is true for all positive integers n.
2. Principle of Mathematical Induction

Important Points About Using Mathematical Induction

• Mathematical induction can be expressed as the rule of inference


(P(1) ∧ ∀ k (P(k) → P(k + 1))) → ∀n P(n)

where the domain is the set of positive integers.

• In a proof by mathematical induction it is not assumed that P (k) is true for all positive integers! It is
only shown that if it is assumed that P (k) is true, then P (k + 1) is also true.

• When we use mathematical induction to prove a theorem, we first show that P (1) is true. Then we
know that P(2) is true, because P(1) implies P(2). Further, we know that P(3) is true, because P(2)
implies P(3). Continuing along these lines, we see that P(n) is true for every positive integer n.
Let P (n) be the proposition that the
sum of the first n positive integers,
1 + 2 + · · · n = n (n + 1)/2.
3. Prove by Mathematical Induction

Example: Show that: Note: Once we have this conjecture, mathematical


induction can be used to prove it correct.

Basis Step: We need to prove P(1) is true. 1(1 + 1)/2 = 1. • This last equation shows that P (k + 1)
Inductive Step: Assume true for P(k). is true under the assumption that P (k)
The inductive hypothesis is is true. This completes the inductive
step.
• We have completed the basis step and
the inductive step, so by mathematical
induction we know that P (n) is true for
Under this assumption, it must be shown that P (k + 1) is true, all positive integers n. That is, we have
proven that 1+2+ · · · +n = n (n + 1)/2
for all positive integers n.
3. Prove by Mathematical Induction

Example: Show that (𝑘 + 1)(𝑘 + 2)(2𝑘 + 3)


1! + 2! + 3! + ⋯ + 𝑘 ! + 𝑘 + 1 !
=
6
𝑛(𝑛 + 1)(2𝑛 + 1)
1! + 2! + 3! + ⋯ + 𝑛! =
6
𝑘(𝑘 + 1)(2𝑘 + 1) !
Base Step: We need to prove, P(1) is true. + 𝑘+1 = 𝑘 + 1[ 𝑘 2𝑘 + 1 + 6𝑘 + 6 ]
6
Inductive Step: ∀k p(k)→ p(k+1)
𝑘 + 1 2𝑘 ! + 7𝑘 + 6
We assume , p(k) is true. =
Now, we prove p(k+1) is true 6
𝑘 + 1 𝑘 + 2 2𝑘 + 3
=
(𝑘 + 1)(𝑘 + 2)(2𝑘 + 3) 6
1! + 2! + 3! + ⋯ + 𝑘 ! + (𝑘 + 1)! =
6

Ø P (n) is true for all positive integers n.


3. Prove by Mathematical Induction

Example: Show that

1 + 2" + 2! + 2# + ⋯ + 2$ = 2$%" − 1, for all non-negative integer.

Basis Step: P(0) 2& = 2&%" − 1 = 1


Inductive Step: ∀k p(k)→ p(k+1)
We assume, p(k) is true;
1 + 2" + 2! + 2# + ⋯ + 2' = 2'%" − 1

For p(k+1); For p(k+1);


1 + 2" + 2! + 2# + ⋯ + 2' + 2'%" 2'%"%" − 1

'%" '%" '%!


2'%! − 1
2 -1+ 2 =2 −1
3. Prove by Mathematical Induction

Example:
Use mathematical induction to prove that n3 − n is divisible by 3, for every positive integer n.
Let P(n) be the proposition that n3 − n is divisible by 3.
Basis Step: P(1) is true since 13 − 1 = 0, which is divisible by 3.
Inductive Step: Assume P(k) holds, i.e., k3 − k is divisible by 3, for an arbitrary positive integer k. To
show that P(k + 1) follows:
(k + 1)3 − (k + 1) = (k3 + 3k2 + 3k + 1) − (k + 1)
= (k3 − k) + 3(k2 + k)

By the inductive hypothesis, the first term (k3 − k) is divisible by 3 and the second term is divisible by 3
since it is an integer multiplied by 3.

Therefore, n3 − n is divisible by 3, for every integer positive integer n.


3. Prove by Mathematical Induction

Example: Conjecture and prove correct a formula for the sum of the first n positive odd integers. Then prove
your conjecture.
We have: 1= 1, 1 + 3 = 4, 1 + 3 + 5 = 9, 1 + 3 + 5 + 7 = 16, 1 + 3 + 5 + 7 + 9 = 25.
1 + 3 + 5 + ∙∙∙+ (2n − 1) = n2
We can conjecture that the sum of the first n positive odd integers is n2,
Inductive Hypothesis: 1 + 3 + 5 + ∙∙∙ + (2k − 1) = k2

We prove the conjecture is proved correct with mathematical induction.


Basis Step: P(1) is true since 12 = 1.
Inductive Step: P(k) → P(k + 1) for every positive integer k.
Assume the inductive hypothesis holds and then show that P(k) holds has well.
So, assuming P(k), it follows that: Hence, we have shown
that P(k + 1) follows from
1 + 3 + 5 + ∙∙∙+ (2k − 1) + (2k + 1) =[1 + 3 + 5 + ∙∙∙+ (2k − 1)] + (2k + 1) P(k). Therefore the sum
= k2 + (2k + 1) (by the inductive hypothesis) of the first n positive odd
= k2 + 2k + 1 integers is n2.
= (k + 1) 2
4. Proving Inequalities

Mathematical induction can be used to prove a variety of inequalities that hold for all positive integers
greater than a particular positive integer.

Example:
Use mathematical induction to prove that n < 2n for all positive integers n.

Let P(n) be the proposition that n < 2n.

Basis Step: P(1) is true since 1 < 21 = 2.


Inductive Step: Assume P(k) holds, i.e., k < 2k, for an arbitrary positive integer k.
Must show that P(k + 1) holds. Since by the inductive hypothesis, k < 2k, it follows that:
k + 1 < 2k + 1 ≤ 2k + 2k = 2 ∙ 2k = 2k+1
Therefore n < 2n holds for all positive integers n.
4. Proving Inequalities

Example:
Use mathematical induction to prove that 2n < n!, for every integer n ≥ 4.

Let P(n) be the proposition that 2n < n!.


Basis Step: P(4) is true since 24 = 16 < 4! = 24.
Inductive Step: Assume P(k) holds, i.e., 2k < k! for an arbitrary integer k ≥ 4. To
show that P(k + 1) holds:
2k+1 = 2∙2k
< 2∙ k! (by the inductive hypothesis, because (2 < k+1 )
< (k + 1)k! = (k + 1)!
< (k + 1)!
Therefore, 2 < n! holds, for every integer n ≥ 4.
n

Note that here the basis step is P(4), since P(0), P(1), P(2), and P(3) are all false.
5. Recursive Definitions and Structural Induction

• Sometimes it is difficult to define an object explicitly. It may be easy to define this object in terms of
itself. This process is called recursion.
• We can use recursion to define sequences, functions, and sets.

Example: an = 2n for n = 0, 1, 2, ...


1, 2, 4, 8, 16, 32, ...
Example: After giving the first term, each term of the sequence can be defined from the previous term.

a0 = 1 an+1 = 2an

Definition:
A recursive or inductive definition of a function consists of two steps.
Basis Step: Specify the value of the function at zero.
Recursive Step: Give a rule for finding its value at an integer from its values at smaller integers.
A function f(n) is the same as a sequence a0, a1, … , where ai, where f ( i ) = ai.
6. Recursively Defined Functions

Example: Give a recursive definition of:

Example:
The first part of the definition is
Suppose that f is defined recursively by:
f(0) = 3, f(n + 1) = 2f(n) + 3
Find f(1), f(2), f(3), f(4).
The second part is
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
6. Recursively Defined Functions

Example: Give a recursive definition of the factorial Note:


function F(n) = n! Recursively defined functions should be well defined. It
means for every positive integer, the value of the function
at this integer is determined in an unambiguous way.
Basis step: Find F(0).
F(0) = 1
Example: Assume a is a nonzero real number
Recursive step: Find a recursive formula for F(n+1).
and n is a nonnegative integer. Give a recursive
F(n+1) = (n+1) F(n)
definition of an.
What is the value of F(5)?
F(5) = 5F(4)
Basis step: Find F(0).
= 5 . 4F(3)
F(0) = a0 = 1
= 5 . 4 . 3F(2)
Recursive step: Find a recursive formula for
= 5 . 4 . 3 . 2F(1)
F(n+1).
= 5 . 4 . 3 . 2 . 1F(0)
F(n+1) = a . an = a . F(n)
= 5 . 4 . 3 . 2 . 1 . 1 = 120
6. Recursively Defined Functions

Example : Example :
The Fibonacci numbers are Give a recursive definition of the sequence {an} n = 1, 2, 3, … if an = 5n
defined as follows: a1 = 5
f0 = 0 a2 = 52 = 5.5
f1 = 1 a3 = 53 = 52.5
fn = fn−1 + fn−2 a4 = 54 = 53.5

Find f2, f3 , f4 , f5 . a1 = 5
f2 = f1 + f0 = 1 + 0 = 1 an+1 = 5an , . n⩾1
f3 = f2 + f1 = 1 + 1 = 2
f4 = f3 + f2 = 2 + 1 = 3
f5 = f4 + f3 = 3 + 2 = 5
7. Difference Between Recursion and Induction

Difference between recursion and induction:

Recursion Induction
Recursion is the process in which a function is called again
1. Induction is the way of proving a mathematical statement.
and again until some base condition is met.

2. It is the way of defining in a repetitive manner. It is the way of proving.

3. It starts from nth term till the base case. It starts from the initial till (n+1)th term.

It has two components: It has two steps:


4. • Base condition • Base step
• Recursive step • Inductive step

We backtrack at each step to replace the previous values We just prove that the statement is true for n = 1. Then we
5.
with the answers using the function. assume that n = k is true. Then we prove for n = k+1.

6. No assumptions are made. The assumption is made for n = k

7. It can lead to infinity if no base condition is given. There is no concept of infinity.


References

Discrete Mathematics and Its Applications, 7th Edition, Kenneth H. Rosen.


Discrete
Mathematics

You might also like