Drawing balls without replacement until three of a color are drawn

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite
2












This problem came up in a game I was playing. It's surely a standard combinatorics problem, but I'm having trouble searching for an exact match.



Suppose an urn contains $B$ blue balls, $R$ red balls, and $G$ green balls. Balls are drawn without replacement until you've drawn three balls of any one color (not necessarily consecutively). What's the probability of ending with three blue balls?



My reasoning is as follows: the number of ways to stop after drawing three blue balls is equal to the number of ways of drawing exactly two blue and at most two red and green balls (in any order), times the number of blue balls ending the sequence. This suggests that the number of ways of ending with blue is



$$E_B = sum_i=0^2 sum_j=0^2 (B-2)(2+i+j)!binomB2binomRibinomGj$$



where the binomial terms select which balls are drawn and the factorial enumerates all permutations, for the sequence of balls excluding the last ball. The probability of ending with three blue balls is then
$$fracE_BE_B+E_R+E_G$$
for $E_R$ and $E_G$ computed analogously.



Is this approach correct?



EDIT: Proposed recursive solutions to the problem (e.g. Blatter's answer below) are practical if one just cares about computing a number, but I'm particularly interested in an answer to this question that 1) explains why the above formula is incorrect, and 2) salvages the formula.







share|cite|improve this question

















  • 1




    I don't think so. You seem to be treating all sequences as equally likely. I think you would have to multiply each sequence by the probability of its occurrence.
    – saulspatz
    Jul 29 at 18:15










  • @saulspatz why isn't each sequence equally likely?
    – user7530
    Jul 29 at 18:16






  • 1




    If $B=3, R=G=10,$ is the sequence $BBB$ as likely as the sequence $RGRGR$? I know you count $6$ of the former and $10cdot9cdot8cdot10cdot9$ of the latter, but to get the probability of the first, we divide by $28cdot27cdot26$ and to get the probability of the second we divide by $28cdot27cdot26cdot25cdot24$
    – saulspatz
    Jul 29 at 18:32










  • @saulspatz ah I see, yes I think you’re right. Should the terms be weighted by $2^4-i-j$ then? Is there a rigorous way of seeing this?
    – user7530
    Jul 29 at 18:49










  • I don't see where that factor would come from. I'd need to see the whole formula, I think. I also think Christian Blatter's answer looks reasonable.
    – saulspatz
    Jul 29 at 20:06














up vote
5
down vote

favorite
2












This problem came up in a game I was playing. It's surely a standard combinatorics problem, but I'm having trouble searching for an exact match.



Suppose an urn contains $B$ blue balls, $R$ red balls, and $G$ green balls. Balls are drawn without replacement until you've drawn three balls of any one color (not necessarily consecutively). What's the probability of ending with three blue balls?



My reasoning is as follows: the number of ways to stop after drawing three blue balls is equal to the number of ways of drawing exactly two blue and at most two red and green balls (in any order), times the number of blue balls ending the sequence. This suggests that the number of ways of ending with blue is



$$E_B = sum_i=0^2 sum_j=0^2 (B-2)(2+i+j)!binomB2binomRibinomGj$$



where the binomial terms select which balls are drawn and the factorial enumerates all permutations, for the sequence of balls excluding the last ball. The probability of ending with three blue balls is then
$$fracE_BE_B+E_R+E_G$$
for $E_R$ and $E_G$ computed analogously.



Is this approach correct?



EDIT: Proposed recursive solutions to the problem (e.g. Blatter's answer below) are practical if one just cares about computing a number, but I'm particularly interested in an answer to this question that 1) explains why the above formula is incorrect, and 2) salvages the formula.







