Proof by contradiction.
Suppose that a tree T with L leaves contains no subtree having between L/3 and 2L/3 nodes. Let root be . We find
= children of
with more leaves. Since the tree has only L leaf nodes, so there must be one i such that
has more than 2L/3 leaves nodes and
has fewer than L/3 leaves. Since sibling of
has fewer than L/3 leaves,
can’t have 2L/3 leaves.
March 19, 2007
Exercises B.5-7
Exercises B.5-6
Proof by induction.
Base case: If tree T has just one node. Trivial.
Induction step: Assume that for all tree size smaller than k. Suppose that a tree T with size k. If T’s root has a subtree, then
is at most 0.5. Because the depth increase by one. Since T has at most two subtrees, the inequality is hold.
Exercises B.5-5
Proof by induction.
Base case: A tree with one node. Trivial.
Induction step: Assuem E = I+2n for all tree with size smaller k. Suppose that a tree T with size k. We can construct T’ by removing a internal leaf node x, then E’ = I’ + 2n-2. When adding x back, we must add two external node. So E = I + 2n – 2 + 2 = I + 2n.
March 18, 2007
Exercises B.5-4
Base case: If a tree has only one node, then the height = 1 > .
Induction step: Assume binary tree with n nodes has height at least , for all n < k. Suppose that a binary tree T with k nodes. We can construct a tree T’ by remove a node from T, such that the height of T’ >
. Because
except k is power of 2. T’s height = T’s height >
. If k is power of 2, then the inequality is also hold.
Exercises B.5-3
Base case: A tree with three vertices, one is root and others are leaves. The number of degree-2 nodes is 1 less than the number of leaves.
Induction step: Assume the number of degree-2 nodes is 1 less than the number of leaves for all tree with size smaller than k-1. Suppose that a tree with k nodes, we can find a leaf x and remove it. If x’s parent’s degree is 1, then both the number of degree-2 nodes and the number of leaves don’t change. If x’s parents degree is 2, then both the number of degree-2 nodes and the number of leaves decrease by one. The proposition that number of degree-2 nodes is 1 less than the number of leaves is hold.
Exercises B.5-2
Because G is acyclic, there is no directed cycle. But if there one vertex which has two path to another vertex, then the undirected version also has cycle. However has a unique path to all the other vertices. Hence the undirected version must be connected and has no cycle, which is a tree.