CS210 Slides 10 02 Induction Proofs
CS210 Slides 10 02 Induction Proofs
CS210 Slides 10 02 Induction Proofs
Induction
i
... ...
4
3
...
2
1
Principle of Mathematical Induction
P(0) ∧ ∀k ≥ 0 P(k) → P(k + 1) −→ ∀n ≥ 0 P(n)
Theorem
n
X n(n + 1)
P(n) : i =
2
i=0
ICP 10-1
Formally rewrite to make a (explicit) statement about all positive integers
Theorem
n
X n(n + 1)
∀n ∈ N i = or ∀n ∈ N P(n)
2
i=0
Theorem
n
X n(n + 1)
∀n ∈ N i =
2
i=0
Proof Outline:
Theorem
n
X n(n + 1)
∀n ∈ N i =
2
i=0
Proof:
Basis Step: need to prove that P(0) is true
0
X 0(0 + 1)
P(0) : i =
2
i=0
Theorem
n
X n(n + 1)
∀n ∈ N i =
2
i=0
Proof:
Inductive Step: need to prove that ∀k P(k) → P(k + 1) is true
k
P k(k+1)
Inductive Hypothesis (IH): Assume that P(k) is true i.e. i = 2
i=0
k+1
P (k+1)(k+2)
Given IH, show that P(k + 1) is true, i.e, i = 2
i=0
k+1
P k
P
i = i + (k + 1)
i=0 i=0
k(k + 1)
= + (k + 1) ▷ by the Inductive Hypothesis
2
(k + 1)(k + 2)
= (k + 1)( k2 + 1) = =⇒ P(k + 1) is true
2
Theorem
The sum of first n positive odd integers is n2
ICP 10-2
Restate it formally to make it a statement about all positive integers
Theorem
n
X
+
∀n ∈ Z (2i − 1) = n2
i=1
Theorem
n
X
∀n ∈ Z+ (2i − 1) = n2
i=1
1
X
P(1) : (2i − 1) = 1 = 12
i=1
Clearly true!
Theorem
n
X
∀n ∈ Z+ (2i − 1) = n2
i=1
n+1
X
(2i − 1) = (n + 1)2
i=1
n+1
X
(2i − 1) = (n + 1)2
i=1
n+1
P n
P
(2i − 1) = (2i − 1) + 2(n + 1) − 1
i=1 i=1
= n2 + (2n + 1)
= (n + 1)2
Theorem
Sum of first n powers of 2 is 2n − 1
Start with 20 = 1
Theorem
n−1
X
∀n ∈ N 2i = 2n − 1
i=0
Theorem
n−1
X
∀n ∈ N 2i = 2n − 1
i=0
−1
X
2i = 0 and 20 − 1 = 0
i=0
Inductive Step:
n
X n−1
X
i
2 = 2i + 2n = 2n − 1 + 2n = 2n+1 − 1
i=0 i=0
n n+1
X
2 n(n + 1)(2n + 1) X (n + 1)(n + 2)(2n + 3)
i = =⇒ i2 =
6 6
|i=1 {z } i=1
inductive hypothesis