share|cite|improve this question

















  • 1




    I don't think so. You seem to be treating all sequences as equally likely. I think you would have to multiply each sequence by the probability of its occurrence.
    – saulspatz
    Jul 29 at 18:15










  • @saulspatz why isn't each sequence equally likely?
    – user7530
    Jul 29 at 18:16






  • 1




    If $B=3, R=G=10,$ is the sequence $BBB$ as likely as the sequence $RGRGR$? I know you count $6$ of the former and $10cdot9cdot8cdot10cdot9$ of the latter, but to get the probability of the first, we divide by $28cdot27cdot26$ and to get the probability of the second we divide by $28cdot27cdot26cdot25cdot24$
    – saulspatz
    Jul 29 at 18:32










  • @saulspatz ah I see, yes I think you’re right. Should the terms be weighted by $2^4-i-j$ then? Is there a rigorous way of seeing this?
    – user7530
    Jul 29 at 18:49










  • I don't see where that factor would come from. I'd need to see the whole formula, I think. I also think Christian Blatter's answer looks reasonable.
    – saulspatz
    Jul 29 at 20:06












up vote
5
down vote

favorite
2









up vote
5
down vote

favorite
2






2





This problem came up in a game I was playing. It's surely a standard combinatorics problem, but I'm having trouble searching for an exact match.



Suppose an urn contains $B$ blue balls, $R$ red balls, and $G$ green balls. Balls are drawn without replacement until you've drawn three balls of any one color (not necessarily consecutively). What's the probability of ending with three blue balls?



My reasoning is as follows: the number of ways to stop after drawing three blue balls is equal to the number of ways of drawing exactly two blue and at most two red and green balls (in any order), times the number of blue balls ending the sequence. This suggests that the number of ways of ending with blue is



$$E_B = sum_i=0^2 sum_j=0^2 (B-2)(2+i+j)!binomB2binomRibinomGj$$



where the binomial terms select which balls are drawn and the factorial enumerates all permutations, for the sequence of balls excluding the last ball. The probability of ending with three blue balls is then
$$fracE_BE_B+E_R+E_G$$
for $E_R$ and $E_G$ computed analogously.



Is this approach correct?



EDIT: Proposed recursive solutions to the problem (e.g. Blatter's answer below) are practical if one just cares about computing a number, but I'm particularly interested in an answer to this question that 1) explains why the above formula is incorrect, and 2) salvages the formula.







share|cite|improve this question













This problem came up in a game I was playing. It's surely a standard combinatorics problem, but I'm having trouble searching for an exact match.



Suppose an urn contains $B$ blue balls, $R$ red balls, and $G$ green balls. Balls are drawn without replacement until you've drawn three balls of any one color (not necessarily consecutively). What's the probability of ending with three blue balls?



My reasoning is as follows: the number of ways to stop after drawing three blue balls is equal to the number of ways of drawing exactly two blue and at most two red and green balls (in any order), times the number of blue balls ending the sequence. This suggests that the number of ways of ending with blue is



$$E_B = sum_i=0^2 sum_j=0^2 (B-2)(2+i+j)!binomB2binomRibinomGj$$



where the binomial terms select which balls are drawn and the factorial enumerates all permutations, for the sequence of balls excluding the last ball. The probability of ending with three blue balls is then
$$fracE_BE_B+E_R+E_G$$
for $E_R$ and $E_G$ computed analogously.



Is this approach correct?



EDIT: Proposed recursive solutions to the problem (e.g. Blatter's answer below) are practical if one just cares about computing a number, but I'm particularly interested in an answer to this question that 1) explains why the above formula is incorrect, and 2) salvages the formula.









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 29 at 21:41
























asked Jul 29 at 18:04









user7530

33.3k558109




