# X random variable with exponential distribution, calc variance X

for some exersice i try to calc VX. X is a random variable with exponential distribution and density $f(x)=e^{-x}$ for $x\ge 0$. So i calculated the expectation value which is EX = 1 (right?). So with this value i want to use

$$VX=EX^2 -(EX)^2$$ So i need only to calculate $EX^2$. My approach:

$$EX^2 = \int_{0}^\infty x^2 e^{-x} dx$$ So now i have problems to integrate this.

The next question is how to calc $P(X\ge a | X \ge 1)$ $a \in$ real numbers.

-
I tried to clarify the question; it seems you'd written two formulas without intervening space, making them appear as one -- please check whether it now says what you meant. – joriki Feb 3 '13 at 19:24
The lower bound on the integral is wrong; this integral would diverge; the lower bound should be $0$, since the density of the exponential distribution is zero for negative values. – joriki Feb 3 '13 at 19:26
oh yes you're right! i fixed this. – user1324258 Feb 3 '13 at 19:28

You can use the moment generating function for the exponential distribution. The moment generating function for this is the $E(e^{tx})$ $$E(e^{tx}) = \int_{0}^\infty e^{(t-1)x} dx$$ Now differentiate this function and put t=0 to get $E(X)$ and differentiate it twice and put t=0 to get $E(X^2)$. And then calculate the $V(X)$. $$E(e^{tx})=\frac{1}{1-t}$$ Now differentiate it once to evaluate $$E'(e^{tx})=\frac{1}{(1-t)^2}\Rightarrow E'(e^{tx}) \text{at t=0 is}=1$$ Implying the $E(X)=1$ Again, $$E''(e^{tx})=\frac{2}{(1-t)^3}$$ Again this one at t=0 gives the value of$$E(X^2)=2$$ After all the calculation the variance evaluates to be $2-1=1$.In this problem I have used the fact the nth derivative of a generating function at the point 0 gives the expection of the random variable raised to the power n. $$E(e^{tx})=E(\sum_{i=0}^{\infty}\frac{(tx)^i}{i!})=\frac{t^i}{i!}\sum_{i=0}^{\infty}(E(X^i))$$

(Using the linearity of expectation.)Now by differentiating this we get the things done above.

-
Please point out the mistake if you find one.Thanks in advance. – Abhra Abir Kundu Feb 3 '13 at 19:33
Sorry i dont understand how to do this, could you please edit your answer with this approach? – user1324258 Feb 3 '13 at 19:36
Now is it okay????? – Abhra Abir Kundu Feb 3 '13 at 19:46
I do net see the connection between $E''(e^{tx})$ and $E(X^2)$. – user1324258 Feb 3 '13 at 19:54
If ncmathsadist's answer was already too complicated for the OP's taste, this seems like multiple overkill. – joriki Feb 3 '13 at 19:54

To find $E(X^2)$, integrate by parts twice. Each time differentiate the power of $x$ and it will whittle away. Begin with $u = x^2$, $dv = e^{-x}\, dx$.

-
This seems to be complicated. THis was one of many ecersices in a exam of the last year, so i think there should be a simple and short way of calculating VX. May there is a shortes and better approach of calc $EX^2$ ? But i will try this. – user1324258 Feb 3 '13 at 19:24
@user1324258: If you find this too complicated to calculate on the spot, you can remember the result, $\int_0^\infty x^n\mathrm e^{-x}\mathrm dx=n!$, which comes up quite a lot. It's related to the gamma function. – joriki Feb 3 '13 at 19:28
Well, the mean and variance of the exponential distribution are probably two of the facts to learn by heart, rather than computing them again every time. – GEdgar Feb 3 '13 at 20:00
Joriki's result is established by the technique I have outlined here. – ncmathsadist Feb 3 '13 at 20:18