Drawing n balls with replacement and pick at least one ball of each colour
$begingroup$
I know this problem sounds familiar, but it has been a while since I stopped doing probabilities, and I did not find the answer easily by myself or on this site. At the origin, the problem is related to datamasking over a string that contains many alphabets, and we want to be sure that all the alphabets we are using are represented. There is in fact an easy mapping between alphabets and colour of a ball, and so here is the problem:
Given $a_1, dots, a_m$ balls of colour $1, dots m$, we want to pick $n$ balls with replacement, with $n geq m$. What is the probability that all the colours are represented in the sample?
Thanks in advance for your answers.
probability
$endgroup$
add a comment |
$begingroup$
I know this problem sounds familiar, but it has been a while since I stopped doing probabilities, and I did not find the answer easily by myself or on this site. At the origin, the problem is related to datamasking over a string that contains many alphabets, and we want to be sure that all the alphabets we are using are represented. There is in fact an easy mapping between alphabets and colour of a ball, and so here is the problem:
Given $a_1, dots, a_m$ balls of colour $1, dots m$, we want to pick $n$ balls with replacement, with $n geq m$. What is the probability that all the colours are represented in the sample?
Thanks in advance for your answers.
probability
$endgroup$
$begingroup$
Thanks @JoséCarlosSantos I edited the question, to put some context, but I'm not sure if it's sufficent or not
$endgroup$
– Damien Prot
Jan 24 at 7:58
$begingroup$
Is the order important ? For example is picking a white ball then a black ball different from picking black then white ?
$endgroup$
– P. Quinton
Jan 24 at 8:13
$begingroup$
no, the order is not important
$endgroup$
– Damien Prot
Jan 24 at 8:15
$begingroup$
are the $a_i$'s all different? that makes an important difference ;-)
$endgroup$
– user52227
Jan 24 at 8:54
add a comment |
$begingroup$
I know this problem sounds familiar, but it has been a while since I stopped doing probabilities, and I did not find the answer easily by myself or on this site. At the origin, the problem is related to datamasking over a string that contains many alphabets, and we want to be sure that all the alphabets we are using are represented. There is in fact an easy mapping between alphabets and colour of a ball, and so here is the problem:
Given $a_1, dots, a_m$ balls of colour $1, dots m$, we want to pick $n$ balls with replacement, with $n geq m$. What is the probability that all the colours are represented in the sample?
Thanks in advance for your answers.
probability
$endgroup$
I know this problem sounds familiar, but it has been a while since I stopped doing probabilities, and I did not find the answer easily by myself or on this site. At the origin, the problem is related to datamasking over a string that contains many alphabets, and we want to be sure that all the alphabets we are using are represented. There is in fact an easy mapping between alphabets and colour of a ball, and so here is the problem:
Given $a_1, dots, a_m$ balls of colour $1, dots m$, we want to pick $n$ balls with replacement, with $n geq m$. What is the probability that all the colours are represented in the sample?
Thanks in advance for your answers.
probability
probability
edited Jan 24 at 7:58
Damien Prot
asked Jan 24 at 7:49
Damien ProtDamien Prot
1032
1032
$begingroup$
Thanks @JoséCarlosSantos I edited the question, to put some context, but I'm not sure if it's sufficent or not
$endgroup$
– Damien Prot
Jan 24 at 7:58
$begingroup$
Is the order important ? For example is picking a white ball then a black ball different from picking black then white ?
$endgroup$
– P. Quinton
Jan 24 at 8:13
$begingroup$
no, the order is not important
$endgroup$
– Damien Prot
Jan 24 at 8:15
$begingroup$
are the $a_i$'s all different? that makes an important difference ;-)
$endgroup$
– user52227
Jan 24 at 8:54
add a comment |
$begingroup$
Thanks @JoséCarlosSantos I edited the question, to put some context, but I'm not sure if it's sufficent or not
$endgroup$
– Damien Prot
Jan 24 at 7:58
$begingroup$
Is the order important ? For example is picking a white ball then a black ball different from picking black then white ?
$endgroup$
– P. Quinton
Jan 24 at 8:13
$begingroup$
no, the order is not important
$endgroup$
– Damien Prot
Jan 24 at 8:15
$begingroup$
are the $a_i$'s all different? that makes an important difference ;-)
$endgroup$
– user52227
Jan 24 at 8:54
$begingroup$
Thanks @JoséCarlosSantos I edited the question, to put some context, but I'm not sure if it's sufficent or not
$endgroup$
– Damien Prot
Jan 24 at 7:58
$begingroup$
Thanks @JoséCarlosSantos I edited the question, to put some context, but I'm not sure if it's sufficent or not
$endgroup$
– Damien Prot
Jan 24 at 7:58
$begingroup$
Is the order important ? For example is picking a white ball then a black ball different from picking black then white ?
$endgroup$
– P. Quinton
Jan 24 at 8:13
$begingroup$
Is the order important ? For example is picking a white ball then a black ball different from picking black then white ?
$endgroup$
– P. Quinton
Jan 24 at 8:13
$begingroup$
no, the order is not important
$endgroup$
– Damien Prot
Jan 24 at 8:15
$begingroup$
no, the order is not important
$endgroup$
– Damien Prot
Jan 24 at 8:15
$begingroup$
are the $a_i$'s all different? that makes an important difference ;-)
$endgroup$
– user52227
Jan 24 at 8:54
$begingroup$
are the $a_i$'s all different? that makes an important difference ;-)
$endgroup$
– user52227
Jan 24 at 8:54
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Let $a:=a_1+cdots+a_m$ and $p_i=frac{a_i}{a}$.
Let $X_i$ denote the number of balls picked from color $i$.
To be found is $P(X_1>0,dots,X_m>0)$.
Here $(X_1,dots,X_m)$ has multinomial distribution with parameters $n$ and $(p_1,dots,p_m)$ so that in general:$$P(X_1=r_1,dots,X_m=r_m)=frac{n!}{r_1!cdots r_m!}p_1^{r_1}cdots p_m^{r_m}$$whenever the $r_i$ are nonnegative integers that satisfy $r_1+cdots+r_m=n$.
It is handsome here to go for $$P(X_1>0,dots,X_m>0)=1-Pleft(bigcup_{i=1}^m{X_i=0}right)$$and to find an expression of the RHS by means of the principle of inclusion/exclusion.
In this expression we meet terms like $P(X_2=0, X_4=0, X_5=0)=left(1-p_2-p_4-p_5right)^n$.
$endgroup$
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
|
show 2 more comments
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
});
}
});
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%2f3085581%2fdrawing-n-balls-with-replacement-and-pick-at-least-one-ball-of-each-colour%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
$begingroup$
Let $a:=a_1+cdots+a_m$ and $p_i=frac{a_i}{a}$.
Let $X_i$ denote the number of balls picked from color $i$.
To be found is $P(X_1>0,dots,X_m>0)$.
Here $(X_1,dots,X_m)$ has multinomial distribution with parameters $n$ and $(p_1,dots,p_m)$ so that in general:$$P(X_1=r_1,dots,X_m=r_m)=frac{n!}{r_1!cdots r_m!}p_1^{r_1}cdots p_m^{r_m}$$whenever the $r_i$ are nonnegative integers that satisfy $r_1+cdots+r_m=n$.
It is handsome here to go for $$P(X_1>0,dots,X_m>0)=1-Pleft(bigcup_{i=1}^m{X_i=0}right)$$and to find an expression of the RHS by means of the principle of inclusion/exclusion.
In this expression we meet terms like $P(X_2=0, X_4=0, X_5=0)=left(1-p_2-p_4-p_5right)^n$.
$endgroup$
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
|
show 2 more comments
$begingroup$
Let $a:=a_1+cdots+a_m$ and $p_i=frac{a_i}{a}$.
Let $X_i$ denote the number of balls picked from color $i$.
To be found is $P(X_1>0,dots,X_m>0)$.
Here $(X_1,dots,X_m)$ has multinomial distribution with parameters $n$ and $(p_1,dots,p_m)$ so that in general:$$P(X_1=r_1,dots,X_m=r_m)=frac{n!}{r_1!cdots r_m!}p_1^{r_1}cdots p_m^{r_m}$$whenever the $r_i$ are nonnegative integers that satisfy $r_1+cdots+r_m=n$.
It is handsome here to go for $$P(X_1>0,dots,X_m>0)=1-Pleft(bigcup_{i=1}^m{X_i=0}right)$$and to find an expression of the RHS by means of the principle of inclusion/exclusion.
In this expression we meet terms like $P(X_2=0, X_4=0, X_5=0)=left(1-p_2-p_4-p_5right)^n$.
$endgroup$
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
|
show 2 more comments
$begingroup$
Let $a:=a_1+cdots+a_m$ and $p_i=frac{a_i}{a}$.
Let $X_i$ denote the number of balls picked from color $i$.
To be found is $P(X_1>0,dots,X_m>0)$.
Here $(X_1,dots,X_m)$ has multinomial distribution with parameters $n$ and $(p_1,dots,p_m)$ so that in general:$$P(X_1=r_1,dots,X_m=r_m)=frac{n!}{r_1!cdots r_m!}p_1^{r_1}cdots p_m^{r_m}$$whenever the $r_i$ are nonnegative integers that satisfy $r_1+cdots+r_m=n$.
It is handsome here to go for $$P(X_1>0,dots,X_m>0)=1-Pleft(bigcup_{i=1}^m{X_i=0}right)$$and to find an expression of the RHS by means of the principle of inclusion/exclusion.
In this expression we meet terms like $P(X_2=0, X_4=0, X_5=0)=left(1-p_2-p_4-p_5right)^n$.
$endgroup$
Let $a:=a_1+cdots+a_m$ and $p_i=frac{a_i}{a}$.
Let $X_i$ denote the number of balls picked from color $i$.
To be found is $P(X_1>0,dots,X_m>0)$.
Here $(X_1,dots,X_m)$ has multinomial distribution with parameters $n$ and $(p_1,dots,p_m)$ so that in general:$$P(X_1=r_1,dots,X_m=r_m)=frac{n!}{r_1!cdots r_m!}p_1^{r_1}cdots p_m^{r_m}$$whenever the $r_i$ are nonnegative integers that satisfy $r_1+cdots+r_m=n$.
It is handsome here to go for $$P(X_1>0,dots,X_m>0)=1-Pleft(bigcup_{i=1}^m{X_i=0}right)$$and to find an expression of the RHS by means of the principle of inclusion/exclusion.
In this expression we meet terms like $P(X_2=0, X_4=0, X_5=0)=left(1-p_2-p_4-p_5right)^n$.
answered Jan 24 at 8:57