33.3k558109







  • 1




    I don't think so. You seem to be treating all sequences as equally likely. I think you would have to multiply each sequence by the probability of its occurrence.
    – saulspatz
    Jul 29 at 18:15










  • @saulspatz why isn't each sequence equally likely?
    – user7530
    Jul 29 at 18:16






  • 1




    If $B=3, R=G=10,$ is the sequence $BBB$ as likely as the sequence $RGRGR$? I know you count $6$ of the former and $10cdot9cdot8cdot10cdot9$ of the latter, but to get the probability of the first, we divide by $28cdot27cdot26$ and to get the probability of the second we divide by $28cdot27cdot26cdot25cdot24$
    – saulspatz
    Jul 29 at 18:32










  • @saulspatz ah I see, yes I think you’re right. Should the terms be weighted by $2^4-i-j$ then? Is there a rigorous way of seeing this?
    – user7530
    Jul 29 at 18:49










  • I don't see where that factor would come from. I'd need to see the whole formula, I think. I also think Christian Blatter's answer looks reasonable.
    – saulspatz
    Jul 29 at 20:06












  • 1




    I don't think so. You seem to be treating all sequences as equally likely. I think you would have to multiply each sequence by the probability of its occurrence.
    – saulspatz
    Jul 29 at 18:15










  • @saulspatz why isn't each sequence equally likely?
    – user7530
    Jul 29 at 18:16






  • 1




    If $B=3, R=G=10,$ is the sequence $BBB$ as likely as the sequence $RGRGR$? I know you count $6$ of the former and $10cdot9cdot8cdot10cdot9$ of the latter, but to get the probability of the first, we divide by $28cdot27cdot26$ and to get the probability of the second we divide by $28cdot27cdot26cdot25cdot24$
    – saulspatz
    Jul 29 at 18:32










  • @saulspatz ah I see, yes I think you’re right. Should the terms be weighted by $2^4-i-j$ then? Is there a rigorous way of seeing this?
    – user7530
    Jul 29 at 18:49










  • I don't see where that factor would come from. I'd need to see the whole formula, I think. I also think Christian Blatter's answer looks reasonable.
    – saulspatz
    Jul 29 at 20:06







1




1




I don't think so. You seem to be treating all sequences as equally likely. I think you would have to multiply each sequence by the probability of its occurrence.
– saulspatz
Jul 29 at 18:15




I don't think so. You seem to be treating all sequences as equally likely. I think you would have to multiply each sequence by the probability of its occurrence.
– saulspatz
Jul 29 at 18:15












@saulspatz why isn't each sequence equally likely?
– user7530
Jul 29 at 18:16




@saulspatz why isn't each sequence equally likely?
– user7530
Jul 29 at 18:16




1




1




If $B=3, R=G=10,$ is the sequence $BBB$ as likely as the sequence $RGRGR$? I know you count $6$ of the former and $10cdot9cdot8cdot10cdot9$ of the latter, but to get the probability of the first, we divide by $28cdot27cdot26$ and to get the probability of the second we divide by $28cdot27cdot26cdot25cdot24$
– saulspatz
Jul 29 at 18:32




If $B=3, R=G=10,$ is the sequence $BBB$ as likely as the sequence $RGRGR$? I know you count $6$ of the former and $10cdot9cdot8cdot10cdot9$ of the latter, but to get the probability of the first, we divide by $28cdot27cdot26$ and to get the probability of the second we divide by $28cdot27cdot26cdot25cdot24$
– saulspatz
Jul 29 at 18:32












@saulspatz ah I see, yes I think you’re right. Should the terms be weighted by $2^4-i-j$ then? Is there a rigorous way of seeing this?
– user7530
Jul 29 at 18:49




@saulspatz ah I see, yes I think you’re right. Should the terms be weighted by $2^4-i-j$ then? Is there a rigorous way of seeing this?
– user7530
Jul 29 at 18:49












I don't see where that factor would come from. I'd need to see the whole formula, I think. I also think Christian Blatter's answer looks reasonable.
– saulspatz
Jul 29 at 20:06




I don't see where that factor would come from. I'd need to see the whole formula, I think. I also think Christian Blatter's answer looks reasonable.
– saulspatz
Jul 29 at 20:06










3 Answers
3






active

oldest

votes

















up vote
1
down vote













As was mentioned in the comments, you cannot just count the number of sequences ending in three blues and divide by the total number. Not all sequences are equally likely (the longer the sequence, the less likely it is).



