# Thread: Mean and variance of two stochastic variables combined

1. ## Mean and variance of two stochastic variables combined

Hi,

I'm stuck with a little problem that I need to use for my research.

Let X and N be stochastic random variables. I need to show that:

Mean:
E(sum(X)) = E(N) * E(X)

Variance:
var(sum(X)) = E(N) * var(X) + var(N) * (E(X))^2

Anyone knowing to do this?

Cheers, Eva

2. Originally Posted by Eva BSc
Mean:
E(sum(X)) = E(N) * E(X)
When $N=n, \ \ S = \sum_i X_i$ has $E(S)=nE(X_i)$

Breaking things down according to the value of $N,$ we have...

$E[S] = \sum_{n=0}^{\infty} E(S|N=n)P(N=n) = \sum_{n=0}^{\infty} nE(X_i)P(N=n) = E(N)E(X_i)$

3. Originally Posted by Eva BSc
Variance:
var(sum(X)) = E(N) * var(X) + var(N) * (E(X))^2
When $N=n, \ \ S = \sum_i X_i$ has $Var(S) = nVar(X_i)$ and hence,

$E(S^2|N=n)= nVar(X_i) + (nE(X_i))^2$

Then,

$E[S^2] = \sum_{n=0}^{\infty} E(S^2|N=n)P(N=n) =$ $\sum_{n=0}^{\infty} \{nVar(X_i) + n^2 (E(X_i))^2 \}P(N=n) = E(N)Var(X_i) + E(N^2) (E(X_i))^2$

So,

$Var(S) = E(S^2) - (E(S))^2 =$ $E(N)Var(X_i) + E(N^2)(E(X_i))^2 - (E(N)E(X_i))^2 = E(N)Var(X_i) + Var(N)(E(X_i))^2$

4. Thnx!

5. I had to prove this in my homework a while back.

6. I've used this fact before, but never seen its proof. Thanks!

7. Just to confirm, my instructor verified that the proof above is valid and correct...