cse 311: foundations of computing
Spring 2015
Lecture 15: Induction
prove: for all ๐ > 0, ๐ is odd โ ๐๐ is odd
Let ๐ > 0 be arbitrary.
Suppose that ๐ is odd. We know that if ๐, ๐ are odd,
then ๐๐ is also odd.
So:
โฏโ
๐ โ
๐ โ
๐ โ
โฏ โ
๐ = ๐๐
[๐ times]
Those โโฏโs are a problem! Weโre trying to say โwe can use
the same argument over and overโฆโ
Weโll come back to this.
mathematical induction
Method for proving statements about all integers โฅ 0
โ A new logical inference rule!
โข It only applies over the natural numbers
โข The idea is to use the special structure of the naturals to
prove things more easily
โ Particularly useful for reasoning about programs!
for(int i=0; i < n; n++) { โฆ }
โข Show P(i) holds after i times through the loop
public int f(int x) {
if (x == 0) { return 0; }
else { return f(xโ1)+1; }}
โข f(x) = x for all values of x โฅ 0 naturally shown by induction.
induction is a rule of inference
Domain: Natural Numbers
๐(0)
๏ข ๐ (๐(๐) โ ๐(๐ + 1))
๏ ๏ข ๐ ๐(๐)
using the induction rule in a formal proof
๐(0)
๏ข ๐ (๐(๐) โ ๐(๐ + 1))
๏ ๏ข ๐ ๐(๐)
1. Prove P(0)
2. Let k be an arbitrary integer โฅ 0
3. Assume that P(k) is true
4. ...
5. Prove P(k+1) is true
6. P(k) ๏ฎ P(k+1)
Direct Proof Rule
7. ๏ข k (P(k) ๏ฎ P(k+1))
Intro ๏ข from 2-6
8. ๏ข n P(n)
Induction Rule 1&7
format of an induction proof
๐(0)
๏ข ๐ (๐(๐) โ ๐(๐ + 1))
๏ ๏ข ๐ ๐(๐)
Base Case
1. Prove P(0)
2. Let k be an arbitrary integer โฅ 0
Inductive Hypothesis
3. Assume that P(k) is true
4. ...
Inductive Step
5. Prove P(k+1) is true
6. P(k) ๏ฎ P(k+1)
Direct Proof Rule
7. ๏ข k (P(k) ๏ฎ P(k+1))
Intro ๏ข from 2-6
8. ๏ข n P(n)
Induction Rule 1&7
Conclusion
1 + 2 + 4 + 8 + โฏ+ 2n
โข
โข
โข
โข
โข
1
1+2
1+2+4
1+2+4+8
1 + 2 + 4 + 8 + 16
=1
=3
=7
= 15
= 31
Can we describe the pattern?
1 + 2 + 4 + โฏ + 2n = 2n+1 โ 1
proving 1 + 2 + 4 + โฏ + 2n = 2n+1 โ 1
โข We could try proving it normallyโฆ
โ We want to show that 1 + 2 + 4 + โฏ + 2n = 2n+1.
โ So, what do we do now? We can sort of explain the pattern,
but thatโs not a proofโฆ
โข We could prove it for n=1, n=2, n=3, โฆ
(individually), but that would literally take foreverโฆ
inductive proof in five easy steps
Proof:
1. โWe will show that P(n) is true for every n โฅ 0 by induction.โ
2. โBase Case:โ Prove P(0)
3. โInductive Hypothesis:โ
Assume P(k) is true for some arbitrary integer k โฅ 0โ
4. โInductive Step:โ Want to prove that P(k+1) is true:
Use the goal to figure out what you need.
Make sure you are using I.H. and point out where you are using it.
(Donโt assume P(k+1) !)
5. โConclusion: Result follows by induction.โ
proving 1 + 2 + โฆ + 2n = 2n+1 โ 1
proving 1 + 2 + โฆ + 2n = 2n+1 โ 1
1. Let P(n) be โ1 + 2 + โฆ + 2n = 2n+1 โ 1โ. We will show P(n) is true for all
natural numbers by induction.
2. Base Case (n=0): 20 = 1 = 2 โ 1 = 20+1 โ 1
3. Induction Hypothesis: Suppose that P(k) is true for some
arbitrary k โฅ 0.
4. Induction Step:
Goal: Show P(k+1), i.e. show 1 + 2 + โฆ + 2k + 2k+1 = 2k+2 โ 1
1 + 2 + โฆ + 2k = 2k+1 โ 1 by IH
Adding 2k+1 to both sides, we get:
1 + 2 + โฆ + 2k + 2k+1 = 2k+1 + 2k+1 โ 1
Note that 2k+1 + 2k+1 = 2(2k+1) = 2k+2.
So, we have 1 + 2 + โฆ + 2k + 2k+1 = 2k+2 โ 1, which is
exactly P(k+1).
5. Thus P(k) is true for all k โโ, by induction.
another example of a pattern
โข
โข
โข
โข
โข
โข
20
22
24
26
28
โฏ
โ
โ
โ
โ
โ
1
1
1
1
1
=
=
=
=
=
1 โ 1 = 0 = 3โ
0
4 โ 1 = 3 = 3โ
1
16 โ 1 = 15 = 3 โ
5
64 โ 1 = 63 = 3 โ
21
256 โ 1 = 255 = 3 โ
85
prove: 3 โฃ 22๐ โ 1 for all ๐ โฅ 0
For all ๐ โฅ 1: 1 + 2 + โฏ + ๐ =
๐
๐=1 ๐
=
๐ ๐+1
2
checkerboard tiling
Prove that a 2n ๏ด 2n checkerboard with one square removed
can be tiled with:
checkerboard tiling
Prove that a 2n ๏ด 2n checkerboard with one square removed
can be tiled with:
prove: ๐๐ โฅ ๐! for all ๐ โฅ 1
© Copyright 2026 Paperzz