Professional Documents
Culture Documents
CSC 344 - Algorithms and Complexity
CSC 344 - Algorithms and Complexity
Complexity
Lecture #1 – Review of Mathematical
Induction
1(1 + 1)
If n = 1, then S1 is 1= , which is true.
2
2(2 + 1)
If n = 2, then S2 is 1 + 2 = , which is true.
2
3(3 + 1)
If n = 3, then S3 is 1 + 2 + 3 = ,
which is true. 2
4( 4 + 1)
1+ 2 + 3 + 4 = ,
If n = 4, then S4 is 2
which is true.
Proof by Mathematical Induction, (continued)
• Induction:
Assume 1 + r + r2 + ... + rk = rk+1 −1
r−1
• Show:
1+ r + r2 + ... + rk + rk+1= rk + 2 − 1
r−1
• Now:
1 + r + r2 + ... + rk + rk+1
= rk+1 −1 + rk+1
r−1
Proof of the Geometric Series (continued)
1 + r + r2 + ... + rk + rk+1
= rk+1 −1 + rk+1
r−1
= rk+1 − 1 + (r−1)rk+1
r −1
= rk+1 − 1 + r⋅rk+1 − rk+1
r −1
k+2
= r −1
r −1
QED
Divisibility Property
• Proposition: For any integer n ≥ 1,
7n - 2n is divisible by 5. (P(n))
• Proof (by induction):
1. Basis:
The statement is true for n = 1: (P(1))
71 – 21 = 7 - 2 = 5 is divisible by 5.
Divisibility Property (continued)
( + 1)(2 + 1)(2 + 3)
(2 + 1) =
3