# Homework Help: Stats: Covariace of 2 Random Variables

1. Dec 7, 2012

### JP16

1. The problem statement, all variables and given/known data
Let X ~ Exponential(3) and Y ~ Poisson(5). Assume X and Y are independent. Let Z = X + Y. Compute the Cov(X,Z).

2. Relevant equations

I know Cov(X, Z) = E(XZ) - E(X)E(Z). But how do I compute E(XZ) and E(Z) ?? Since for E(XZ), I would need the pdf/pmf (Exp is abs cts, while Poisson is discrete). Or can I do the following:

3. The attempt at a solution

Cov (X, Z) = Cov(X, X + Y)
= Cov(X, X) + Cov(X,Y)
= Var(X) + Cov(X,Y)
Since X, Y indep., Cov(X,Y) = 0
= Var(X)

Is this the correct derivation? Any help would be greatly appreciated, as the exam is just around the corner. Thanks.

Last edited: Dec 7, 2012
2. Dec 7, 2012

### jbunniii

That is the answer I got. If you are not sure about the derivation, try writing it out in terms of expected values.

3. Dec 7, 2012

### JP16

Thank you for confirming. Although this problem is solved, I would like to know more. Before I was trying to Cov(X,Z) directly without subbing the 'X+Y', and problems rose there. Because

Cov(X,Z) = E(XZ) - E(X)E(Z) then,

E(XZ) = ∫Dxz fX,Z(x, z) dD, where fX,Z(x, z) is the prob. density function of X,Z. Is there any way we can find this function?

E(XZ) = E(X)E(Z), iff X,Z are ind. But clearly Z is dependent of X. Hence this won't work. Is the above way, the only way?

4. Dec 7, 2012

### Ray Vickson

Just as a matter of notation: does X~exponential(3) mean EX = 3 or EX = 1/3? (The second way is more common, but I have seen the first as well.)

Anyway:
$$Cov(X,Z) = E(XZ) - EX EZ = E X^2 + E(X Y) - (EX)^2 - EX EY.$$
What is E(X Y)? What do you get after simplification? (Hint: your final answer is OK.)

Note: you used a result Cov(X,X+Y) = Cov(X,X) + Cov(X,Y) for uncorrelated X,Y, but you need to derive this first. By proceeding directly you can by-pass this.

5. Dec 8, 2012

### JP16

We use the mean as 1/3. E(XY) = E(X) E(Y) since X and Y are independent. So than it is equal to the Var(X). Thanks for both of your help. Much appreciated. :)