I want to compute the variance of a random variable $X$ which has hypergeometric distribution $\mathrm{Hyp}(n,r,b)$, where $n$ is the total number of balls in the urn and $r$ and $b$ are the numbers of red/black balls, by using the representation
$$X= I_{A_1} + \cdots + I_{A_n}$$
($I_A$ is the indicator function of $A$ and $A_i$ means that we have a red ball in the $i$-th draw).
So for the expected value we have
$$E[X] = E[I_{A_1} + \cdots + I_{A_n}] = E[I_{A_1}] + \cdots +E[I_{A_n}] = P(A_1) + \cdots + P(A_n)$$
But I don't know how to calculate these $P(A_i)$. And what about $E[X^2]$? Can anybody help?
Thanks in advance!