Where does my counting argument fails (Counting of numbers with freshness $k$)?












3












$begingroup$


Doing some recreational math, i was trying to reproduce the combinatorial proof of the identity



$$
n^n=sum_{k=1}^nfrac{n!}{(n-k)!}cdot kcdot n^{n-k-1},,,,(*)
$$



mentioned by OP in the Question Non combinatorial proof of formula for nn
?



To be honest this shouldn't be too difficult:



the number of all sequences with length $n$ out of numbers $1,2,..,n$ is clearly $underbrace{ n cdot n...cdot n}_{n,,times}=n^n$ which establishs the l.h.s. . For the r.h.s we demand that the first $k$ numbers are distinct but that the rest of the sequence can be choosen freely as before (Denote this number by $a_k$). In the end we sum over all $a_k$. I get



$$
a_k=underbrace{ncdot(n-1)...cdot(n-k+1)}_{choose,,k,,numbers\distinct}timesunderbrace{n^{n-k}}_{choose,,n-k,,numbers\freely}\=
frac{n!}{(n-k)!}n^{n-k} ,,,,(**)
$$



But this is not the same then the terms under the summation sign in $(*)$ so what am i doing wrong?





Edit 1:



I think i got it, i have to discount for the sequences with $k'>k$ distinct numbers (they can still fall out of the random part of my product) .Is this correct?





Edit 2:



To finish this, the correct quantity is given by the difference of sequences with $k$ and $k+1$ distinct numbers:



$$
a_{k+1}-a_{k}=-frac{n!}{n^{n-k}}left(frac{1}{(n-k-1)!n}-frac{1}{(n-k)!}right)=-frac{k}{n(n-k)!}frac{n!}{n^{n-k}}
$$



Done!





Edit3:



To avoid algebra we can also reason as follows (credit to @darijgrinberg):



Add to $(**)$ the following condtion: the $k+1$ number is fixed to ne one of the numbers in the first part of the product so that we don't get a sequence with $k+1$ distinct numbers. There are $k$ possiblities. Afterwards we can choose all remaining $n-k-1$ numbers at our wish. This results in a replacement $n^{n-k}rightarrow ktimes n^{n-k-1}$










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    You don't choose the last $n-k$ numbers freely. You have to make sure that the first of them violates the distinctness condition, i.e., equals one of the preceding $k$ numbers. That's where the $k$ factor will come from.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:15










  • $begingroup$
    @darijgrinberg thanks: i was already suspecting that. See my edit!
    $endgroup$
    – tired
    Jan 5 at 14:17










  • $begingroup$
    @darijgrinberg do you have any idea how to see the last Formula (after edit) directly without resorting to annoying Algebra? Thx!
    $endgroup$
    – tired
    Jan 5 at 14:22






  • 1




    $begingroup$
    You don't have to subtract anything. Just fix your argument as I suggested in the first comment.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:43










  • $begingroup$
    apart from the sign, edit 2 is correct.
    $endgroup$
    – G Cab
    Jan 5 at 14:57
















3












$begingroup$


Doing some recreational math, i was trying to reproduce the combinatorial proof of the identity



$$
n^n=sum_{k=1}^nfrac{n!}{(n-k)!}cdot kcdot n^{n-k-1},,,,(*)
$$



mentioned by OP in the Question Non combinatorial proof of formula for nn
?



To be honest this shouldn't be too difficult:



the number of all sequences with length $n$ out of numbers $1,2,..,n$ is clearly $underbrace{ n cdot n...cdot n}_{n,,times}=n^n$ which establishs the l.h.s. . For the r.h.s we demand that the first $k$ numbers are distinct but that the rest of the sequence can be choosen freely as before (Denote this number by $a_k$). In the end we sum over all $a_k$. I get



$$
a_k=underbrace{ncdot(n-1)...cdot(n-k+1)}_{choose,,k,,numbers\distinct}timesunderbrace{n^{n-k}}_{choose,,n-k,,numbers\freely}\=
frac{n!}{(n-k)!}n^{n-k} ,,,,(**)
$$



But this is not the same then the terms under the summation sign in $(*)$ so what am i doing wrong?





Edit 1:



I think i got it, i have to discount for the sequences with $k'>k$ distinct numbers (they can still fall out of the random part of my product) .Is this correct?





Edit 2:



