# hypergeometric distribution with a priori probability

Is there a way to calculate drawing without replacement m from N elements s.t. r out of m are red balls and g out of m are green balls, following hypergeometric distribution, but when there's a given probability for drawing an element (as oppose to uniform in the case of hypergeometric) ? for example, red balls are uniformly distributed and green balls are uniformly distributed. There're in total G green balls.

The way I've been thinking to accomplish this, is following: $$\prod_{i=0}^{m} \cdot \binom{m}{i}\cdot(\frac{G-i}{N})^i\cdot(1-\frac{G-i}{N})^{(m-i)}$$

the binomial coefficient is for number of combinations choosing i green balls from m. The second term is the probability of choosing a green ball, and the third term is the probability for not choosing a green ball (choosing a red ball).

All three terms are multiplied m times, since the choice of green ball is dependent on previous choice (without replacement).

If green balls are distributed in some other distributions, than the second and third term would be sampled according to this distribution.

Thank you

As far as I can understand, you are asking two different problems:

1) when the number of the balls for each colours is known. Then it is a combinatorial problem, and not the easiest one. You may find the formula and one of the possible proof: http://arxiv.org/pdf/1511.06142.pdf

2) If you don't know the exact number of the balls of each colour in the box, but only their distribution, then the problem seems harder. And I can't help that much... I think the answer is not combinatorial, but is a probability density function, described a weighted sum of the distribution of each colour in the box.

Edit: After talking to a much wiser colleague, the formula that provides the answer should be:

$\mathbb{P}(C_1 = n_, C_2 = n_2, ... , C_c = n_c) = \binom{n}{n_1, n_2, ... n_c} \binom{N-n}{N_1 - n_1, N_2-n_2,... , N_c-n_c}/\binom{N}{N_1, N_2, ..., N_c}$

Where $\binom{a}{b, d}$ is the multinomial coefficient, $n$ is the total number of balls extracted, $N$ the total number of balls in the box, $C_j$ is the random variable that count the number of balls of color $j$, $n_j$ is the number of balls extracted of colour $j$, and $N_j$ is the total number of balls of color $j$ initially in the box.

• Thanks for your reply. I do know the number of the balls for each color. The article you mentioned talks about the number of possible drawings. But, I don't need all possible drawings satisfying the constraints but only the probability of specific drawing or preferably the amount of green(or red balls) in such drawing. – Daniel Mar 9 '16 at 18:40
• I don't think what you suggest would be correct. Assume: total number of balls is 100, number of green balls - 5, number of red balls - 75. I draw, m, 25 balls (out of 100). Lets assume green and red balls are uniformly distributed. It can't be that the probability for drawing m including all green balls is the same as not including green balls at all. The probability for not including green balls should be much higher (since there're significantly less green balls relatively to total number of balls). – Daniel Mar 9 '16 at 19:28
• Yes, you are right. The possible handful are not equiprobable! Wrong suggestion removed. – SeF Mar 10 '16 at 10:59
• Daniel, since the question was on hold I tried to change it according to what you said in the comments. Please feel free to change it back or add some more details! – SeF Mar 10 '16 at 11:22
• Thank you for your effort. In the solution you provided, there's no reference to the distribution of the green/red balls. (If it's multinomial distribution, then it's uniform distribution of the combinations over n). In addition, isn't if as soon as I choose green balls, I do not need to choose the red balls ? Please see my edit for my thoughts on the solution. Thanks – Daniel Mar 12 '16 at 22:37