Recursion: Fall 2002 CMSC 203 - Discrete Structures 1
Recursion: Fall 2002 CMSC 203 - Discrete Structures 1
Recursion
a0 = 1
an+1 = 2an for n = 0, 1, 2,
f(0) = 3
f(n + 1) = 2f(n) + 3
f(0) = 3
f(1) = 2f(0) + 3 = 23 + 3 = 9
f(2) = 2f(1) + 3 = 29 + 3 = 21
f(3) = 2f(2) + 3 = 221 + 3 = 45
f(4) = 2f(3) + 3 = 245 + 3 = 93
f(0) = 1
f(n + 1) = (n + 1)f(n)
f(0) = 1
f(1) = 1f(0) = 11 = 1
f(2) = 2f(1) = 21 = 2
f(3) = 3f(2) = 32 = 6
f(4) = 4f(3) = 46 = 24
Conclusion of Part I: A S.
Fall 2002 CMSC 203 - Discrete Structures 10
Recursively Defined Sets
Part II: To show: S A.
Basis step: To show:
All initial elements of S are in A. 3 is in A. True.
Inductive step: To show:
(x + y) is in A whenever x and y are in S.
If x and y are both in A, it follows that 3 | x and
3 | y. From Theorem I, Section 2.3, it follows
that 3 | (x + y).
(x y)
((z / 3) y)
((z / 3) (6 + 5))
((z / (2 * 4)) (6 + 5))
f(4)
f(3) f(2)
f(2)
f(1) f(1) f(0)
f(1) f(0)