0% found this document useful (0 votes)
2 views

Chap6 Complete

Chapter 6 discusses mathematical induction, strong induction, and recursive definitions, including recursively defined functions and sets. It explains the steps of mathematical induction through examples, demonstrating how to prove propositions for all positive integers and inequalities. The chapter also covers applications of induction in proving divisibility and properties of sets.

Uploaded by

Nazetta
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)
2 views

Chap6 Complete

Chapter 6 discusses mathematical induction, strong induction, and recursive definitions, including recursively defined functions and sets. It explains the steps of mathematical induction through examples, demonstrating how to prove propositions for all positive integers and inequalities. The chapter also covers applications of induction in proving divisibility and properties of sets.

Uploaded by

Nazetta
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/ 39

Chapter 6: Induction and Recursion

2022

1/37
Outline

Mathematical Induction

Strong Induction

Recursive Definition
Recursively Defined Functions
Recursively Defined Sets

2/37
Mathematical Induction
I A powerful technique to prove a propositional function,
P(n) is true for every positive integer n.
I based on the “domino e↵ect” principle.
I Consider an infinite row of dominos, labeled 1, 2, 3, . . . ,O
n.
Let P(n) = “domino n is knocked over”. I ways
9
the
Pwill
before premises integer
I If the first domino is knocked over, i.e. P(1) is true, and
if the nth domino is knocked over, it also knocks the
(n + 1)th domino over (P(n) ! P(n + 1) is true). Then
all the dominos are knocked over.

3/37
Mathematical Induction

Steps by mathematical induction to prove that a propositional


function, P(n) is true for every positive integer n = 1, 2, 3, . . ..
inductive step.
if basis step true , tren you can proceed to

1. Basis step: Verify that the proposition P(1) is true


2. Inductive Step: Show that the implication
P(k) ! P(k + 1) is true for every positive integer k

Remark
The assumption that P(k) is true is called the inductive
hypothesis.

4/37
Mathematical Induction
Example
Show that if n is a positive integer,

n(n + 1)
1 + 2 + ... + n =
2

n(n + 1)
Solution: Let P(n) : 1 + 2 + . . . + n =
2
Basis Step: P(1) is true, since
RHS
LAS
=
1(1 + 1)
1 = complete
2 step
* Basis
= 1.
itnot ae
Inductive Step: Assume P(k) is true for an arbitrary positive Step
complet
integer k, i.e. n k =
+k
1 +

k(k + 1)
1 + 2 + ... + k = .true
2
5/37
Mathematical Induction
We want to show that P(k + 1) is true, i.e. (k + 1)((k+ 1) + 1)
= (k + 19k + 2)/2
1 + 2 + . . . + k + (k + 1) = (k + 1)(k + 2)/2. 8
Add into P(K) equations
goal
Add k + 1 to both sides of P(k) to obtain

1 + 2 + . . . + k + (k + 1) = k(k + 1)/2 + (k + 1)
k(k + 1) + 2(k + 1)
=
2
(k + 1)(k + 2)
=
2
Therefore, by mathematical induction,

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

if n is a positive integer.
6/37
work to get
From P(K) ,

k c +

