Let G = (V,E) be a graph. Define ξ(G) = Σd id x d, where id is the number of vertices of degree d in G. If S and T are two different trees with ξ(S) = ξ(T),then
(A) |S| = 2|T|
(B) |S| = |T|-1
(C) |S| = |T|
(D) |S| = |T|+1
Explanation: The expression ξ(G) is basically sum of all degrees in a tree. For example, in the following tree, the sum is 3 + 1 + 1 + 1.
a / | \ b c d
Now the questions is, if sum of degrees in trees are same, then what is the relationship between number of vertices present in both trees?
The answer is, ξ(G) and ξ(T) is same for two trees, then the trees have same number of vertices. It can be proved by induction. Let it be true for n vertices. If we add a vertex, then the new vertex (if it is not the first node) increases degree by 2, it doesn’t matter where we add it. For example, try to add a new vertex say ‘e’ at different places in above example tee.
Quiz of this Question
Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.