To finish this, the correct quantity is given by the difference of sequences with $k$ and $k+1$ distinct numbers:



$$
a_{k+1}-a_{k}=-frac{n!}{n^{n-k}}left(frac{1}{(n-k-1)!n}-frac{1}{(n-k)!}right)=-frac{k}{n(n-k)!}frac{n!}{n^{n-k}}
$$



Done!





Edit3:



To avoid algebra we can also reason as follows (credit to @darijgrinberg):



Add to $(**)$ the following condtion: the $k+1$ number is fixed to ne one of the numbers in the first part of the product so that we don't get a sequence with $k+1$ distinct numbers. There are $k$ possiblities. Afterwards we can choose all remaining $n-k-1$ numbers at our wish. This results in a replacement $n^{n-k}rightarrow ktimes n^{n-k-1}$










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    You don't choose the last $n-k$ numbers freely. You have to make sure that the first of them violates the distinctness condition, i.e., equals one of the preceding $k$ numbers. That's where the $k$ factor will come from.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:15










  • $begingroup$
    @darijgrinberg thanks: i was already suspecting that. See my edit!
    $endgroup$
    – tired
    Jan 5 at 14:17










  • $begingroup$
    @darijgrinberg do you have any idea how to see the last Formula (after edit) directly without resorting to annoying Algebra? Thx!
    $endgroup$
    – tired
    Jan 5 at 14:22






  • 1




    $begingroup$
    You don't have to subtract anything. Just fix your argument as I suggested in the first comment.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:43










  • $begingroup$
    apart from the sign, edit 2 is correct.
    $endgroup$
    – G Cab
    Jan 5 at 14:57














3












3








3


1



$begingroup$


Doing some recreational math, i was trying to reproduce the combinatorial proof of the identity



$$
n^n=sum_{k=1}^nfrac{n!}{(n-k)!}cdot kcdot n^{n-k-1},,,,(*)
$$



mentioned by OP in the Question Non combinatorial proof of formula for nn
?



To be honest this shouldn't be too difficult:



the number of all sequences with length $n$ out of numbers $1,2,..,n$ is clearly $underbrace{ n cdot n...cdot n}_{n,,times}=n^n$ which establishs the l.h.s. . For the r.h.s we demand that the first $k$ numbers are distinct but that the rest of the sequence can be choosen freely as before (Denote this number by $a_k$). In the end we sum over all $a_k$. I get



$$
a_k=underbrace{ncdot(n-1)...cdot(n-k+1)}_{choose,,k,,numbers\distinct}timesunderbrace{n^{n-k}}_{choose,,n-k,,numbers\freely}\=
frac{n!}{(n-k)!}n^{n-k} ,,,,(**)
$$



But this is not the same then the terms under the summation sign in $(*)$ so what am i doing wrong?





Edit 1:



I think i got it, i have to discount for the sequences with $k'>k$ distinct numbers (they can still fall out of the random part of my product) .Is this correct?





Edit 2:



To finish this, the correct quantity is given by the difference of sequences with $k$ and $k+1$ distinct numbers:



$$
a_{k+1}-a_{k}=-frac{n!}{n^{n-k}}left(frac{1}{(n-k-1)!n}-frac{1}{(n-k)!}right)=-frac{k}{n(n-k)!}frac{n!}{n^{n-k}}
$$



Done!





Edit3:



To avoid algebra we can also reason as follows (credit to @darijgrinberg):



Add to $(**)$ the following condtion: the $k+1$ number is fixed to ne one of the numbers in the first part of the product so that we don't get a sequence with $k+1$ distinct numbers. There are $k$ possiblities. Afterwards we can choose all remaining $n-k-1$ numbers at our wish. This results in a replacement $n^{n-k}rightarrow ktimes n^{n-k-1}$










share|cite|improve this question











$endgroup$




Doing some recreational math, i was trying to reproduce the combinatorial proof of the identity



$$
n^n=sum_{k=1}^nfrac{n!}{(n-k)!}cdot kcdot n^{n-k-1},,,,(*)
$$



mentioned by OP in the Question Non combinatorial proof of formula for nn
?



To be honest this shouldn't be too difficult:



