How to determine what can be the unknown variable in Prufer sequence?

138 Views Asked by At

$T$ is a labeled tree of $6$ vertices with the labels being $1,2,3,4,5,6$. The Prufer sequence of $T$ is $1,x,2,y$ where $x,y \in \{1,2,3,4,5,6\}$. Which one of the following statements is true:

  1. $x,y \in \{3,4,5,6\}$ and $x\neq y$

  2. $x,y \in \{3,4,5,6\}$ and it's possible that $x= y$

  3. $x,y \in \{1,2,3,4,5,6\}$ with the constraint that $x\neq y$

  4. $x,y \in \{1,2,3,4,5,6\}$ without any constraints

  5. the length of Prufer sequence is not $4$

Because there're $6$ vertices and each has a unique number then I think there can't be a situation where $x=y$. Also because $1,2$ already appear in the given sequence they can't appear again (because of label uniqueness). Therefore I think the correct answer is 1.

Is it correct?

2

There are 2 best solutions below

2
On BEST ANSWER

Recall that the purpose of Prüfer codes is to give an explicit bijection between the $n^{n-2}$ trees on vertex set $\{1,2,\dots,n\}$ and the $n^{n-2}$ ordered $(n-2)$-tuples of numbers from $\{1,2,\dots,n\}$.

If there were a requirement that all four numbers should be unique, then there would be only $n(n-1)(n-2)\dotsm(3) = \frac12 n!$ labeled trees on $n!$ vertices. That's too few, so your answer is wrong.

So you can deduce the correct answer without any knowledge of how Prüfer codes are constructed, just by knowing how many trees there are (Cayley's formula) and knowing what Prüfer codes are meant to do.

0
On

No, your reasoning is not correct. There is no reason why a particular label cannot appear more than once. As you construct the sequence, each number is the label of the neighbor of the lowest-numbered leaf, not the label of the removed leaf.

Consider

3     5
 \   /
  1-2
 /   \
4     6

or

      5
     /
3-1-2-4
     \
      6