# How to compute probability that draw exactly $r$ balls in $k$ balls?

I have $k_1$ red balls and $k_2$ blue balls in a box. Let $p_r$ be probability that randomly select $r$ balls in the box without replacement, $\sum_{r=1}^{m} p_r=1$; where $m$ is maximum number of drawn ball, and given.

We can compute the probability that in $r$ drawn balls that exactly have $i$ red ball and $r-i$ blue balls as follows (Hypergeometric distribution):

$$P=p(r) \times \frac{\binom{k_1}{i}\binom{k_2}{r-i}}{\binom{k_1+k_2}{r}}$$

Because $i$ from $0$ to $k_1$ and $r$ is from $1$ to $m$, the probability will be

$$P= \sum_{r=1}^{m} p(r) \sum_{i=0}^{r} \frac{\binom{k_1}{i}\binom{k_2}{r-i}}{\binom{k_1+k_2}{r}}$$

However, what is happen if $r \ge k_1$, How can I modify the range of summation term to make the equation valid?

This question is totally different with Find expected number of successful trail in $N$ times because the question aims to modify the range of probability term, instead of expected value.

• Do you mean $i\ge k_1$? – GoodDeeds Aug 23 '16 at 13:43
• Because $r$ is upper bound of $i$ in second summation, Hence is it right when we said $i \ge k_1$ – Jame Aug 23 '16 at 13:45