# Math Help - conditional expectation, covariance

1. Originally Posted by Volga
This is neat, I think I can learn this trick. Just one question, when you substituted $y=u=\lambda (x-y)$ you didn't do anything to the lower bound of integral which was $y$ - instead, you put it zero. Is it legitimate? Since the lower bound was y, and the new variable of integration (u) still depends on y, why did you change it to zero just like that?

(Also, isn't it strange that $\Gamma(2)$ and $\Gamma(1)$ both equal to the same number, 1? understand that this comes from $\Gamma(n)=(n-1)!$ and that 0!=1 by convention, but I still find it very strange.)

By the way, I did another (non-Gamma) integration but with some substition and I got to $y-\frac{1}{\lambda}$ which is still not correct. But I'll rechecked my signs and I still cannot figure out where I make mistake. I'll keep trying, binomially, until success...
I did a normal calculus one substitution, y is fixed.

$u=\lambda (x-y)$ since $\lambda$ is positive when x approaches infinity so does u.

AND when x is y, then u=0. This is basic calculus 1.

And those pictures of lakeshore drive (LSD) with cars trapped for 14 hours is exactly by my apartment.
I take LSD (joke) to work and use that entrance all the time.
I haven't driven since Tuesday and I hear everything is cleared by now.
So, I'm heading to school this afternoon.

2. So, to finish it off

$E(Y^2)=\int_0^{\infty}y^2\frac{k}{\lambda}e^{-{\lambda}y}dy=\frac{k}{\lambda}\int_0^{\infty}\fra c{1}{{\lambda}^3}(y{\lambda})^2e^{-y{\lambda}}d(y{\lambda})=\frac{k}{{\lambda}^4}\Gam ma(3)=\frac{2k}{{\lambda}^4}=\frac{2}{{\lambda}^2}$

Then $E(XY)=\frac{2}{{\lambda}^2}+\frac{1}{\lambda}\frac {1}{{\lambda}^2}=\frac{3}{{\lambda}^2}$ (also checked by direct integration of the product of xy and the joint density)

$Cov(X,Y)=\frac{3}{{\lambda}^3}-\frac{2}{\lambda}\frac{1}{\lambda}=\frac{1}{{\lamb da}^2}$

By the way, I checked E(X) via integration and it is indeed $\frac{2}{\lambda}$.

So I guess it's solved?

By the way, thanks for teaching me the Gamma function application in integration. That wasn't at all as scary as I thought.

3. Originally Posted by matheagle
AND when x is y, then u=0. This is basic calculus 1.
That's just simple arithmetic... I should have seen it!

4. For the record, I did find my error in the very first integration in calculating E(X|Y).
When I had integral with e^(-lambda*x), I forgot to update the sign of dx (substitution: $d(-{\lambda}x)=-{\lambda}dx$ so lost one minus sign here. The Gamma integral is also more efficient because I think there are less sign changes overall to deal with.

Page 2 of 2 First 12