Expected number of tries to choose x unique valuesGiven a randomness source with min-entropy $k$, what is the expected number of samples without repetitions?Simulate random sampling with replacementExpected Time for n Independent Prisoners to EscapeSampling demonstration using combinatoricsWhat is the average number of random selections it would take to have picked every element of a set and the size of that set, n?Probability of repeated sampling from random draws with replacementAverage tries needed to find the right box (Amount of boxes declining)Expected number of wrong seats on planeWhy Sampling without replacement gives better CI performance?Expected number of flips till equal heads and tails
Would Slavery Reparations be considered Bills of Attainder and hence Illegal?
Size of subfigure fitting its content (tikzpicture)
Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?
Intersection Puzzle
How to show a landlord what we have in savings?
Why do bosons tend to occupy the same state?
Do UK voters know if their MP will be the Speaker of the House?
Are there any examples of a variable being normally distributed that is *not* due to the Central Limit Theorem?
Can I run a new neutral wire to repair a broken circuit?
Is there a hemisphere-neutral way of specifying a season?
Is it possible to create a QR code using text?
Should I tell management that I intend to leave due to bad software development practices?
How to Recreate this in LaTeX? (Unsure What the Notation is Called)
A category-like structure without composition?
What killed these X2 caps?
Is there an expression that means doing something right before you will need it rather than doing it in case you might need it?
How to compactly explain secondary and tertiary characters without resorting to stereotypes?
Am I breaking OOP practice with this architecture?
Bullying boss launched a smear campaign and made me unemployable
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
Why doesn't using multiple commands with a || or && conditional work?
Plagiarism or not?
Assassin's bullet with mercury
Is it logically or scientifically possible to artificially send energy to the body?
Expected number of tries to choose x unique values
Given a randomness source with min-entropy $k$, what is the expected number of samples without repetitions?Simulate random sampling with replacementExpected Time for n Independent Prisoners to EscapeSampling demonstration using combinatoricsWhat is the average number of random selections it would take to have picked every element of a set and the size of that set, n?Probability of repeated sampling from random draws with replacementAverage tries needed to find the right box (Amount of boxes declining)Expected number of wrong seats on planeWhy Sampling without replacement gives better CI performance?Expected number of flips till equal heads and tails
$begingroup$
it's been a long time since I've dealt with probability so I thought I would ask here. I'm sampling elements independently and uniformly and with repetition from a population. Given that the population is of size n, how many tries (in expectation) would it take me to gather x unique elements?
Thank you :)
probability expected-value sampling bootstrap-sampling
New contributor
$endgroup$
add a comment |
$begingroup$
it's been a long time since I've dealt with probability so I thought I would ask here. I'm sampling elements independently and uniformly and with repetition from a population. Given that the population is of size n, how many tries (in expectation) would it take me to gather x unique elements?
Thank you :)
probability expected-value sampling bootstrap-sampling
New contributor
$endgroup$
add a comment |
$begingroup$
it's been a long time since I've dealt with probability so I thought I would ask here. I'm sampling elements independently and uniformly and with repetition from a population. Given that the population is of size n, how many tries (in expectation) would it take me to gather x unique elements?
Thank you :)
probability expected-value sampling bootstrap-sampling
New contributor
$endgroup$
it's been a long time since I've dealt with probability so I thought I would ask here. I'm sampling elements independently and uniformly and with repetition from a population. Given that the population is of size n, how many tries (in expectation) would it take me to gather x unique elements?
Thank you :)
probability expected-value sampling bootstrap-sampling
probability expected-value sampling bootstrap-sampling
New contributor
New contributor
New contributor
asked Mar 28 at 20:52
user3767096user3767096
261
261
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
If we have $n$ things we are choosing from, see that we always have $1$ unique element after the first draw. From here, we now are dealing with a Geometric Distribution with probability of success being $dfracn-1n$. The expected number of tries here is $dfracnn-1$. Thus the expected number of draws until you get $2$ unique elements from a pool of size $n$ is $$E(1)+E(2) = 1+dfracnn-1$$
Where $E(m) = dfracnn-m+1$ is the expected number of draws after finding the $(m-1)^th$ unique element until you've successfully found the $m^th$ unique element. We take $E(1) = dfracnn-1+1 = 1$ to be the expected number of draws until the first unique element is found, which is just the first draw.
This pattern will generalize, with the expected value of draws until you have $x le n$ unique elements is $$sum_i=1^x E(i) = E(1)+E(2)+dots+E(x)$$
$endgroup$
add a comment |
$begingroup$
If you have already collected $k$ unique items, the probability that the next item drawn will be different is $n-kover n.$ We have a geometric distribution, so the expected number of draws until we get a different item is $nover n-k.$ The expected number of draws until we get $x$ different items is $$sum_k=0^x-1nover n-k=nsum_k=0^x-11over n-k$$
$endgroup$
1
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
add a comment |
$begingroup$
Not 100% sure this is the right solution, but I think you basically have to use a sequence of geometric random variables (https://en.wikipedia.org/wiki/Geometric_distribution)
So let's suppose $n$ = 10. If $x = 1$, then we are interested in the number of trials to draw one unique value. Hopefully we don't need to demonstrate that you only need one trial to do this.
Now, if $x = 2$, then we need the number of trials to draw one unique value ($y_1$), and then the number of trials to draw another unique value $(y_2)$. The first success happens on the first trial with probability 1, and then the probability that it takes $k$ more trials to get the second success is given by $P(y_2 = k) = (1 - 9/10)^k(9/10)$, since we will draw a second unique value with probability 9/10.
Notice that each trial is independent here, and the only thing that changes from trial to trial is the success probability, is $1$ for the first trial, $(n-1)/n$ for all trials until we get our second success, and so on. So basically we have $x$ geometric random variables here, and we want to find the expectation of their sum.
For $i in 1, dots, x$, let $y_i$ denote the event that we have drawn a unique value. Because $y_i$ is a Bernoulli random variable with success probability $p_i = (n-i+1)/n$, we have
beginalign
E[textNumber of trials] &= sum_i = 1^x E[y_i]\
&= sum_i = 1^xfrac1p_i\
&= sum_i = 1^xfracnn-i+1
endalign
$endgroup$
add a comment |
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
);
);
user3767096 is a new contributor. Be nice, and check out our Code of Conduct.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3166405%2fexpected-number-of-tries-to-choose-x-unique-values%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
If we have $n$ things we are choosing from, see that we always have $1$ unique element after the first draw. From here, we now are dealing with a Geometric Distribution with probability of success being $dfracn-1n$. The expected number of tries here is $dfracnn-1$. Thus the expected number of draws until you get $2$ unique elements from a pool of size $n$ is $$E(1)+E(2) = 1+dfracnn-1$$
Where $E(m) = dfracnn-m+1$ is the expected number of draws after finding the $(m-1)^th$ unique element until you've successfully found the $m^th$ unique element. We take $E(1) = dfracnn-1+1 = 1$ to be the expected number of draws until the first unique element is found, which is just the first draw.
This pattern will generalize, with the expected value of draws until you have $x le n$ unique elements is $$sum_i=1^x E(i) = E(1)+E(2)+dots+E(x)$$
$endgroup$
add a comment |
$begingroup$
If we have $n$ things we are choosing from, see that we always have $1$ unique element after the first draw. From here, we now are dealing with a Geometric Distribution with probability of success being $dfracn-1n$. The expected number of tries here is $dfracnn-1$. Thus the expected number of draws until you get $2$ unique elements from a pool of size $n$ is $$E(1)+E(2) = 1+dfracnn-1$$
Where $E(m) = dfracnn-m+1$ is the expected number of draws after finding the $(m-1)^th$ unique element until you've successfully found the $m^th$ unique element. We take $E(1) = dfracnn-1+1 = 1$ to be the expected number of draws until the first unique element is found, which is just the first draw.
This pattern will generalize, with the expected value of draws until you have $x le n$ unique elements is $$sum_i=1^x E(i) = E(1)+E(2)+dots+E(x)$$
$endgroup$
add a comment |
$begingroup$
If we have $n$ things we are choosing from, see that we always have $1$ unique element after the first draw. From here, we now are dealing with a Geometric Distribution with probability of success being $dfracn-1n$. The expected number of tries here is $dfracnn-1$. Thus the expected number of draws until you get $2$ unique elements from a pool of size $n$ is $$E(1)+E(2) = 1+dfracnn-1$$
Where $E(m) = dfracnn-m+1$ is the expected number of draws after finding the $(m-1)^th$ unique element until you've successfully found the $m^th$ unique element. We take $E(1) = dfracnn-1+1 = 1$ to be the expected number of draws until the first unique element is found, which is just the first draw.
This pattern will generalize, with the expected value of draws until you have $x le n$ unique elements is $$sum_i=1^x E(i) = E(1)+E(2)+dots+E(x)$$
$endgroup$
If we have $n$ things we are choosing from, see that we always have $1$ unique element after the first draw. From here, we now are dealing with a Geometric Distribution with probability of success being $dfracn-1n$. The expected number of tries here is $dfracnn-1$. Thus the expected number of draws until you get $2$ unique elements from a pool of size $n$ is $$E(1)+E(2) = 1+dfracnn-1$$
Where $E(m) = dfracnn-m+1$ is the expected number of draws after finding the $(m-1)^th$ unique element until you've successfully found the $m^th$ unique element. We take $E(1) = dfracnn-1+1 = 1$ to be the expected number of draws until the first unique element is found, which is just the first draw.
This pattern will generalize, with the expected value of draws until you have $x le n$ unique elements is $$sum_i=1^x E(i) = E(1)+E(2)+dots+E(x)$$
answered Mar 28 at 21:14
WaveXWaveX
2,8442822
2,8442822
add a comment |
add a comment |
$begingroup$
If you have already collected $k$ unique items, the probability that the next item drawn will be different is $n-kover n.$ We have a geometric distribution, so the expected number of draws until we get a different item is $nover n-k.$ The expected number of draws until we get $x$ different items is $$sum_k=0^x-1nover n-k=nsum_k=0^x-11over n-k$$
$endgroup$
1
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
add a comment |
$begingroup$
If you have already collected $k$ unique items, the probability that the next item drawn will be different is $n-kover n.$ We have a geometric distribution, so the expected number of draws until we get a different item is $nover n-k.$ The expected number of draws until we get $x$ different items is $$sum_k=0^x-1nover n-k=nsum_k=0^x-11over n-k$$
$endgroup$
1
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
add a comment |
$begingroup$
If you have already collected $k$ unique items, the probability that the next item drawn will be different is $n-kover n.$ We have a geometric distribution, so the expected number of draws until we get a different item is $nover n-k.$ The expected number of draws until we get $x$ different items is $$sum_k=0^x-1nover n-k=nsum_k=0^x-11over n-k$$
$endgroup$
If you have already collected $k$ unique items, the probability that the next item drawn will be different is $n-kover n.$ We have a geometric distribution, so the expected number of draws until we get a different item is $nover n-k.$ The expected number of draws until we get $x$ different items is $$sum_k=0^x-1nover n-k=nsum_k=0^x-11over n-k$$
edited Mar 29 at 13:05
answered Mar 28 at 21:16
saulspatzsaulspatz
17.1k31435
17.1k31435
1
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
add a comment |
1
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
1
1
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
I think there's something wrong with what's on top: the $n-x+1$. If you plug in $x=1$, your sum simplifies to $$sum_k=0^nnover n-k$$ and we ultimately have a $fracnn-n$ term
$endgroup$
– WaveX
Mar 28 at 21:33
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
$begingroup$
@WaveX I got it backwards somehow. Thanks.
$endgroup$
– saulspatz
Mar 29 at 13:08
add a comment |
$begingroup$
Not 100% sure this is the right solution, but I think you basically have to use a sequence of geometric random variables (https://en.wikipedia.org/wiki/Geometric_distribution)
So let's suppose $n$ = 10. If $x = 1$, then we are interested in the number of trials to draw one unique value. Hopefully we don't need to demonstrate that you only need one trial to do this.
Now, if $x = 2$, then we need the number of trials to draw one unique value ($y_1$), and then the number of trials to draw another unique value $(y_2)$. The first success happens on the first trial with probability 1, and then the probability that it takes $k$ more trials to get the second success is given by $P(y_2 = k) = (1 - 9/10)^k(9/10)$, since we will draw a second unique value with probability 9/10.
Notice that each trial is independent here, and the only thing that changes from trial to trial is the success probability, is $1$ for the first trial, $(n-1)/n$ for all trials until we get our second success, and so on. So basically we have $x$ geometric random variables here, and we want to find the expectation of their sum.
For $i in 1, dots, x$, let $y_i$ denote the event that we have drawn a unique value. Because $y_i$ is a Bernoulli random variable with success probability $p_i = (n-i+1)/n$, we have
beginalign
E[textNumber of trials] &= sum_i = 1^x E[y_i]\
&= sum_i = 1^xfrac1p_i\
&= sum_i = 1^xfracnn-i+1
endalign
$endgroup$
add a comment |
$begingroup$
Not 100% sure this is the right solution, but I think you basically have to use a sequence of geometric random variables (https://en.wikipedia.org/wiki/Geometric_distribution)
So let's suppose $n$ = 10. If $x = 1$, then we are interested in the number of trials to draw one unique value. Hopefully we don't need to demonstrate that you only need one trial to do this.
Now, if $x = 2$, then we need the number of trials to draw one unique value ($y_1$), and then the number of trials to draw another unique value $(y_2)$. The first success happens on the first trial with probability 1, and then the probability that it takes $k$ more trials to get the second success is given by $P(y_2 = k) = (1 - 9/10)^k(9/10)$, since we will draw a second unique value with probability 9/10.
Notice that each trial is independent here, and the only thing that changes from trial to trial is the success probability, is $1$ for the first trial, $(n-1)/n$ for all trials until we get our second success, and so on. So basically we have $x$ geometric random variables here, and we want to find the expectation of their sum.
For $i in 1, dots, x$, let $y_i$ denote the event that we have drawn a unique value. Because $y_i$ is a Bernoulli random variable with success probability $p_i = (n-i+1)/n$, we have
beginalign
E[textNumber of trials] &= sum_i = 1^x E[y_i]\
&= sum_i = 1^xfrac1p_i\
&= sum_i = 1^xfracnn-i+1
endalign
$endgroup$
add a comment |
$begingroup$
Not 100% sure this is the right solution, but I think you basically have to use a sequence of geometric random variables (https://en.wikipedia.org/wiki/Geometric_distribution)
So let's suppose $n$ = 10. If $x = 1$, then we are interested in the number of trials to draw one unique value. Hopefully we don't need to demonstrate that you only need one trial to do this.
Now, if $x = 2$, then we need the number of trials to draw one unique value ($y_1$), and then the number of trials to draw another unique value $(y_2)$. The first success happens on the first trial with probability 1, and then the probability that it takes $k$ more trials to get the second success is given by $P(y_2 = k) = (1 - 9/10)^k(9/10)$, since we will draw a second unique value with probability 9/10.
Notice that each trial is independent here, and the only thing that changes from trial to trial is the success probability, is $1$ for the first trial, $(n-1)/n$ for all trials until we get our second success, and so on. So basically we have $x$ geometric random variables here, and we want to find the expectation of their sum.
For $i in 1, dots, x$, let $y_i$ denote the event that we have drawn a unique value. Because $y_i$ is a Bernoulli random variable with success probability $p_i = (n-i+1)/n$, we have
beginalign
E[textNumber of trials] &= sum_i = 1^x E[y_i]\
&= sum_i = 1^xfrac1p_i\
&= sum_i = 1^xfracnn-i+1
endalign
$endgroup$
Not 100% sure this is the right solution, but I think you basically have to use a sequence of geometric random variables (https://en.wikipedia.org/wiki/Geometric_distribution)
So let's suppose $n$ = 10. If $x = 1$, then we are interested in the number of trials to draw one unique value. Hopefully we don't need to demonstrate that you only need one trial to do this.
Now, if $x = 2$, then we need the number of trials to draw one unique value ($y_1$), and then the number of trials to draw another unique value $(y_2)$. The first success happens on the first trial with probability 1, and then the probability that it takes $k$ more trials to get the second success is given by $P(y_2 = k) = (1 - 9/10)^k(9/10)$, since we will draw a second unique value with probability 9/10.
Notice that each trial is independent here, and the only thing that changes from trial to trial is the success probability, is $1$ for the first trial, $(n-1)/n$ for all trials until we get our second success, and so on. So basically we have $x$ geometric random variables here, and we want to find the expectation of their sum.
For $i in 1, dots, x$, let $y_i$ denote the event that we have drawn a unique value. Because $y_i$ is a Bernoulli random variable with success probability $p_i = (n-i+1)/n$, we have
beginalign
E[textNumber of trials] &= sum_i = 1^x E[y_i]\
&= sum_i = 1^xfrac1p_i\
&= sum_i = 1^xfracnn-i+1
endalign
answered Mar 28 at 21:20
BayesicBayesic
1145
1145
add a comment |
add a comment |
user3767096 is a new contributor. Be nice, and check out our Code of Conduct.
user3767096 is a new contributor. Be nice, and check out our Code of Conduct.
user3767096 is a new contributor. Be nice, and check out our Code of Conduct.
user3767096 is a new contributor. Be nice, and check out our Code of Conduct.
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.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3166405%2fexpected-number-of-tries-to-choose-x-unique-values%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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