*********** Solution *****post************
September 5, 2003
Homework Assignment 1 – Problem 9 omitted 9/9/03, prob. 10 fixed*
Due Friday 9/12/02 after class
Problem set for chapter 1 (total of 100 points):
The problems are weighted as shown
All steps must be shown.
The three basic steps for inductive proofs must be
Problem 1 (10 points)
Let f be a function on the natural numbers satisfying:
f(n) = 0,
if n = 0
f(n) = 4f(n/2),
if n is even and n > 0
f(n) = f(n-1) +2n-1 if n is odd
prove that f(n) = n
for all n
Hint on strong induction:
As before, show the basis step that P(0) is true.
We now have a somewhat different inductive assumption:
“assume p(0), p(1), .
.., p(n) is true” and from this assumption prove that
p(n+1) to be true.
Note that the
inductive assumption is now a sequence of propositions including the basis.
Now we can use
propositions in the inductive assumptions to imply the n+1 case, rather than being restricted to only the n
In some cases relating the n+1th case to the nth case may not be easy.
The hint is that it is sufficient to relate
the n+1 case to any one of the p(0), p(1), .
.., p(n) cases - not necessarily the nth case, ie., if you can show that
that the n+1 case is expressed in any one of these cases then you could invoke the inductive assumption.
formally known as “strong” induction or “The Second Principle of Induction” - easier than ordinary induction
(relating n+1 only to n).
Note that it can be shown that ordinary and strong induction is equivalent.
Problem 2 (5 points):
Strong induction was used erroneously to prove that 2
= 1 for all n
Show what is
wrong with the following “proof ” (or if you prove it correct, maybe you’ll get the Nobel Prize in
BASIS STEP: 2
= 1 by definition
= 1 for any a).
INDUCTIVE ASSUMPTION: assume that 2
= 1 for all 0
ie., assume 2
, … , 2
are all equal to 1
for any n
) / (2
) by the rules of exponents (“/ ” means “divide by”).
But both 2
fall within the range of the inductive assumption and may be replaced 1.
= (1)(1)/1 = 1.
Hence having “proved” the (n+1)
case, we conclude that 2
= 1 for all n
Problem 3 (10 points)
Let T be a
binary tree ie., each vertex has precisely two children, except for the leafs which have no
Assuming that the root and leafs count as vertices, prove that if T has n leafs, then the number of
vertices, N, in T is exactly N = 2n-1.
Use induction on the number of vertices, N in T.
a strictly binary
tree T can always be made up of the root of T and
two “subtrees” each having roots consisting or the two
vertices coming off the root of T.
The sum of the leafs in the two subtrees add up to the number of leafs in T
and the sum of the vertices in the subtrees plus 1 is the number of vertices in T.
CS373 Homework assignment 1