I need to find the variance of a random variable that has the following probability function:
$$ P(X=x)=\begin{cases} \frac{1}{e-1}\frac{1}{n!}, n=1,2,3,... \\ 0,\ \ \text{ else } \end{cases}$$
I found that $E[X]=\frac{e}{e-1}$, but I don't know how to find $P(X^2=k)$ and $E[X^2]$ in order to use the formula $Var[X]=E[X^2]-E[X]^2$.
I know that because $x$ is positive so $P(X^2=k)=P(X=\sqrt{k})$ but I don't know how to calculate it, since it's zero if $k$ isn't a square number, and $\frac{1}{e-1}\frac{1}{(\sqrt{k})!}$ if it is, and I don't know how to check it and calculate it.
If you found $\mathbf{E}X$, you know how to solve $\sum_k \frac{k}{(k-1)!}$, so to get $$ \mathbf{Var}X =\sum_k \frac{k^2}{(k-1)!} = \sum_k \frac{(k-1+1)^2}{(k-1)!} = \sum_k \frac{(k-1)^2}{(k-1)!} + 2\sum_k \frac{k-1}{(k-1)!} + \sum_k \frac{1}{(k-1)!} $$ For the first term you get $\sum_k \frac{(k-1)}{(k-2)!}$, which you can solve like $\mathbf{E}X$, the second sum is $2(\mathbf{E}X - 2c)$ for some constant $c$ and the rest is the same. Can you handle from here?