Number of labeled trees which have two vertices of degree 5

combinatoricsgraph theory

I know that this question sounds familiar, but I can't find an answer that uses my method. So I will ask.

The question itself:

Take 10 vertices labeled ${1,2,…10}$ that form a tree of total 10 vertices. How many labeled trees which have two vertices of degree 5 can we have?

My approach was at first to draw some trees based on the question, and then write a suitable Prüfer code. We can have a Prüfer code that looks like this one $S=<1,1,1,1,6,6,6,6>$. Now I somehow got the point. I can take ${{10 \choose 2}}$ vertices that are not leaves for Prüfer code, and make $\frac{8!}{4!4!}$ possible orders of that code, where the length is 8 and we have 4 items of first label and 4 items of second label. Do the calculations and get ${{10 \choose 2}} ⋅ \frac{8!}{4!4!} = 3150$ possibilities.

In answers of some questions of that type, I saw that sometimes we also count the possible labels of each node in Prüfer code, such as 2! in our case, thus: ${{10 \choose 2}} ⋅ \frac{8!}{4!4!} ⋅ 2!=6300$.

And now I can't understand if we really need to count the possible labels of each node of nodes Prüfer code.

Best Answer

A tree with $10$ vertices has $9$ edges, so the sum of the degrees of the vertices is $2\cdot9=18$. If there are two vertices of degree $5$, the sum of the degrees of the other $8$ vertices must be $8$, which means that the other $8$ vertices must all be leaves. A vertex of degree $d$ appears $d-1$ times in the Prüfer code for the tree, so the leaves don’t appear at all, and the two vertices of degree $5$ show up $4$ times each. There are $\binom{10}2$ ways to choose which $2$ vertices are of degree $5$; say that these are vertices $k$ and $\ell$, where $k<\ell$. There are $\binom84$ ways to choose which $4$ positions in the Prüfer code are filled by vertex $k$, so there are

$$\binom{10}2\binom84=45\cdot70=3150$$

such trees. There is nothing to give you another factor of $2$ here.