Suppose you have three random variables $X, Y, Z,$ where $X\sim \text{Exponential}(2)$, $Y\sim \text{Exponential}(1)$, $Z\sim \text{Exponential}(2.5)$. Let the random variable $D$ be given by $D= 3X + 2Y + Z$.
- What is $\mathsf E(D)?$
- What is $\mathsf{Var}(D)?$
Intuitively, for 1., I thought that $\mathsf E(D) = \mathsf E(3X + 2Y + 1Z) = 3\mathsf E(X) + 2\mathsf E(Y) + \mathsf E(Z) = 7.5$, but I’m not sure this agrees with the joint distribution of $D$.
Linearity of expectation assures that no matter if $X$, $Y$, and $Z$ are independent or dependent, we must have $$\operatorname{E}[3X + 2Y + Z] = 3\operatorname{E}[X] + 2\operatorname{E}[Y] + \operatorname{E}[Z],$$ as you suggested.
For the variance, without knowing whether $X$, $Y$, and $Z$ are independent, it is not possible to determine the variance of $D$. If they are in fact independent, then we have $$\operatorname{Var}[3X + 2Y + Z] \overset{\text{ind}}{=} 3^2 \operatorname{Var}[X] + 2^2 \operatorname{Var}[Y] + \operatorname{Var}[Z].$$ Otherwise, there are additional covariance terms.