TITLE: Number of leaves in a tree (all types of trees)
QUESTION [7 upvotes]: I have to prove the following claim, given the tree $T=(V,E)$, $|V|=n\geq2$:
 $$|V_1| = 2 + \sum (j-2)|V_j|$$
where the sum is from $j=3$ up to the highest degree, and
$$V_i = \{ x \in V \mid \deg(x) = i\}.$$
This was a bonus question given by my professor. We were sitting on this question for hours and have no idea how to prove it.
Can someone help out with a hint?
Thanks!

REPLY [11 votes]: Count the number of edges in two ways.

 By the Handshake Lemma: $|E|=\frac{1}{2}\sum\limits_{i=1}^\infty i|V_i|$.
 By the characterization of trees: $|E|= \sum\limits_{i=1}^\infty |V_i|-1$.
Equate these two quantities, and remember that $|V_1|$ is the number of leaves.
$\frac{1}{2}\sum\limits_{i=1}^\infty i|V_i|=  \sum\limits_{i=1}^\infty |V_i|-1,$
so
$\sum\limits_{i=1}^\infty (i-2)|V_i|+2=0$
so
$-|V_1|+0+\sum\limits_{i=3}^\infty (i-2)|V_i|+2=0$
so
$|V_1|=\sum\limits_{i=3}^\infty (i-2)|V_i|+2$
which is what you are after.