Hello i'm trying to solve this problem (Answer provided).

I managed to get to $E(X)=1$, but can't figure out why $Var(X)=1$.
As I tried to solve:
$Var(X) = E(X^2) - [E(X)]^2$ $[E(X)]^2 = [1]^2$ Left to calculate: $E(X^2)$
$$E(X^2) = \sum_{i=1}^{n} Xi*P(X=Xi) = \sum_{i=1}^{n} i*P(X=Xi)$$
Because Xi are all the values X can get.
So in our scenerio, Xi means that there will be i fixed points $=>$ Xi=i.
But here I don't know to to calculate P(X=Xi).
Edit: I'm getting to $$\sum_{i=1}^{n} i*{n \choose i}*(1/n)^i*\frac{(n-i)!}{e}$$ For choosing i to be at iteration point, probability for them to fit, and then make the others in order without iteration point. But it's too complicated expression and I don't see how it reaches the final result. Someone knows how to get for Var(X) = 1 ? Thanks
A useful fact is that if $\{e_1,...,e_n\}$ is a finite set of events and $X$ is a random variable counting the number of these events that occur, then $$\mathrm{Var}(X)=\sum_{i=1}^n\sum_{j=1}^nP(e_i\cap e_j)-\sum_{i=1}^n\sum_{j=1}^nP(e_i)P(e_j).$$ (The first term is $E(X^2)$ and the second is $E(X)^2$.)
In your case $e_i$ is the event that ball $i$ is in the right place. For any $i\neq j$ we have $P(e_i\cap e_j)=\frac1{n(n-1)}$, and $P(e_i\cap e_i)=P(e_i)=\frac1n$. Thus $$\mathrm{Var}(X)=n(n-1)\frac1{n(n-1)}+n\frac1n-n^2\frac1{n^2}=1.$$