Mathematical Induction
Very simple
Very powerful proof technique
“Guess” and verify strategy
2014/10/19
Disc Math, NCHU
1
Basic steps
1.
2.
Hypothesis: P(n) is true for all positive
integers n
Base case / basis step (starting value)
Inductive step
Formally:
[ P(1) k (P(k) P(k+1)) ] n P(n)
2014/10/19
Disc Math, NCHU
2
Intuition
Iterative modus ponens:
P(k)
P(k) P(k+1)
--------------------P(k+1)
Need a starting point (Base case)
Proof comes with the well-ordering
property. (skipped)
2014/10/19
Disc Math, NCHU
3
Example 1
P(n): 1 + 2 + … + n = n(n+1)/2
Follow the steps:
Base case: P(1).
LHS = 1. RHS = 1(1+1)/2 = LHS
Inductive step:
Assume P(k) is true. (i.e. n = k, p(n) holds)
Show P(k+1) is true.
Note: 1 + 2 + … + k + (k+1)
= k(k+1)/2 + (k+1) = (k+1)(k+2)/2 done
2014/10/19
Disc Math, NCHU
4
Example 2
A difficult series (suppose we guess the
answer, and try to prove that it is correct.)
12 + 22 + 32 + …+n2 = n(n+1)(2n+1)/6
Base case: P(1)
LHS = 1 = RHS.
Inductive step: (i.e. P(k) P(k+1))
12 + 22 + 32 + …+k2 +(k+1)2 =
k(k+1)(2k+1)/6 +(k+1)2 =
(k+1)(k+2)(2k+3)/6 = RHS.
2014/10/19
Disc Math, NCHU
5
Example 3
Prove n < 2n (see page 315)
Prove 2n < n! for n>3 (see page 316)
Prove H2n ≥ 1 + n/2 for n>0 (P. 317)
Hj=1+1/2+1/3+…+1/j,
H2k+1=1+1/2+…+1/2k +1/(2k+1) +… +1/2k+1
=H2k+1/(2k+1) +… +1/2k+1
≥ (1+k/2)+2K×1/(2k+1)
≥ (1+k/2)+1/2 = 1+(K+1)/2
2014/10/19
Disc Math, NCHU
6
Example 4
P(n): n < 4n
Base case: P(1) holds since 1 < 4.
Inductive step:
Assume k < 4k, for k>1
Show that k+1 < 4k+1 , k>1
k+1 < 4k +1 < 4k + 4k < 4×4k = 4k+1
2014/10/19
Disc Math, NCHU
7
Example 5
(same as in example 3)
Hj = 1+1/2+1/3+…+ 1/j (harmonic number)
Use mathematical induction to show that
P(n)=“H2n≧1+n/2”, where n is a nonegative integer.
Base case: P(0) is true, H20 = 1≧1+0/2
Inductive step: if P(k) is true, then P(k+1) is also true.
H2k+1=1+1/2+1/3+…+1/2K+ 1/(2K+1)+…+ 1/(2K+1)
= H2k+ 1/(2K+1)+…+ 1/(2K+1)
≧1+K/2+2K*1/(2K+1) ≧1+K/2+1/2
= 1+(K+1)/2 done.
2014/10/19
Disc Math, NCHU
8
Points to remember
Base case does not have to be necessary 1
Most common mistakes are in not verifying that
the base case holds
Sometimes we need more than P(k) P(k+1),
in these cases STRONG induction is used.
As usual, guessing the solution is done first.
2014/10/19
Disc Math, NCHU
9
How can you guess a solution?
Try simple tricks: e.g. for sums with
similar terms – n times the average or n
times the maximum; for sums with fast
increasing/decreasing terms, some
multiple of the maximum term.
Often proving upper and lower bounds
separately helps.
2014/10/19
Disc Math, NCHU
10
Template for Induction Proof
1.
2.
3.
4.
5.
6.
Express the statement in the form “for all n ≧ b P(n)”
for a fixed b.
Basic step: (show P(b) is true)
Inductive step: Assume that P(k) is true for any k ≧ b,
(state what P(k+1) says).
Prove P(k+1) making using P(k) (be sure the proof
works for small k including b)
Identify the conclusion, such as “this completes the
inductive step”
State the conclusion, such as “by mathematical
induction, P(n) is true for all integers n with n ≧ b”
2014/10/19
Disc Math, NCHU
11
Strong Induction
Equivalent to induction – use whichever is
convenient.
Formally:
[ P(1) k (P(1) … P(k) P(k+1)) ]
n P(n)
Often useful for proving facts about
algorithms
2014/10/19
Disc Math, NCHU
12
Example 1 (strong induction)
Show that if n is an integer greater than 1, then
n can be written as the product of primes.
Let P(n) be the proposition that “n can be written as the product of
primes.”
Basis step: P(2) is true
Induction step: (see page 331 for details)
assume P(j) is true for all 2 ≤ j ≤ k, show that
p(k+1) is true, that is, k+1 can be written as the product of primes.
case 1: if k+1 is prime, then p(k+1) is true.
case 2: if k+1 is composite, then k+1 can be written as the
product of two positive integers a and b, where 2 ≤ a ≤ b < k+1.
By the inductive hypothesis, both a and b can be written as the
product of primes. Thus, k+1 can be written as the product of
primes.
2014/10/19
Disc Math, NCHU
13
Example 2 (math. induction)
Show that every amount of postage of 12 cents or more can be
formed using just 4-cent and 5-cent stamps.
Proof 1: (mathematical induction)
let p(n) be the statement that “postage of n cents can be formed
using 4-cent and 5-cent stamps”.
basis step: 12 cents = 3 * 4-cent stamps, that is, P(12) is true.
inductive step: prove that p(k) is true p(k+1) is true .
(i) Suppose that there is at least a 4-cent stamp was used to form
postage of k cents. We can replace this stamp with a 5-cent stamp
to form postage of k+1 cents.
(ii) If only 5-cent stamps are used to form postage of k cents,
since k ≧ 12, there must at least 3 5-cent stamps to form postage
of k cents, then we can replace 3 5-cent with 4 4-cent stamps to
form postage of k+1 cents.
2014/10/19
Disc Math, NCHU
14
Example 2 (strong induction)
Show that every amount of postage of 12 cents or more can be
formed using just 4-cent and 5-cent stamps.
Proof 2: (strong induction)
let p(n) be the statement that “postage of n cents can be formed
using 4-cent and 5-cent stamps”.
basis step: prove that p(12), p(13), p(14), and p(15) are all true.
inductive step: prove that if p(j) is true for 12≦j ≦ k, where k is
an integer with k≧15, then p(k+1) is true.
We can assume that p(k-3) is true because k-3 ≧ 12. To form
postage of k+1 cents, we need only to add a 4-cent stamp to othe
stamps we used to form postage of k-3 cents. Hence, we have
shown that if the inductive hypothesis is true, then p(k+1) is also
true.
2014/10/19
Disc Math, NCHU
15
Polygon
A polygon is a closed geometric figure consisting of a
sequence of line segments, s1,s2 ,…, sn, called sides.
Each pair of consecutive sides si and si+1, as well as
s1 and sn meet at a common endpoint.
A polygon is simple if no two nonconsecutive sides
intersect. It is convex if every line segment
connecting two points in the interior of the polygon
lies entirely inside the polygon.
A diagonal of a simple polygon is a line segment
connecting two nonconsecutive vertices of the polygon,
and a diagonal is called an interior diagonal if it lies
entirely inside the polygon, except the endpoints.
2014/10/19
Disc Math, NCHU
16
Strong Induction in Computational Geometry
Theorem A simple polygon with n sides, where n is
an integer with n ≧ 3, can be triangulated into n-2
triangles.
Lemma Every simple polygon with at least 4 sides
has an interior diagonal.
(please refer to the book, p 334, for the detailed
strong induction proof of the lemma 有點難度)
2014/10/19
Disc Math, NCHU
17
Proof of the n-2 triangles
Theorem A simple polygon P with n sides, where n is
an integer with n ≧ 3, can be triangulated into n-2
triangles.
Proof: using strong induction, let T(n) be the statement
that every simple polygon with n sides can be trianglated
into n-2 triangles.
Basic step: T(3) is true, itself is a triangle already.
Inductive step: assume T(j) is true for 3 ≦ j ≦ k, that is
we can trianglate a simple polygon into j-2 triangles. We
want to prove T(k+1) is also true. Because k ≧4, by
lemma, there is an interior diagonal ab. Now ab splits P
into Q and R, say with s sides and t sides respectively.
Note that both t and s are between 3 and k, and
k+1=s+t-2. by inductive hypothesis, Q and R can be
triangulated into s-2 and t-2 triangles. Consequently, we
can triangulate P into (s-2)+(t-2)= k-1 triangles. This
2014/10/19
Disc Math, NCHU
completes the proof.
18
Well-Ordering Property
Every nonempty set of nonnegative
integers has a least element.
Well-ordering property, the principle of
mathematical induction, and strong
induction are all equivalent.
2014/10/19
Disc Math, NCHU
19
Recursion
Important in mathematics, programming,
thinking about problems
Hanoi tower and Binary search are wellknown examples.
Move 3 piles from S to T thru M
move a Pile from A to T, move a pile from A to M
move a pile from T to M, move a pile from A to T
move a pile from M to A, move a pile from M to T
move a pile from A to T
In general, k piles need ak = 2ak-1 +1 moves, a1=1, a2=3, a3=7,…
2014/10/19
Disc Math, NCHU
20
Recursive definitions
In many cases – a natural way of thinking
Ex. 1: f(0) = b, and
i>0 f(i)= f(i-1)+a Arithmetic progression
Ex. 2: f(0) = b, and
Geometric progression
i>0 f(i)= f(i-1)*a
Ex. 3: f(0) = 1, f(1) = 1 and
Fibonacci
i>1 f(i)= f(i-1)+f(i-2)
series
2014/10/19
Disc Math, NCHU
21
Recursively defined sets (1/3)
Basis step: 2 S
Recursive step: If x S and y S
then x+ y S
Defines the set {2k|k=1,2,3,…}
What happens if we change the recursive step to:
If x S and y S, then x+y S, x-y S ?
2014/10/19
Disc Math, NCHU
22
Recursively defined sets (2/3)
All possible strings (*) over alphabet
Basis step: *
Recursive step: If x and w *
then wx *
Define the Length of a string as:
l() = 0
l(wx) = l(w) + 1 if x and w *
2014/10/19
Disc Math, NCHU
23
Recursively defined sets (3/3)
What is this set A defined over = {0,1}?
Basis step: A
Recursive step: If x A then 0x1 A
What is this set B defined over = {0,1}?
Basis step: B
Recursive step:
If x B, then 0x 1 B and 1x 0 B
2014/10/19
Disc Math, NCHU
24
Full binary trees (1/2)
The set of full binary trees can be defined:
Basis step – There is a full binary tree consists
of a single vertex r.
Inductive step: If T1 and T2 are disjoint full
binary trees, there is a full binary tree denoted
by T1•T2, consisting of a root r together with
edges connecting the root to each of the roots of
left subtree T1 and the right subtree T2.
2014/10/19
Disc Math, NCHU
25
Full binary trees (2/2)
Each node of a full binary tree has
0 successors or 2 successors, and each
of successors is a full binary tree.
Special case: complete binary tree,
which is a full binary tree with every leaf
is at the same level.
The two successors of a node are complete
binary trees with the same number of nodes,
that is, every leaf is at the same level.
2014/10/19
Disc Math, NCHU
26
Height of full binary trees
Recursive definition of height h(T)
If no. of nodes n(T) =1, h(T) =0
else the height is 1 + max(h(T1),h(T2))
where T1, T2 are the two subtrees of T
Can you give a recursive definition to
specify the height of a full binary tree?
h(T) = 0 if T consists of one vertex
h(T) = 1+max(h(T1),h(T2)), T1 and T2 are left and right subtrees of T
2014/10/19
Disc Math, NCHU
27
Structural induction (1/2)
Structural Induction:
Basis step: show the results hold for all
elements specified in the basis step of the
recursive definition to be in the set.
Recursive step: show that if the statement is
true for each of the elements used to
construct new elements in the recursive step
of the definition, the results hold for the new
elements.
2014/10/19
Disc Math, NCHU
28
Structural induction (2/2)
Theorem: If T is a full binary tree, then
n(T) 2h(T)+1 -1
Proof (by using structural induction) :
Base case: If n(T) = 1, h(T) = 0, so the proposition holds.
Inductive step: n(T) = 1+n(T1)+n(T2)
1+ (2h(T1)+1 -1) + (2h(T2)+1 -1)
2 max (2h(T1)+1 , 2h(T2)+1 ) -1
= 2*2max (h(T1)+1 , h(T2)+1 ) -1
= 2*2h(T)-1 = 2h(t)+1 -1
2014/10/19
Disc Math, NCHU
29
Well-known Recursive Programs
Factorial
Fibonacci
Binary search
Merge sort
Hanoi Tower (recursive algorithm?)
if n>0
{hanoi(n-1, from, to, thru),
move the nth disk from “from” to “to”,
hanoi(n-1, thru, from, to)}
2014/10/19
Disc Math, NCHU
30
Drawbacks of recursion
Repeated computation of the same terms
Wasted storage
Overhead incurred by OS due to stack
maintenance
2014/10/19
Disc Math, NCHU
31
MEMO
Read section 5.1 through 5.3
Get familiar with (strong) mathematical
induction with practical examples.
What is the well ordering property?
Differentiate between induction and recursion.
HW #5-7,9-11,15,17,19,20 of §5.1, #3,5,7,8 of
§5.2, #8-9,15-17,33-34 of §5.3.
2014/10/19
Disc Math, NCHU
32
© Copyright 2026 Paperzz