drhabdrhab
103k545136
103k545136
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
|
show 2 more comments
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Thanks for your answer. Is there any way to avoid the ugly inclusion/exclusion principle, in order to be able to compute this probability efficiently ? Or to have an estimation of this probability very quickly ?
$endgroup$
– Damien Prot
Jan 24 at 9:26
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Not that I know of. Ugly?...It is beautiful ;-) and IMV much better then the ugly summation of the $P(X_1=r_1,dots,X_m=r_m)$ where the $r_i$ are positive.
$endgroup$
– drhab
Jan 24 at 9:29
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
Why $ P(X_1>0, dots, X_m > 0 ) = 1 - P( cup X_i = 0) $ and not $ = 1- P(cap X_i = 0) $
$endgroup$
– bm1125
Jan 24 at 10:33
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
@bm1125 The negation of "$X_1>0text{ and }cdotstext{ and }X_m>0$" is "$X_1=0text{ or }cdotstext{ or }X_m=0$". It is not "$X_1=0text{ and }cdotstext{ and }X_m=0$" as you seem to think.
$endgroup$
– drhab
Jan 24 at 10:37
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
$begingroup$
Ohh.. that's like $ P(A_1 cap A_2 cap dots cap A_m) = 1- P(A_1^C cup A_2^C cup dots cup A_m^C) $ ??
$endgroup$
– bm1125
Jan 24 at 10:43
|
show 2 more comments
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%2f3085581%2fdrawing-n-balls-with-replacement-and-pick-at-least-one-ball-of-each-colour%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
$begingroup$
Thanks @JoséCarlosSantos I edited the question, to put some context, but I'm not sure if it's sufficent or not
$endgroup$
– Damien Prot
Jan 24 at 7:58
$begingroup$
Is the order important ? For example is picking a white ball then a black ball different from picking black then white ?
$endgroup$
– P. Quinton
Jan 24 at 8:13
$begingroup$
no, the order is not important
$endgroup$
– Damien Prot
Jan 24 at 8:15
$begingroup$
are the $a_i$'s all different? that makes an important difference ;-)
$endgroup$
– user52227
Jan 24 at 8:54