Chap6 Complete
Chap6 Complete
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
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
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,
.
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
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
Example
Prove that n3 n is divisible by 3 whenever n is a positive integer.
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)
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 +
13/37
Mathematical Induction
k = (k+ 1)
64 . 82
+)
=
(7 + 5778
= 7 · 7k+2 + 82 · 82k+1 ,
= 7 · 7k+2 + 64 · 82k+1 ,
7
:
7k + 2
of
+ (7 + 57) ·
82k + 1
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
[
subsets
subsetsT
16/37
Mathematical Induction
=
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
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
&
Case 2: (k + 1) is composite ab n=
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
Example
Prove that every amount of postage of 12 cents or more can be
formed using just 4-cent and 5-cent stamps.
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
k < 15
>
-
K -
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
25/37
Strong Induction
26/37
Recursive Definition
a0 = 1
an+1 = 2an for n = 0, 1, 2, . . . .
27/37
Recursively Defined Functions
28/37
Recursively Defined Functions
Example
Suppose that f is defined recursively by
① f (0) = 3
② f (n + 1) = 2f (n) + 3.
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
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
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.
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 .
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
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