Variance of drawing coins from a bag. First off, disclaimer, this was a homework question, albeit one that I've already turned in.
I was given the problem
There is a bag containing forty coins: 5 nickels, 10 dimes, and
25 quarters. Let X be the value of drawing twenty coins out of
this bag at random without replacement. Calculate the expected
value and the variance of X

I calculated $\mathbb{E}[X]$ by noting that we would expect to grab half of each type of coin, thus $\mathbb{E}[X]=2.5(.05)+5(.10)+12.5(.25)=3.75$. Where I got stuck was calculating the variance. I'm aware of the formula $Var[X]=\mathbb{E}[(X-\mathbb{E}[X])^2]$, which seems relevant, but I'm not sure how to apply it. Any hints/help would be appreciated!
 A: The second moment $E(X^2)$ is given by
$$
E(X^2)=\sum_{i=1}^{20} E(X_i^2)+2\sum_{i=1}^{20} \sum_{j=i+1}^{20} E(X_i X_j)
$$
$$
=20E(X_1^2)+20\times19\times E(X_1X_2)
$$
Obviously, 
$$
E(X_1^2)=(5/40)*0.05^2+(10/40)\times 0.10^2+(25/40)\times 0.25^2.
$$
To find $E(X_1X_2)$, imagine that the coins are drawn  one by one without replacement. The following six unordered outcomes can be associated with the first two drawings: $\{N,N\}, \{N,D\}, \{N,Q\}, \{D,D\}, \{D,Q\},\text{ and }\{Q,Q\}$ with respective probabilities $\frac{5}{40}\frac{4}{39}=\frac{20}{1560}$, $\frac{5}{40}\frac{10}{39}+\frac{10}{40}\frac{5}{39}=\frac{100}{1560}$, $\frac{5}{40}\frac{25}{39}+\frac{25}{40}\frac{5}{39}=\frac{250}{1560}$, $\frac{90}{1560}$, $\frac{500}{1560}$, and $\frac{600}{1560}$. This gives:
$$
E(X_1X_2)=\frac{20*0.0025+100*005+250*0.0125+90*0.01+500*0.025+600*0.0625}{1560}
$$
A: Hint: $Var(X)=\mathbb{E}[X^2]-(\mathbb{E}[X])^2$
(Because: $Var(X)=\mathbb{E}[(X-\mathbb{E}[X])^2]=\mathbb{E}[X^2-2X\mathbb{E}[X]+\mathbb{E}[X]^2]$ $=\mathbb{E}[X^2]-2\mathbb{E}[X]\mathbb{E}[X]+(\mathbb{E}[X])^2=$ $\mathbb{E}[X^2]-(\mathbb{E}[X])^2$ )
You already have $\mathbb{E}[X]$, do you know how to calculate $\mathbb{E}[X^2]$?
Well to calculate $\mathbb{E}[X^2]$ you can use the following proposition:
$$\mathbb{E}[g(X)]=\sum_{x\in D}g(x)\mathbb{P}\{X=x\}=\sum_{x\in D}g(x)f_X(x)$$
Where $D$ is a set such that $\mathbb{P}\{X\in D\}=1.$ In this case, $g(x)=x^2$. The only problem is that there are many elements in $D$ in your problem which makes it a little difficult to compute. For now that's all I can think of.