the number of all sequences with length $n$ out of numbers $1,2,..,n$ is clearly $underbrace{ n cdot n...cdot n}_{n,,times}=n^n$ which establishs the l.h.s. . For the r.h.s we demand that the first $k$ numbers are distinct but that the rest of the sequence can be choosen freely as before (Denote this number by $a_k$). In the end we sum over all $a_k$. I get



$$
a_k=underbrace{ncdot(n-1)...cdot(n-k+1)}_{choose,,k,,numbers\distinct}timesunderbrace{n^{n-k}}_{choose,,n-k,,numbers\freely}\=
frac{n!}{(n-k)!}n^{n-k} ,,,,(**)
$$



But this is not the same then the terms under the summation sign in $(*)$ so what am i doing wrong?





Edit 1:



I think i got it, i have to discount for the sequences with $k'>k$ distinct numbers (they can still fall out of the random part of my product) .Is this correct?





Edit 2:



To finish this, the correct quantity is given by the difference of sequences with $k$ and $k+1$ distinct numbers:



$$
a_{k+1}-a_{k}=-frac{n!}{n^{n-k}}left(frac{1}{(n-k-1)!n}-frac{1}{(n-k)!}right)=-frac{k}{n(n-k)!}frac{n!}{n^{n-k}}
$$



Done!





Edit3:



To avoid algebra we can also reason as follows (credit to @darijgrinberg):



Add to $(**)$ the following condtion: the $k+1$ number is fixed to ne one of the numbers in the first part of the product so that we don't get a sequence with $k+1$ distinct numbers. There are $k$ possiblities. Afterwards we can choose all remaining $n-k-1$ numbers at our wish. This results in a replacement $n^{n-k}rightarrow ktimes n^{n-k-1}$







combinatorics summation






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 5 at 15:52







tired

















asked Jan 5 at 13:59









tiredtired

10.6k12043




10.6k12043








  • 2




    $begingroup$
    You don't choose the last $n-k$ numbers freely. You have to make sure that the first of them violates the distinctness condition, i.e., equals one of the preceding $k$ numbers. That's where the $k$ factor will come from.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:15










  • $begingroup$
    @darijgrinberg thanks: i was already suspecting that. See my edit!
    $endgroup$
    – tired
    Jan 5 at 14:17










  • $begingroup$
    @darijgrinberg do you have any idea how to see the last Formula (after edit) directly without resorting to annoying Algebra? Thx!
    $endgroup$
    – tired
    Jan 5 at 14:22






  • 1




    $begingroup$
    You don't have to subtract anything. Just fix your argument as I suggested in the first comment.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:43










  • $begingroup$
    apart from the sign, edit 2 is correct.
    $endgroup$
    – G Cab
    Jan 5 at 14:57














  • 2




    $begingroup$
    You don't choose the last $n-k$ numbers freely. You have to make sure that the first of them violates the distinctness condition, i.e., equals one of the preceding $k$ numbers. That's where the $k$ factor will come from.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:15










  • $begingroup$
    @darijgrinberg thanks: i was already suspecting that. See my edit!
    $endgroup$
    – tired
    Jan 5 at 14:17










  • $begingroup$
    @darijgrinberg do you have any idea how to see the last Formula (after edit) directly without resorting to annoying Algebra? Thx!
    $endgroup$
    – tired
    Jan 5 at 14:22






  • 1




    $begingroup$
    You don't have to subtract anything. Just fix your argument as I suggested in the first comment.
    $endgroup$
    – darij grinberg
    Jan 5 at 14:43










  • $begingroup$
    apart from the sign, edit 2 is correct.
    $endgroup$
    – G Cab
    Jan 5 at 14:57








2




2




$begingroup$
You don't choose the last $n-k$ numbers freely. You have to make sure that the first of them violates the distinctness condition, i.e., equals one of the preceding $k$ numbers. That's where the $k$ factor will come from.
$endgroup$
– darij grinberg
Jan 5 at 14:15




$begingroup$
You don't choose the last $n-k$ numbers freely. You have to make sure that the first of them violates the distinctness condition, i.e., equals one of the preceding $k$ numbers. That's where the $k$ factor will come from.
$endgroup$
– darij grinberg
Jan 5 at 14:15












$begingroup$
@darijgrinberg thanks: i was already suspecting that. See my edit!
$endgroup$
– tired
Jan 5 at 14:17




$begingroup$
@darijgrinberg thanks: i was already suspecting that. See my edit!
$endgroup$
– tired
Jan 5 at 14:17