To fix your method, you need to add up probabilities instead of numbers. For each $0le ile 2$ and $0le jle 2$, you need to compute the probability of getting your third blue ball after getting $i$ red and $j$ green balls, then sum. The result is
$$
sum_i=0^2sum_j=0^2fracbinomB2binomRibinomGjbinomB+R+G2+i+jcdot fracB-2(R-i)+(G-j)+(B-2)
$$
The first factor is the probability that the first $i+j+2$ balls consist of $i$ reds, $j$ greens and $2$ blues. The next factor is the probability that the subsequent ball is blue.






share|cite|improve this answer























  • Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
    – Christian Blatter
    Jul 30 at 16:01










  • @ChristianBlatter Excellent, thanks for pointing out the mistake.
    – Mike Earnest
    Jul 30 at 16:02

















up vote
0
down vote













There aren't all that many possibilities.



If $(r,g,b)$ is the ending state with $r$ red balls, $g$ green balls, and $b$ blue balls, then the possibilities for $(r,g,b)$ ending with three blue balls are (0,0,3), (0,1,3), (1,0,3), (0,2,3), (2,0,3), (1,1,3), (1,2,3), (2,1,3), and (2,2,3). The probability of each case can be computed from a hypergeometric distribution. Work out all nine cases and add up the probabilities.






share|cite|improve this answer





















  • Does that work out to a modification of the formula in the OP?
    – user7530
    Jul 29 at 21:42










  • @user7530 No, I don't think the formulas are equivalent.
    – awkward
    Jul 29 at 23:48

















up vote
0
down vote













The following is a full solution of the problem, but the final formula gives no insight.



Note that the game ends after at most $7$ moves. It is played on the vertices and grid lines of the lattice cube $[0..2]^3$, hence has $27$ nonterminal states.



Denote by $p(x,y,z)$ the probability that the game ends with three drawn blue balls, given that we already have drawn $x$ blue, $y$ red, and $z$ green balls. This function satisfies
$$p(3,y,z)=1,quad p(x,3,z)=0,quad p(x,y,3)=0qquad bigl(x,>y,>zin[0..2]bigr)$$
and the backwards recursion
$$p(x,y,z)=b-xover n-j>p(x+1,y,z)+r-yover n-j>p(x,y+1,z)+g-zover n-j>p(x,y,z+1) ,$$
whereby $n:=b+r+g$ and $j:=x+y+z$.



The quantity $t:=p(0,0,0)$ then is the probability you are looking for. Here is a Mathematica implementation of this approach, together with a numerical example:



enter image description here






share|cite|improve this answer























  • The lattice cube is a neat way of visualizing.
    – qwr
    Jul 30 at 13:27










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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
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%2f2866274%2fdrawing-balls-without-replacement-until-three-of-a-color-are-drawn%23new-answer', 'question_page');

);

Post as a guest






























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













As was mentioned in the comments, you cannot just count the number of sequences ending in three blues and divide by the total number. Not all sequences are equally likely (the longer the sequence, the less likely it is).



To fix your method, you need to add up probabilities instead of numbers. For each $0le ile 2$ and $0le jle 2$, you need to compute the probability of getting your third blue ball after getting $i$ red and $j$ green balls, then sum. The result is
$$
sum_i=0^2sum_j=0^2fracbinomB2binomRibinomGjbinomB+R+G2+i+jcdot fracB-2(R-i)+(G-j)+(B-2)
$$
The first factor is the probability that the first $i+j+2$ balls consist of $i$ reds, $j$ greens and $2$ blues. The next factor is the probability that the subsequent ball is blue.






share|cite|improve this answer























  • Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
    – Christian Blatter
    Jul 30 at 16:01










  • @ChristianBlatter Excellent, thanks for pointing out the mistake.
    – Mike Earnest
    Jul 30 at 16:02














up vote
1
down vote













As was mentioned in the comments, you cannot just count the number of sequences ending in three blues and divide by the total number. Not all sequences are equally likely (the longer the sequence, the less likely it is).



To fix your method, you need to add up probabilities instead of numbers. For each $0le ile 2$ and $0le jle 2$, you need to compute the probability of getting your third blue ball after getting $i$ red and $j$ green balls, then sum. The result is
$$
sum_i=0^2sum_j=0^2fracbinomB2binomRibinomGjbinomB+R+G2+i+jcdot fracB-2(R-i)+(G-j)+(B-2)
$$
The first factor is the probability that the first $i+j+2$ balls consist of $i$ reds, $j$ greens and $2$ blues. The next factor is the probability that the subsequent ball is blue.






share|cite|improve this answer























  • Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
    – Christian Blatter
    Jul 30 at 16:01










  • @ChristianBlatter Excellent, thanks for pointing out the mistake.
    – Mike Earnest
    Jul 30 at 16:02












up vote
1
down vote










up vote
1
down vote









As was mentioned in the comments, you cannot just count the number of sequences ending in three blues and divide by the total number. Not all sequences are equally likely (the longer the sequence, the less likely it is).



To fix your method, you need to add up probabilities instead of numbers. For each $0le ile 2$ and $0le jle 2$, you need to compute the probability of getting your third blue ball after getting $i$ red and $j$ green balls, then sum. The result is
$$
sum_i=0^2sum_j=0^2fracbinomB2binomRibinomGjbinomB+R+G2+i+jcdot fracB-2(R-i)+(G-j)+(B-2)
$$
The first factor is the probability that the first $i+j+2$ balls consist of $i$ reds, $j$ greens and $2$ blues. The next factor is the probability that the subsequent ball is blue.






share|cite|improve this answer















As was mentioned in the comments, you cannot just count the number of sequences ending in three blues and divide by the total number. Not all sequences are equally likely (the longer the sequence, the less likely it is).



To fix your method, you need to add up probabilities instead of numbers. For each $0le ile 2$ and $0le jle 2$, you need to compute the probability of getting your third blue ball after getting $i$ red and $j$ green balls, then sum. The result is
$$
sum_i=0^2sum_j=0^2fracbinomB2binomRibinomGjbinomB+R+G2+i+jcdot fracB-2(R-i)+(G-j)+(B-2)
$$
The first factor is the probability that the first $i+j+2$ balls consist of $i$ reds, $j$ greens and $2$ blues. The next factor is the probability that the subsequent ball is blue.







share|cite|improve this answer















share|cite|improve this answer



share|cite|improve this answer








edited Jul 30 at 15:47


























answered Jul 30 at 15:24









Mike Earnest

14.9k11644




14.9k11644











  • Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
    – Christian Blatter
    Jul 30 at 16:01










  • @ChristianBlatter Excellent, thanks for pointing out the mistake.
    – Mike Earnest
    Jul 30 at 16:02
















  • Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
    – Christian Blatter
    Jul 30 at 16:01










  • @ChristianBlatter Excellent, thanks for pointing out the mistake.
    – Mike Earnest
    Jul 30 at 16:02















Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
– Christian Blatter
Jul 30 at 16:01




Letting $b=13$, $r=21$, $g=17$ your formula and my answer give the same result $3,223,077/18,009,460$.
– Christian Blatter
Jul 30 at 16:01












@ChristianBlatter Excellent, thanks for pointing out the mistake.
– Mike Earnest
Jul 30 at 16:02




@ChristianBlatter Excellent, thanks for pointing out the mistake.
– Mike Earnest
Jul 30 at 16:02










up vote
0
down vote













There aren't all that many possibilities.



If $(r,g,b)$ is the ending state with $r$ red balls, $g$ green balls, and $b$ blue balls, then the possibilities for $(r,g,b)$ ending with three blue balls are (0,0,3), (0,1,3), (1,0,3), (0,2,3), (2,0,3), (1,1,3), (1,2,3), (2,1,3), and (2,2,3). The probability of each case can be computed from a hypergeometric distribution. Work out all nine cases and add up the probabilities.






share|cite|improve this answer





















  • Does that work out to a modification of the formula in the OP?
    – user7530
    Jul 29 at 21:42










  • @user7530 No, I don't think the formulas are equivalent.
    – awkward
    Jul 29 at 23:48














up vote
0
down vote













There aren't all that many possibilities.



If $(r,g,b)$ is the ending state with $r$ red balls, $g$ green balls, and $b$ blue balls, then the possibilities for $(r,g,b)$ ending with three blue balls are (0,0,3), (0,1,3), (1,0,3), (0,2,3), (2,0,3), (1,1,3), (1,2,3), (2,1,3), and (2,2,3). The probability of each case can be computed from a hypergeometric distribution. Work out all nine cases and add up the probabilities.






share|cite|improve this answer





















  • Does that work out to a modification of the formula in the OP?
    – user7530
    Jul 29 at 21:42










  • @user7530 No, I don't think the formulas are equivalent.
    – awkward
    Jul 29 at 23:48












up vote
0
down vote










up vote
0
down vote









There aren't all that many possibilities.



If $(r,g,b)$ is the ending state with $r$ red balls, $g$ green balls, and $b$ blue balls, then the possibilities for $(r,g,b)$ ending with three blue balls are (0,0,3), (0,1,3), (1,0,3), (0,2,3), (2,0,3), (1,1,3), (1,2,3), (2,1,3), and (2,2,3). The probability of each case can be computed from a hypergeometric distribution. Work out all nine cases and add up the probabilities.






share|cite|improve this answer













There aren't all that many possibilities.



If $(r,g,b)$ is the ending state with $r$ red balls, $g$ green balls, and $b$ blue balls, then the possibilities for $(r,g,b)$ ending with three blue balls are (0,0,3), (0,1,3), (1,0,3), (0,2,3), (2,0,3), (1,1,3), (1,2,3), (2,1,3), and (2,2,3). The probability of each case can be computed from a hypergeometric distribution. Work out all nine cases and add up the probabilities.







share|cite|improve this answer













share|cite|improve this answer



share|cite|improve this answer











answered Jul 29 at 20:39









awkward

5,06611021




5,06611021











  • Does that work out to a modification of the formula in the OP?
    – user7530
    Jul 29 at 21:42










  • @user7530 No, I don't think the formulas are equivalent.
    – awkward
    Jul 29 at 23:48
















  • Does that work out to a modification of the formula in the OP?
    – user7530
    Jul 29 at 21:42










  • @user7530 No, I don't think the formulas are equivalent.
    – awkward
    Jul 29 at 23:48















Does that work out to a modification of the formula in the OP?
– user7530
Jul 29 at 21:42




Does that work out to a modification of the formula in the OP?
– user7530
Jul 29 at 21:42












@user7530 No, I don't think the formulas are equivalent.
– awkward
Jul 29 at 23:48




@user7530 No, I don't think the formulas are equivalent.
– awkward
Jul 29 at 23:48










up vote
0
down vote













The following is a full solution of the problem, but the final formula gives no insight.



Note that the game ends after at most $7$ moves. It is played on the vertices and grid lines of the lattice cube $[0..2]^3$, hence has $27$ nonterminal states.



Denote by $p(x,y,z)$ the probability that the game ends with three drawn blue balls, given that we already have drawn $x$ blue, $y$ red, and $z$ green balls. This function satisfies
$$p(3,y,z)=1,quad p(x,3,z)=0,quad p(x,y,3)=0qquad bigl(x,>y,>zin[0..2]bigr)$$
and the backwards recursion
$$p(x,y,z)=b-xover n-j>p(x+1,y,z)+r-yover n-j>p(x,y+1,z)+g-zover n-j>p(x,y,z+1) ,$$
whereby $n:=b+r+g$ and $j:=x+y+z$.



The quantity $t:=p(0,0,0)$ then is the probability you are looking for. Here is a Mathematica implementation of this approach, together with a numerical example:



enter image description here






share|cite|improve this answer























  • The lattice cube is a neat way of visualizing.
    – qwr
    Jul 30 at 13:27














up vote
0
down vote













The following is a full solution of the problem, but the final formula gives no insight.



Note that the game ends after at most $7$ moves. It is played on the vertices and grid lines of the lattice cube $[0..2]^3$, hence has $27$ nonterminal states.



Denote by $p(x,y,z)$ the probability that the game ends with three drawn blue balls, given that we already have drawn $x$ blue, $y$ red, and $z$ green balls. This function satisfies
$$p(3,y,z)=1,quad p(x,3,z)=0,quad p(x,y,3)=0qquad bigl(x,>y,>zin[0..2]bigr)$$
and the backwards recursion
$$p(x,y,z)=b-xover n-j>p(x+1,y,z)+r-yover n-j>p(x,y+1,z)+g-zover n-j>p(x,y,z+1) ,$$
whereby $n:=b+r+g$ and $j:=x+y+z$.



The quantity $t:=p(0,0,0)$ then is the probability you are looking for. Here is a Mathematica implementation of this approach, together with a numerical example:



enter image description here






share|cite|improve this answer























  • The lattice cube is a neat way of visualizing.
    – qwr
    Jul 30 at 13:27












up vote
0
down vote










up vote
0
down vote









The following is a full solution of the problem, but the final formula gives no insight.



Note that the game ends after at most $7$ moves. It is played on the vertices and grid lines of the lattice cube $[0..2]^3$, hence has $27$ nonterminal states.



Denote by $p(x,y,z)$ the probability that the game ends with three drawn blue balls, given that we already have drawn $x$ blue, $y$ red, and $z$ green balls. This function satisfies
$$p(3,y,z)=1,quad p(x,3,z)=0,quad p(x,y,3)=0qquad bigl(x,>y,>zin[0..2]bigr)$$
and the backwards recursion
$$p(x,y,z)=b-xover n-j>p(x+1,y,z)+r-yover n-j>p(x,y+1,z)+g-zover n-j>p(x,y,z+1) ,$$
whereby $n:=b+r+g$ and $j:=x+y+z$.



The quantity $t:=p(0,0,0)$ then is the probability you are looking for. Here is a Mathematica implementation of this approach, together with a numerical example:



enter image description here






share|cite|improve this answer















The following is a full solution of the problem, but the final formula gives no insight.



Note that the game ends after at most $7$ moves. It is played on the vertices and grid lines of the lattice cube $[0..2]^3$, hence has $27$ nonterminal states.



Denote by $p(x,y,z)$ the probability that the game ends with three drawn blue balls, given that we already have drawn $x$ blue, $y$ red, and $z$ green balls. This function satisfies
$$p(3,y,z)=1,quad p(x,3,z)=0,quad p(x,y,3)=0qquad bigl(x,>y,>zin[0..2]bigr)$$
and the backwards recursion
$$p(x,y,z)=b-xover n-j>p(x+1,y,z)+r-yover n-j>p(x,y+1,z)+g-zover n-j>p(x,y,z+1) ,$$
whereby $n:=b+r+g$ and $j:=x+y+z$.



The quantity $t:=p(0,0,0)$ then is the probability you are looking for. Here is a Mathematica implementation of this approach, together with a numerical example:



enter image description here







share|cite|improve this answer















share|cite|improve this answer



share|cite|improve this answer








edited Jul 30 at 13:17


























answered Jul 29 at 18:59









Christian Blatter

163k7107306




163k7107306











  • The lattice cube is a neat way of visualizing.
    – qwr
    Jul 30 at 13:27
















  • The lattice cube is a neat way of visualizing.
    – qwr
    Jul 30 at 13:27















The lattice cube is a neat way of visualizing.
– qwr
Jul 30 at 13:27




The lattice cube is a neat way of visualizing.
– qwr
Jul 30 at 13:27












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2866274%2fdrawing-balls-without-replacement-until-three-of-a-color-are-drawn%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?