
36 DISCRETE
MATHEMATICS·---------------------------
numedges(
t')
+ 1 = numnodes(t')
(c) P(makeboth(t,t')), that is, numedges(makeboth(t,t'))+ 1 = numnodes(makeboth(t))
(i) numedges(makeboth(t,t')) = numedges(t) +numedges(t') + 2
Definition
of
numedges
(ii) numnodes(makeboth(t,t')) = numnodes(t) + numnodes(t') + 1
(iii) QED
(d) QED
Definition
of
numnodes
Algebra
5.
QED Structural induction on binary trees
EXERCISE
1 Show that with a supply
of
Rs. 3 and Rs. 5 stamps you can make up all postages
of
Rs. 8 or more.
INDUCTION
AND
RECURSIVE ALGORITHMS
Many
of
our inductive proofs can in fact, be seen
as
algorithms for solving a problem.
•