$begingroup$
@darijgrinberg do you have any idea how to see the last Formula (after edit) directly without resorting to annoying Algebra? Thx!
$endgroup$
– tired
Jan 5 at 14:22




$begingroup$
@darijgrinberg do you have any idea how to see the last Formula (after edit) directly without resorting to annoying Algebra? Thx!
$endgroup$
– tired
Jan 5 at 14:22




1




1




$begingroup$
You don't have to subtract anything. Just fix your argument as I suggested in the first comment.
$endgroup$
– darij grinberg
Jan 5 at 14:43




$begingroup$
You don't have to subtract anything. Just fix your argument as I suggested in the first comment.
$endgroup$
– darij grinberg
Jan 5 at 14:43












$begingroup$
apart from the sign, edit 2 is correct.
$endgroup$
– G Cab
Jan 5 at 14:57




$begingroup$
apart from the sign, edit 2 is correct.
$endgroup$
– G Cab
Jan 5 at 14:57










1 Answer
1






active

oldest

votes


















2












$begingroup$

I cannot tell if you already figured it out, but in case you haven't:



$$
a_k = underbrace{ncdot (n-1)cdotldotscdot (n-k+1)}_text{choose first $k$ numbers distinct}timesunderbrace{k}_{begin{array}{c}text{choose $(k+1)^{st}$ number equal to }\text{one of the first $k$ numbers}end{array}}times underbrace{n^{n-k-1}}_text{choose remaining numbers freely}
$$

The middle term must be $k$ because you need the "freshness" to be exactly $k$, meaning the first $k$ numbers are distinct, but the first $k+1$ numbers are not. Therefore, the $(k+1)^{st}$ number needs to be equal to one of the previous $k$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
    $endgroup$
    – tired
    Jan 5 at 15:54






  • 1




    $begingroup$
    @tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 15:59












  • $begingroup$
    this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
    $endgroup$
    – tired
    Jan 5 at 16:09








  • 1




    $begingroup$
    @tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 16:22











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3062745%2fwhere-does-my-counting-argument-fails-counting-of-numbers-with-freshness-k%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2












$begingroup$

I cannot tell if you already figured it out, but in case you haven't:



$$
a_k = underbrace{ncdot (n-1)cdotldotscdot (n-k+1)}_text{choose first $k$ numbers distinct}timesunderbrace{k}_{begin{array}{c}text{choose $(k+1)^{st}$ number equal to }\text{one of the first $k$ numbers}end{array}}times underbrace{n^{n-k-1}}_text{choose remaining numbers freely}
$$

The middle term must be $k$ because you need the "freshness" to be exactly $k$, meaning the first $k$ numbers are distinct, but the first $k+1$ numbers are not. Therefore, the $(k+1)^{st}$ number needs to be equal to one of the previous $k$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
    $endgroup$
    – tired
    Jan 5 at 15:54






  • 1




    $begingroup$
    @tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 15:59












  • $begingroup$
    this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
    $endgroup$
    – tired
    Jan 5 at 16:09








  • 1




    $begingroup$
    @tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 16:22
















2












$begingroup$

I cannot tell if you already figured it out, but in case you haven't:



$$
a_k = underbrace{ncdot (n-1)cdotldotscdot (n-k+1)}_text{choose first $k$ numbers distinct}timesunderbrace{k}_{begin{array}{c}text{choose $(k+1)^{st}$ number equal to }\text{one of the first $k$ numbers}end{array}}times underbrace{n^{n-k-1}}_text{choose remaining numbers freely}
$$

The middle term must be $k$ because you need the "freshness" to be exactly $k$, meaning the first $k$ numbers are distinct, but the first $k+1$ numbers are not. Therefore, the $(k+1)^{st}$ number needs to be equal to one of the previous $k$.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
    $endgroup$
    – tired
    Jan 5 at 15:54






  • 1




    $begingroup$
    @tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 15:59












  • $begingroup$
    this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
    $endgroup$
    – tired
    Jan 5 at 16:09








  • 1




    $begingroup$
    @tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 16:22














2












2








2





$begingroup$

I cannot tell if you already figured it out, but in case you haven't:



