Exercise Lover

March 21, 2007

Problems B-3

Filed under: Problem B — yuhanlyu @ 7:20 am

Solution wanted!

Problems B-2

Filed under: Problem B — yuhanlyu @ 7:04 am

a. Any one has at most n-1 friends, but there are n people. Hence there are two people with the same number friends.

b. Suppose that a person x who has three friends. If two of them know each other, then they with x are mutual friends. Otherwise on one of them are not friends, it becomes mutual strangers. (Ransey Number)

c. Maximum cut in graph. For any two person x and y, if they are friend then add edge (x,y).
For any graph, we partition the vertices into two group arbitrary. If some vertex x’s neighbors in the same group larger than the neighbors in the opposite group. Then change x’s group. Since change one vertex’s group, we can increase the maximal cut by one. But the maximum cut is finite, so this process will terminate.

d. Proof by undiction.
Base case: If there are three persons, then this case is trivial.
Induction step: Assume that group fewer than k persons can seat around a table. Suppose that we have a table with k-1 persons seated around it. The k-th person has (k/2) friends, so there are two friends who seated nearby. Then the k-th person can seat between they.

March 19, 2007

Problems B-1

Filed under: Problem B — yuhanlyu @ 1:18 pm

a. For any node in odd level we can color it as one color. For nodes in even level, we color they as another color.

b. 1 -> 2 Color one part as one color. Since there is no edge in the same par, it is 2-colorable.
2 -> 3 If G is 2-colorable, then there is no cycle of odd length. Otherwise there are two adjacent vertex with the same color.
3 -> 1 Select a vertex u into set A. Choose all nodes such the distance with u is even into A. Others are in B. Since there is no odd cycle, A and B must be bipartite.

c. Because for any node, we can color it as the color which is not used in its neighbors.

d. Use the greedy coloring. Color a node as the color which is not used in its neighbors. If we want to use a new color k, there must be k-1 edge adjacent to that node. Let n be the colors used in graph, then |E| < \sum^n_{k=1} k. Since E = O(|V|),  n = O(\sqrt{|V|}).

Exercises B.5-7

Filed under: B.5 — yuhanlyu @ 8:44 am

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 x_0. We find x_i = children of x_{i-1} with more leaves. Since the tree has only L leaf nodes, so there must be one i such that x_i has more than 2L/3 leaves nodes and x_{i+1} has fewer than L/3 leaves. Since sibling of x_{i+1} has fewer than L/3 leaves, x_i can’t have 2L/3 leaves.

Exercises B.5-6

Filed under: B.5 — yuhanlyu @ 8:30 am

Proof by induction.
Base case: If tree T has just one node. Trivial.
Induction step: Assume that \sum_{x \in leaf} w(x) \leq 1 for all tree size smaller than k. Suppose that a tree T with size k. If T’s root has a subtree, then \sum_{x \in subtree's leaf} w(x) 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

Filed under: B.5 — yuhanlyu @ 8:17 am

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

Filed under: B.5 — yuhanlyu @ 2:41 pm

Base case: If a tree has only one node, then the height = 1 > \lfloor \lg 1 \rfloor = 0.
Induction step: Assume binary tree with n nodes has height at least \lfloor \lg n \rfloor, 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’ > \lfloor \lg (k-1) \rfloor. Because \lfloor \lg (k-1) \rfloor = \lfloor \lg k \rfloor except k is power of 2. T’s height = T’s height > \lfloor \lg k \rfloor. If k is power of 2, then the inequality is also hold.

Exercises B.5-3

Filed under: B.5 — yuhanlyu @ 2:32 pm

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

Filed under: B.5 — yuhanlyu @ 2:23 pm

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 v_0 has a unique path to all the other vertices. Hence the undirected version must be connected and has no cycle, which is a tree.

Exercises B.5-1

Filed under: B.5 — yuhanlyu @ 6:42 am
Older Posts »

Blog at WordPress.com.