# problem with balls

An urn contains 30 balls, of which 10 are red and 8 are blue. From this urn, 12 balls are randomly withdrawn. Let X denote the number of red and Y the number of blue balls that are withdrawn. Find Cov(X,Y) by defining appropriate indicator (that is, Bernoulli) random variables $X_i,Y_j$ such that $X=\sum_{i=1}^{10} X_i$,$Y=\sum_{j=1}^{8} Y_j$

My attempt is:

Let $X_{i} = \begin{cases}1 & \text{ if i-th red ball is withdrawn } \\ 0 & \text{ otherwise }\end{cases}$

$X=\sum_{i=1}^{10} X_i$=number of red balls withdrawn.

Let $Y_{i} = \begin{cases}1 & \text{ if i-th blue ball is withdrawn } \\ 0 & \text{ otherwise }\end{cases}$

$Y=\sum_{i=1}^{8} Y_i$=number of blue balls withdrawn.

$$cov(X,Y)= cov (\sum_{i=1}^{10} X_i,\sum_{j=1}^{8} Y_j)=\sum_{i=1}^{10} \sum_{j=1}^{8}cov(X_i, Y_j)$$

with \begin{align}cov(X_i,Y_j) &= E[X_i*Y_j]-E[X_i]*E[Y_j]\\ &=p(X_i=1,Y_j=1)-p(X_i=1)*p(Y_j=1)\end{align}

I don't understand why $$p(X_i=1,Y_j=1)=\binom{28}{10} /\binom{30}{12}$$ and $$p(X_i=1)=p(Y_j=1)=12/30$$ that are the solution according to my book ($cov(X,Y)=80*[\binom{28}{10} /\binom{30}{12}-( \frac{12}{30})^2]=- \frac{96}{145}$. Could someone help me?

• With our without replacement?
– zoli
Commented Jan 27, 2017 at 12:08

$\binom{30}{12}$ is total number of different sets of 12 balls from the set of 30 balls. $\binom{28}{10}$ is a number of sets of 12 balls, which contains $i$-th red ball and $j$-th blue ball, since we must add 10 new balls from 28 other balls. So, the probability that $i$-th red ball and $j$-th blue ball are taken is equal to $\binom{28}{10}/\binom{30}{12}$.

In the same manner the probability that one fixed ball is taken is equal to $$\binom{29}{11}/\binom{30}{12}=12/30.$$

• Where does 28 come from?
– Anne
Commented Jan 27, 2017 at 14:04
• total number of balls 30 minus two fixed balls. We must choose 10 additional balls from 28 other balls
– Ilya
Commented Jan 27, 2017 at 14:15
• Since there 10 red balls and 8 blue balls could also be $$p(X_i=1,Y_j=1)=\binom{28}{10}*\binom{10}{1}*\binom{8}{1} /\binom{30}{12}$$ and $$p(X_i=1)=\binom{29}{11}*\binom{10}{1}/\binom{30}{12}$$ $$p(Y_j=1)=\binom{29}{11}*\binom{8}{1}/\binom{30}{12}$$ can you explain me why it is not right?
– Anne
Commented Jan 27, 2017 at 15:59
• Since you have already fixed $i$-th red ball, you don't need to multiply by $\binom{10}{1}$.
– Ilya
Commented Jan 27, 2017 at 16:29
• Now I understand, thank you!
– Anne
Commented Jan 27, 2017 at 16:38