$$
a_k = underbrace{ncdot (n-1)cdotldotscdot (n-k+1)}_text{choose first $k$ numbers distinct}timesunderbrace{k}_{begin{array}{c}text{choose $(k+1)^{st}$ number equal to }\text{one of the first $k$ numbers}end{array}}times underbrace{n^{n-k-1}}_text{choose remaining numbers freely}
$$

The middle term must be $k$ because you need the "freshness" to be exactly $k$, meaning the first $k$ numbers are distinct, but the first $k+1$ numbers are not. Therefore, the $(k+1)^{st}$ number needs to be equal to one of the previous $k$.






share|cite|improve this answer









$endgroup$



I cannot tell if you already figured it out, but in case you haven't:



$$
a_k = underbrace{ncdot (n-1)cdotldotscdot (n-k+1)}_text{choose first $k$ numbers distinct}timesunderbrace{k}_{begin{array}{c}text{choose $(k+1)^{st}$ number equal to }\text{one of the first $k$ numbers}end{array}}times underbrace{n^{n-k-1}}_text{choose remaining numbers freely}
$$

The middle term must be $k$ because you need the "freshness" to be exactly $k$, meaning the first $k$ numbers are distinct, but the first $k+1$ numbers are not. Therefore, the $(k+1)^{st}$ number needs to be equal to one of the previous $k$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Jan 5 at 15:52









Mike EarnestMike Earnest

20.9k11951




20.9k11951












  • $begingroup$
    Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
    $endgroup$
    – tired
    Jan 5 at 15:54






  • 1




    $begingroup$
    @tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 15:59












  • $begingroup$
    this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
    $endgroup$
    – tired
    Jan 5 at 16:09








  • 1




    $begingroup$
    @tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 16:22


















  • $begingroup$
    Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
    $endgroup$
    – tired
    Jan 5 at 15:54






  • 1




    $begingroup$
    @tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 15:59












  • $begingroup$
    this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
    $endgroup$
    – tired
    Jan 5 at 16:09








  • 1




    $begingroup$
    @tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
    $endgroup$
    – Mike Earnest
    Jan 5 at 16:22
















$begingroup$
Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
$endgroup$
– tired
Jan 5 at 15:54




$begingroup$
Thanks, this is exactely what i added to my Question a few seconds ago. So now i have two different Proofs relying purely on combinatorics, cool!!! :)
$endgroup$
– tired
Jan 5 at 15:54




1




1




$begingroup$
@tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
$endgroup$
– Mike Earnest
Jan 5 at 15:59






$begingroup$
@tired Indeed! Since you are doing this for recreation, let me mention one other connection. Let $f_{n,k}=binom{n}k kn^{n-k-1}$, then the formula can be written $$n^n=sum_{k=1}^n k! f_{n,k}.$$ This is interesting because $f_{n,k}$ has a combinatorial interpretation; it is the number of "rooted forests" (forest with a root in each component) on a set of size $n$ with $k$ components. This shows that a function can be described as rooted forest together with a permutation $pi$ of the roots. The correspondence is: if $v$ is a not a root, $f(v)$ is its parent; if $v$ is a root, $f(v)=pi(v)$.
$endgroup$
– Mike Earnest
Jan 5 at 15:59














$begingroup$
this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
$endgroup$
– tired
Jan 5 at 16:09






$begingroup$
this is cool indeed. I wish i would have done more of this stuff back at University. Another Thing that i found nice is to divide everything by $n^n$ and use Stirling. We then see that the probability to get sequences with freshness $k$ is given by $k/n$ for sufficently small $k/n$ ...
$endgroup$
– tired
Jan 5 at 16:09






1




1




$begingroup$
@tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
$endgroup$
– Mike Earnest
Jan 5 at 16:22




$begingroup$
@tired That probability distribution is cool, too! Letting $X_n$ be the freshness, then $P(X_n/sqrt{n}>t)to e^{-t^2/2}$ as $ntoinfty$, so $X_n$ has an asymptotically Weibull distribution. Then $E[X_n]sim sqrt{npi/2}$, so in a random function, around $sqrt{npi/2}$ elements will be contained in a cycle, meaning $f^m(x)=x$ for some $m$.
$endgroup$
– Mike Earnest
Jan 5 at 16:22


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3062745%2fwhere-does-my-counting-argument-fails-counting-of-numbers-with-freshness-k%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

An IMO inspired problem

Management

Has there ever been an instance of an active nuclear power plant within or near a war zone?