i4)
1 + 27 ...
+ +
+
(k+


(k + 1)(k+ 2)
I
2

m
2(k + D
=+
+

2
② By the mathematical induction
#
P(kil) To be
we have proven
true
.
Mathematical Induction
Often,we will need to show that P(n)is true for
n = b, b + 1, b + 2, . . ., where b is an integer other than 1. We can
use mathematical induction to accomplish this, as long as we
change the basis step by replacing P(1) with P(b).

Example
Use mathematical induction to show that

1 + 2 + 22 + · · · + 2n = 2n+1 1
20 = 20 + 1

for all nonnegative integers n. n =


0, 1 ,
2 3
, ...

Solution: Let P(n) : “1 + 2 + 22 + · · · + 2n = 2n+1 1”


Step completed)
Basis Step: P(0) is true since 20 = 1 = 21 1 (basis
lowest value of n = 0

Inductive Step: Assume that P(k) is true, i.e.

1 + 2 + 22 + · · · + 2k = 2k+1 1.
7/37
Mathematical Induction
Want to prove P(k + 1) is true, i.e. goals

1 + 2 + 22 + · · · + 2k + 2OG
k+1
= 2(k+1)+1 1 =&
2k+2 1.

P(k + 1) : 1 + 2 + 22 + · · · + 2k + 2k+1
= (1 + 2 + 22 + · · · + 2k ) + 2k+1
=S (2k+1 1) + 2k+1
= 2k+1 + 2k+1 1
= 2k+1 (1 + 1) 1
2 · 2k+1 1
I

=
= 2k+2 1 # - that
> we have proven
Thus by
P(k+ 1) is also true
Therefore, by mathematical induction,
.

mathematical inductio n the statement


is true
.

1 + 2 + 22 + · · · + 2n = 2n+1 1
for all nonnegative integers n. 8/37
Mathematical Induction
Example
Use mathematical induction to prove this formula
n
X ar n+1 a
ar j = a+ar +ar 2 +· · ·+ar n = , where r 6= 1. (1)
r 1
j=0

ar n+1 a
Solution: Let P(n) : a + ar + ar 2 + · · · + ar n =
r 1
Basis Step: P(0) is true since
ar a a(r 1)
a= = =a
r 1 r 1
Inductive Step: Assume P(k) is true, i.e.

ar k+1 a
a + ar + ar 2 + · · · + ar k =
r 1
9/37
Mathematical Induction
To show that P(k + 1) is true, add ar k+1 to both sides of this
equation

ar k+1 a
a + ar + ar 2 + · · · + ar k + ar k+1 = + ar k+1
r 1
ar k+1 a ar k+2 ar k+1
= +
r 1 r 1
ar k+2 a
=
r 1
Therefore, we have shown that

ar n+1 a
a + ar + ar 2 + · · · + ar n =
r 1
by mathematical induction.

10/37
Mathematical Induction
Mathematical induction can be used to prove a variety of
inequalities that hold for all positive integers greater than a
particular positive integer. when P(k) 1) =: 2
is the < :
K
+
p(k+ k + 1 < 24
goal
?
Example From PCK) ,
add I on
both sides

Use mathematical induction to prove the inequality n < 2n for all


positive integers n.
2k + 1 24 to
k+ 1 < replace
let
Solution: Let P(n) : “n < 2n ”. I on the right
hand side

Basis Step: P(1) is true, since 1 < 21 = 2. Ek+ (2" + 2


mu
Inductive Step: Assume that P(k) is true for positive integer k, i.e.
k < 2k . We need to show that P(k + 1) is true, i.e. k + 1 < 2k+1 .
Adding 1 to both sides of k < 2k , we have KH2"(I
1)
+

k+1 72k .
21
k + 1 < 2k + 1  2k + 2k = 2k (1 + 1) = 2k · 2 = 2k+1 .
k+ (2k + #
Therefore, by mathematical induction, we have shown that n < 2 n

is true for all positive integers n. 11/37


alb => divisibity
Mathematical Induction
Mathematical induction can be used to prove divisibility results
about integers.

Example
Prove that n3 n is divisible by 3 whenever n is a positive integer.

Solution: Let P(n) = “n3 n is divisible by 3”


Basis Step: P(1) is true, since 13 1 = 0 is divisible by 3.
Inductive Step: Suppose that P(k) is true, i.e. k 3 k is divisible
by 3. (k + Y (

P(k + 1) : (k + 1)3 (k + 1) = (k 3 + 3k 2 + 3k + 1) (k + 1)
3 2
= (k k) + 3k + 3k
3
= (k k) + 3(k 2 + k)

Since both terms are divisible by 3, thus P(k + 1) is divisible by 3.


Therefore, by induction, n3 n is divisible by 3 whenever n is a
positive integer. · 12/37
Mathematical Induction

Example
Show that 7n+2 + 82n+1 is divisible by 57 for every nonnegative
the result will
integer n. give a whole number

Solution:
Let P(n) : 7n+2 + 82n+1 is divisible
+ 2
g2(0)
by 57. +1
70 +

Basis Step: P(0) is true, since 72 + 8 = 57 is divisible by 57.


49 + 8 = 57 ,

Inductive Step: Assume P(k) is true, i.e.


>
- inductive hypothesis

7k+2 + 82k+1 is divisible by 57

13/37
Mathematical Induction
k = (k+ 1)

We want to show that P(k + 1) is true, i.e.


7t 8T +1

7(k+1)+2 + 82(k+1)+1 is divisible by 57

Make use of the inductive hypothesis to obtain


=
7 (k+1)+2
+8 2(k+1)+1
-
= 7k+3 + 82k+3 , 64 = 7 + 57

64 . 82
+)
=
(7 + 5778
= 7 · 7k+2 + 82 · 82k+1 ,
= 7 · 7k+2 + 64 · 82k+1 ,
7
:
7k + 2
of
+ (7 + 57) ·
82k + 1

= 7(7| k+2 + 2k+1


82k+1} .
| · {z
{z8 }) + 57
divisible by 57 divisible by 57

So, P(k + 1) is true. Therefore, by mathematical induction,


7n+2 + 82n+1 is divisible by 57 for every nonnegative integer n.

14/37
Mathematical Induction
Mathematical induction can be used to prove many results
about sets.
Example
Use mathematical induction to show that if S is a finite set
with n elements, where n is a nonnegative integer, then S has
2n subsets. Pca = 20 S
21 23 =
,

subsets s =
313 , 323 31 23 , $
,

Solution:
,

m
zv
- Let P(n): A set with n elements has 2n subsets. y =

Basis Step: P(0) is true, because a set with zero elements, the
empty set, has exactly 20 = 1 subset, namely, itself. O
Inductive Step: Assume that P(k) is true, i.e. every set with k
elements has 2k subsets. Induction hypothesis
We want to show that P(k + 1) is true, i.e. every set with
k + 1 elements has 2k+1 subsets. 15/37
Mathematical Induction
To show this, let T be a set with k + 1 elements. Then,it is
possible to write T = S [ {a}, where a is one of the elements of T
T set minus theextra

and S = T {a} (and hence |S| = k). The subsets of T can be


obtained in the following way. For each subset X of S there are
exactly two subsets of T , namely, X and X [ {a}. These
constitute all the subsets of T and are all distinct.

[
subsets

subsetsT

16/37
Mathematical Induction

We now use the inductive hypothesis to conclude that S has


2k subsets, because it has k elements. We also know that
there are two subsets of T for each subset of S. Therefore,
there are 2 · 2k = 2k+1 subsets of T . This finishes the
inductive argument.
By mathematical induction, we have proved that a set with n
elements has 2n subsets whenever n is a nonnegative integer.
A =
29,, 92 , 93 , ..., anz =2" subsets

=
zaz 2923 Easy
, , , .... Ean3 30 925 3
,
,, ,
a ,
as] ...,
Sa

17/37
Mathematical Induction

18/37
extreme ratumatical
than
Strong Induction more

induction .
round
-you ho to test several

1. Basis Step: Verify that P(1) is true,


2. Inductive Step: We show that the implication
[P(1) ^ P(2) ^ · · · ^ P(k)] ! P(k + 1) is true for all
conjunction
positive integers k.

Example
Show that if n is an integer greater than 1, then n is divisible
by a prime number.
Solution: Let P(n) : “n is divisible by a prime number”
Basis Step: P(2) is true, since 2 is divisible by 2 and 2 itself is
-ath beginning
a prime number. P(K)
because
is true
this is
is
matematical induction not
strog
Inductive Step: Assume that P(j) is true for all positive ind
integers j with j  k. We need to show that P(k + 1) is true.
19/37
Strong Induction

There are two cases to consider:


Case 1: (k + 1) is prime
In this case, P(k + 1) is true since (k + 1) is divisible by itself
where k + 1 is a prime number.

&
Case 2: (k + 1) is composite ab n=

In this case k + 1 = ab where a and b are integers with


2  a < b  k + 1. So by inductive hypothesis, both a and b
are divisible a prime number. Thus, k + 1 is divisible by a
prime number.

Thus, by induction, we have shown that if n is an integer


greater than 1, then n is divisible by a prime number.

20/37
Strong Induction
Example
Consider a game in which two players take turns removing any
positive number of matches they want from one of two piles of
matches. The player who removes the last match wins the
game. Show that if the two piles contain the same number of
matches initially, the second player can always guarantee a win.
Solution:
Let n be the number of matches in each pile and P(n): the
second player can win when there are initially n matches in
each pile.
Basis Step: When n = 1, the first player has only one choice,
removing one match from one of the piles, leaving a single pile
with a single match, which the second player can remove to
win the game.
21/37
Strong Induction
Inductive Step: Assume that P(j) is true for all j with 1  j  k,
i.e. the second player can always win whenever there are j matches,
where 1  j  k in each of the two piles at the start of the game.
k+
/

We need to show that P(k + 1) is true, that is, that the second
player can win when there are initially k + 1 matches in each pile.
k+ 1 - v

So suppose that there are k + 1 matches in each of the two piles at


the start of the game and suppose that the first player removes r
matches (1  r  k) from one of the piles, leaving k + 1 r
matches in this pile. By removing the same number of matches
from the other pile, the second player creates the situation where
there are two piles each with k + 1 r matches.
Because 1  k + 1 r  k, we can now use the inductive
hypothesis to conclude that the second player can always win. We
complete the proof by noting that if the first player removes all
k + 1 matches from one of the piles, the second player can win by
removing all the remaining matches.
22/37
Strong Induction
Some results can be readily proved using either the principle of
mathematical induction or strong induction.

Example
Prove that every amount of postage of 12 cents or more can be
formed using just 4-cent and 5-cent stamps.

Solution: (Math Induction) Let P(n) be the statement that


postage of n cents can be formed using 4-cent and 5-cent stamps.
-
- -

Basis Step: Postage of 12 cents can be formed using three 4-cent


stamps. n 12
=
,3x4P stamps
Inductive Step: Assume that P(k) is true, i.e. postage of k cents
can be formed using 4-cent and 5-cent stamps.
Need to show that P(k + 1) is also true where k 12, i.e. we can
form postage of k + 1 cents using 4-cent and 5-cent stamps.
23/37
4k stamp
no 44 stamp

P((e) :
3x4

P(12 += 2 x
4k +
54
with
replace
the 4d stamp 54 stamp

to get k+ 1 stamp

with 4 .
x4 stamps
Replace all 5 stamps

to get k+ 1 cents stamps


-

P(k) is true , jcents ,


12
<j <K K
? 15
,

k < 15

>
-
K -

3212 cente stamp

P(K-3) is true =P(12)

which means
k+ 1 cents stamp ,
E k- 3 +4 =

k +/
to get
we just need one 44 stamp

cents stamp .
Strong Induction
We consider two cases, when at least one 4-cent stamp has
been used and when no 4-cent stamps have been used.
First, suppose that at least one 4-cent stamp was used to form
postage of k cents. Then we can replace this stamp with a
5-cent stamp to form postage of k + 1 cents.
If no 4-cent stamps were used, we can form postage of k cents
using only 5-cent stamps. Moreover, because k 12, we
needed at least three 5-cent stamps to form postage of k
cents. So, we can replace three 5-cent stamps with four 4-cent
stamps to form postage of k + 1 cents. This completes the
inductive step.
By mathematical induction, P(n) is true for all n 12, i.e. we
can form postage of n cents, where n 12 using just 4-cent
and 5-cent stamps.
24/37
Strong Induction

Solution: (Strong Induction)


Basis Step: We show that P(12), P(13), P(14), and P(15)
are true
I P(12) : three 4-cent stamps
I P(13) : two 4-cent stamps and one 5-cent stamp
I P(14) : one 4-cent stamp and two 5-cent stamps
I P(15) : three 5-cent stamps
Inductive Step: Assume that P(j) is true, i.e. we can form
postage of j cents, for 12  j  k where k 15.
We need to show that P(k + 1) is true, i.e. we can also form
postage of k + 1 cents using just 4-cent and 5-cent stamps.

25/37
Strong Induction

Using the inductive hypothesis, we can assume that P(k 3)


is true because k 3 12, i.e. we can form postage of k 3
cents using just 4-cent and 5-cent stamps.
To form postage of k + 1 cents, we need only add another
4-cent stamp to the stamps we used to form postage of k 3
cents. That is, we have shown that if the inductive hypothesis
is true, then P(k + 1) is also true. Therefore, by strong
induction, every postage of n cents, where n is at least 12, can
be formed using 4-cent and 5-cent stamps.

26/37
Recursive Definition

I Recursion is a process to define an object in terms of


itself.
I Recursion can be used to define sequences, functions and
sets.
I For example, the sequence an = 2n for n = 0, 1, 2, . . . can
be defined recursively as

a0 = 1
an+1 = 2an for n = 0, 1, 2, . . . .

27/37
Recursively Defined Functions

Two steps to define a function with the set of nonnegative


integers as its domain (recursive/ inductive definition):
1. Basis Step: Specify the value of the function at zero.
2. Recursive Step: Give a rule for finding its value at an
integer from its values at smaller integers.

28/37
Recursively Defined Functions
Example
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).

Solution:
2f (0) +

If f (1) = 2f (0) + 3
(0m) =
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
29/37
Recursively Defined Functions
Example
Give an inductive definition of the factorial function
F (n) = n!, n 2 N.
natural num
.

Solution:
Basis Step: F (0) = 1
Recursive Step: Give a rule for finding F (n + 1) from F (n).
(n) (n+ 1)
= Fin +n = (n + 1) !

F (n + 1) = (n + 1)!
= (n + 1) · n!
= (n + 1)F (n)
Therefore the recursive definition of the factorial function is
!
F (0) = 1 ↑
n

F (n + 1) = (n + 1)F (n) for n = 0, 1, 2, . . .


30/37
Recursively Defined Functions

Example
Give a recursive definition of an , where a is nonzero real
positive
number and n is a nonnegative integer.
Solution:

a0 = 1
an+1 = a · an for n = 0, 1, 2, . . .
-

31/37
Recursively Defined Functions

Example
n
X
Give a recursive definition of ak .
k=0
+....
+ an
+92 az
dk do
+
= +

Solution:
an + 1

0
X nence
,
ak+ and
Basis step : ak = a0 k= 0

n= 0 k=0
n+1 n
!
X X
Recursive ak = ak + an+1
:
step k=0 k=0

32/37
Recursively Defined Functions

In some recursive definitions of functions, the values of the


function at the first k positive integers are specified, and a rule
is given for determining the value of the function at larger
integers from its values at some or all of the preceding k
integers.
Fibonacci Numbers Cuse two previous number (

The Fibonacci numbers, f0 , f1 , f2 , . . . are defined by the


equations f0 = 0, f1 = 1, and

fn = fn 1 + fn 2

for n = 2, 3, 4, . . . .

33/37
Recursively Defined Sets
To define a recursively defined set
1. Basis Step: Prescribe one or more elements of the set.

2. Recursive Step: Give a rule for generating elements of the


set in terms of previously prescribed elements.

Remark
Recursive definitions may also include an exclusion rule, which
specifies that a recursively defined set contains nothing other than
those elements specified in the basis step or generated by
applications of the recursive step. 1
u= y 4 ,
=

n +
y = 4+1 = 5tS
as
long is
as it
Example integer value .

Consider the subset S of the set of integers recursively defined by


Basis Step: 3 2 S.
Recursive Step: If x 2 S and y 2 S, then x + y 2 S.
34/37
Recursively Defined Sets

Example
Recursively define the set of natural numbers,
N = {0, 1, 2, 3, . . .}.

Solution:
>
-

Basis Step: 0 2 N
t Recursive Step: Given N = {0, 1, 2, 3, . . . n, . . .}. Let x be the
nth element. Thus, x = n. The next element is n + 1 = x + 1.
So the recursive step is “ If x 2 N, then x + 1 2 N. ”
p- q
Therefore, the recursive definition is
02N
If x 2 N, then x + 1 2 N.

35/37
Recursively Defined Sets go through on ur own

Example
Recursively define the set
S = {n2 |n is a natural number greater than 0}, that is
S = {1, 4, 9, 16, . . . }
need to
you

Solution: know the


pattern
of the set .

Basis Step: 1 2 S
Recursive Step: Given S = {1, 4, 9, 16, . . . , n2 , . . . }.
Let x be the nth element. Thus x = n2 ) n = x 1/2
The next element is (n + 1)2 = n2 + 2n + 1. Substituting
n = x 1/2 , we obtain
n2 + 2n + 1 = (x 1/2 )2 + 2(x 1/2 ) + 1 = x + 2x 1/2 + 1.
Thus the recursive step is “if x 2 S, then x + 2x 1/2 + 1 2 S”.
Therefore the recursive definition is
12S
if x 2 S, then x + 2x 1/2 + 1 2 S. 36/37
Recursively Defined Sets
Example
Recursively define the set
T = {2n 2 | n is a natural number greater than 0}.

Solution:
Basis Step: 0 2 T
Let x be the nth element. Thus x = 2n 2. The next element
is 2n+1 2 = 2 · 2n 2. Substituting 2n = x + 2,
2 · 2n 2 = 2 · (x + 2) 2 = 2x + 2..
So the recursive step is “If x 2 T , then 2x + 2 2 T .”
Therefore, the recursive definition is
02T
If x 2 T , then 2x + 2 2 T
37/37

You might also like