Maggie Johnson
Handout #12
CS103B
Key Topics
* Structural Induction
* Other Methods of Proof for Trees
* Node Induction
_____________________________________________________________________
In 103A, we saw a number of inductive proofs concerning integers and sequences.
We would
assume some statement for n, or for all integers less than or equal to n (strong induction), and use
this "inductive hypothesis" to prove the same statement for n+1.
A similar form of proof is useful
for concluding facts about trees.
Suppose we want to prove that a statement S(T) is true for all trees.
For a basis, we show that S(T) is
true whenever T consists of one node.
For the induction, we suppose that T is a tree with root r and
children c1, c2, .
.., ck.
Let T1, T2, .
.., Tk be the subtrees of T rooted at c1, c2, .
.., ck respectively as
shown below:
The inductive step is to assume S(T1), S(T2), .
.., S(Tk) are all true, and prove S(T).
If we can do
this, we have proven S(T).
Why does structural induction work?
Example 1:
S(T) denotes that there are at most m
h
leaves in an m-ary tree of height h.
(Note: the
root is at level 1 with a height of 0)
basis:
Consider an m-ary tree of height 1.
These trees consist of a root with no more than m
children, each of which is a leaf.
Therefore, there are no more than m
1
= m leaves in an m-
ary tree of height 1.
inductive hypothesis
: We assume the above statement is true for all m-ary trees of height less
than h, and show it is true for all m-ary trees of height h.
PROOF:
Let T be an m-ary tree of height h.
The leaves of T are the leaves of the subtrees of T
obtained by deleting the edges from the root to each of the vertices connected to it, as shown
below: