Here's another way to do it, but it's still a lot of work. I'd want to write a computer program. Consider the situation just before the third red ball is drawn. We've previously drawn $2$ red balls, and from $0$ to $2$ of each of the other $3$ colors, so there are $27$ possibilities. For each of these possibilities, compute the probability that the situation arises and multiply by the probability that the next draw is red. Add up the results for all $27$ cases.
One example will sufficiently indicate the computations. Suppose we have chosen $2$ red balls, $2$ green balls, $1$ yellow ball and one blue ball. There are $\frac{6!}{2!2!}=180$ permutations of the string "RRGGYB". For each of these, we have $6\cdot5$ ways to choose the red balls, $9\cdot8$ ways to choose the green balls, $8$ ways to choose the yellow ball, and $7$ ways to choose the blue ball, giving $6\cdot5\cdot9\cdot8\cdot8\cdot7$ ways in all. We have chosen $6$ balls from $30$ so there were $30\cdot29\cdot28\cdot27\cdot26\cdot25$ possible choices. Now there are $24$ balls left, and $4$ of them are red, so the probability that the next draw is red is $\frac4{24}.$ The probability for this case is $$\frac{180\cdot6\cdot5\cdot9\cdot8\cdot8\cdot7}{30\cdot29\cdot28\cdot27\cdot26\cdot25}\cdot\frac4{24}$$
I wrote a python script to do the indicated calculations for each color, and it seems to have worked correctly, in that the computed probabilities sum to $1$.
Here's the script:
from itertools import product
from math import factorial
def probabilities(balls, goal):
'''
balls is the list a the number of balls of each color
goal is the number of balls of one color to be drawn
returns a list of the probabilities that each color wins
'''
if min(balls)<goal:
raise ValueError('Each color must have at least goal balls')
answer = []
for idx, b in enumerate(balls):
answer.append(winner([b]+balls[:idx]+balls[idx+1:], goal))
return answer
def winner(balls, goal):
'''
Compute probability that the winner is the first color
in the list.
'''
n = sum(balls)
others = balls[1:]
answer = 0
for p in product(range(goal), repeat = len(others)):
total = ((goal-1),) + p
num = factorial(sum(total))
for idx, t in enumerate(total):
num //= factorial(t)
b = balls[idx]
num = factorial(b)/factorial(b-t)
left = n-sum(total)
den = factorial(n)//factorial(left)
draw = (balls[0]-goal+1)
answer += (num/den)(draw/left)
return answer
probs= probabilities([6,7,8,9], 3)
print(probs)
print(sum(probs))
and the output:
[0.13806360223151828, 0.2058007126972644,
0.28417096812898923, 0.37196471694222827]
1.0000000000000002
Check it out. Does it help?
– Fawkes4494d3 Jun 25 '20 at 04:51