Number of labelled trees with exactly 3 leaves
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I have seen some relevant questions here about that matter [1], [2] but I am getting a different result and I cannot understand if I am wrong. So the question is:
Find the number of labelled trees on $ngeq 4$ vertices that have exactly $3$ leaves.
This problem can be translated as follows: From the Prüfer code we want to count the number of codewords in which exactly $n-3$ different numbers appear. We know that a Prüfer code for $n$ vertices will have a length of $n-2$. So we have to place $n$ items in $n-3$ positions without repetitions and this can be done in $fracn!(n-3)!$ times their permutations ($(n-3)!$) and then we have 1 position to choose from $n-3$ numbers (because we have $3$ leaves) and therefore $binomn-31$ ways to fill that position. So in total we have $fracn!(n-3)!(n-3)!(n-3)!(n-4)!=n!(n-3)$ trees with exactly three leaves.
Am I missing something in my enumeration?
combinatorics graph-theory permutations trees
add a comment |Â
up vote
5
down vote
favorite
I have seen some relevant questions here about that matter [1], [2] but I am getting a different result and I cannot understand if I am wrong. So the question is:
Find the number of labelled trees on $ngeq 4$ vertices that have exactly $3$ leaves.
This problem can be translated as follows: From the Prüfer code we want to count the number of codewords in which exactly $n-3$ different numbers appear. We know that a Prüfer code for $n$ vertices will have a length of $n-2$. So we have to place $n$ items in $n-3$ positions without repetitions and this can be done in $fracn!(n-3)!$ times their permutations ($(n-3)!$) and then we have 1 position to choose from $n-3$ numbers (because we have $3$ leaves) and therefore $binomn-31$ ways to fill that position. So in total we have $fracn!(n-3)!(n-3)!(n-3)!(n-4)!=n!(n-3)$ trees with exactly three leaves.
Am I missing something in my enumeration?
combinatorics graph-theory permutations trees
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I have seen some relevant questions here about that matter [1], [2] but I am getting a different result and I cannot understand if I am wrong. So the question is:
Find the number of labelled trees on $ngeq 4$ vertices that have exactly $3$ leaves.
This problem can be translated as follows: From the Prüfer code we want to count the number of codewords in which exactly $n-3$ different numbers appear. We know that a Prüfer code for $n$ vertices will have a length of $n-2$. So we have to place $n$ items in $n-3$ positions without repetitions and this can be done in $fracn!(n-3)!$ times their permutations ($(n-3)!$) and then we have 1 position to choose from $n-3$ numbers (because we have $3$ leaves) and therefore $binomn-31$ ways to fill that position. So in total we have $fracn!(n-3)!(n-3)!(n-3)!(n-4)!=n!(n-3)$ trees with exactly three leaves.
Am I missing something in my enumeration?
combinatorics graph-theory permutations trees
I have seen some relevant questions here about that matter [1], [2] but I am getting a different result and I cannot understand if I am wrong. So the question is:
Find the number of labelled trees on $ngeq 4$ vertices that have exactly $3$ leaves.
This problem can be translated as follows: From the Prüfer code we want to count the number of codewords in which exactly $n-3$ different numbers appear. We know that a Prüfer code for $n$ vertices will have a length of $n-2$. So we have to place $n$ items in $n-3$ positions without repetitions and this can be done in $fracn!(n-3)!$ times their permutations ($(n-3)!$) and then we have 1 position to choose from $n-3$ numbers (because we have $3$ leaves) and therefore $binomn-31$ ways to fill that position. So in total we have $fracn!(n-3)!(n-3)!(n-3)!(n-4)!=n!(n-3)$ trees with exactly three leaves.
Am I missing something in my enumeration?
combinatorics graph-theory permutations trees
edited Aug 21 at 14:33
asked Aug 21 at 12:47
koygian
1167
1167
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
You have the right Prufer codes, but you have made some mistakes in counting. It's easy to check your formula doesn't work: for $n=4$ there are $4$ labelled trees with this property, because the tree must be a star and the only choice you have is which label goes in the middle.
First, to choose $n-3$ from $n$ elements in order is $binom n3times (n-3)!=fracn!6$.
Secondly, when you choose an element to duplicate, you not only need to choose which element is duplicated ($n-3$ options) but also where to put the duplicate ($n-2$ possible places). However, this actually counts each code twice, because it distinguishes the "original" and "duplicate" version of the label that appears twice, meaning you need to divide by $2$.
So overall there are $fracn!6timesfrac(n-3)(n-2)2=fracn!(n-2)(n-3)12$ such trees.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
You have the right Prufer codes, but you have made some mistakes in counting. It's easy to check your formula doesn't work: for $n=4$ there are $4$ labelled trees with this property, because the tree must be a star and the only choice you have is which label goes in the middle.
First, to choose $n-3$ from $n$ elements in order is $binom n3times (n-3)!=fracn!6$.
Secondly, when you choose an element to duplicate, you not only need to choose which element is duplicated ($n-3$ options) but also where to put the duplicate ($n-2$ possible places). However, this actually counts each code twice, because it distinguishes the "original" and "duplicate" version of the label that appears twice, meaning you need to divide by $2$.
So overall there are $fracn!6timesfrac(n-3)(n-2)2=fracn!(n-2)(n-3)12$ such trees.
add a comment |Â
up vote
2
down vote
accepted
You have the right Prufer codes, but you have made some mistakes in counting. It's easy to check your formula doesn't work: for $n=4$ there are $4$ labelled trees with this property, because the tree must be a star and the only choice you have is which label goes in the middle.
First, to choose $n-3$ from $n$ elements in order is $binom n3times (n-3)!=fracn!6$.
Secondly, when you choose an element to duplicate, you not only need to choose which element is duplicated ($n-3$ options) but also where to put the duplicate ($n-2$ possible places). However, this actually counts each code twice, because it distinguishes the "original" and "duplicate" version of the label that appears twice, meaning you need to divide by $2$.
So overall there are $fracn!6timesfrac(n-3)(n-2)2=fracn!(n-2)(n-3)12$ such trees.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
You have the right Prufer codes, but you have made some mistakes in counting. It's easy to check your formula doesn't work: for $n=4$ there are $4$ labelled trees with this property, because the tree must be a star and the only choice you have is which label goes in the middle.
First, to choose $n-3$ from $n$ elements in order is $binom n3times (n-3)!=fracn!6$.
Secondly, when you choose an element to duplicate, you not only need to choose which element is duplicated ($n-3$ options) but also where to put the duplicate ($n-2$ possible places). However, this actually counts each code twice, because it distinguishes the "original" and "duplicate" version of the label that appears twice, meaning you need to divide by $2$.
So overall there are $fracn!6timesfrac(n-3)(n-2)2=fracn!(n-2)(n-3)12$ such trees.
You have the right Prufer codes, but you have made some mistakes in counting. It's easy to check your formula doesn't work: for $n=4$ there are $4$ labelled trees with this property, because the tree must be a star and the only choice you have is which label goes in the middle.
First, to choose $n-3$ from $n$ elements in order is $binom n3times (n-3)!=fracn!6$.
Secondly, when you choose an element to duplicate, you not only need to choose which element is duplicated ($n-3$ options) but also where to put the duplicate ($n-2$ possible places). However, this actually counts each code twice, because it distinguishes the "original" and "duplicate" version of the label that appears twice, meaning you need to divide by $2$.
So overall there are $fracn!6timesfrac(n-3)(n-2)2=fracn!(n-2)(n-3)12$ such trees.
answered Aug 21 at 14:29
Especially Lime
19.3k22252
19.3k22252
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2889822%2fnumber-of-labelled-trees-with-exactly-3-leaves%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password