randomly throw balls to urns (expected value and variance) $n$ randomly throw balls to $n$ urns. Calculate the variance and the expected value of non-empty urn.
My attempt:
$X$-the number of non-empty urns.
$x_i = 1$ (i-th urn is non-empty)
$x_i = 0$ (i-th urn is empty)
$$X=X_1+X_2+\cdots+X_n$$
$$E(X_i)=P(X_i=1) = 1 - \left(\frac{n-1}{n}\right)^n $$
$$E(X) = n\left(1-\left(\frac{n-1}{n}\right)^n\right) $$
Expected value is correctly computed.
Let's try to compute $Var X$
$Var X = E(X^2)-(E(X))^2 = E((X_1+...+X_n)^2) - (1-(\frac{n-1}{n})^n)^2$
$= E(n-n(\frac{n-1}{n})^n)^2) - (1-(\frac{n-1}{n})^n)^2$
What should I do ? I can't finish it :(
 A: As mentioned in a comment, the expectation of $X$ is correct. Here the indicator  random variable $X_i$ is $1$ if the $i$-th urn is non-empty, and $0$ otherwise.
To find the variance, as pointed out in the post, we need to find $E((X_1+\cdots+X_n)^2)$.
Expand, and use the linearity of expectation. In the expansion, there are $n$ terms of the shape $E(X_i^2)$. Since $X_i^2=X_i$, we know the expectation of $\sum_1^n X_i^2$.
In addition, in the expansion we have $(n)(n-1)$ terms of the shape $E(X_iX_j)$ where $i\ne j$. 
Note that if $i\ne j$, then the probability that $X_iX_j=1$ is the probability that Urn $i$ and Urn $j$ are both non-empty. This is $1$ minus the probability that one or both is empty. And the probability that one or both is empty is 
$$\left(\frac{n-1}{n}\right)^n +\left(\frac{n-1}{n}\right)^n-\left(\frac{n-2}{n}\right)^n$$
(the probability that Urn $i$ is empty, plus the probability Urn $j$ is minus (Inclusion/Exclusion) the probability they both are empty.  
We leave it to you to put the pieces together.
