Calculate $\mathbb E(5 - 3X) - D(2 - X)$ with $Uniform$ ~ $[-3, 3]$

30 Views Asked by At

I have continuous uniform distribution $Uniform$ ~ $[-3, 3]$. And I want to calculate $\mathbb E(5 - 3X) - D(2 - X)$. But I am getting conflicting results:

First solution $$\mathbb E(5 - 3X) - D(2 - X) = \mathbb E(5 - 3X) - \mathbb E((2-X)^2) + \mathbb E^2(2-X) = \mathbb E(5) - \mathbb E(3X) - [\mathbb E(4) - \mathbb E(4X) + \mathbb E(X^2)] + [\mathbb E(2) - \mathbb E(X)]^2 = 5 - 3\mathbb E(X) - 4 + 4\mathbb E(X) - \mathbb E(X^2) + 4 - 4\mathbb E(X) + \mathbb E^2(X) = 5 + \mathbb E(X) = 5$$

Second solution $$\mathbb E(5 - 3X) - D(2 - X) = \mathbb E(5) - \mathbb E(3X) - D(X) = 5 - 3 \cdot0 - 3 = 2$$

I used the linearity of the expectation and the fact that $\mathbb E(X) = \frac{-3 + 3}{2} = 0$.

I can't understand what the error is.

1

There are 1 best solutions below

2
On BEST ANSWER

The second calculation is correct. The first is incorrect. It should be instead $$\begin{align} \operatorname{E}[5-3X] - \operatorname{Var}[2-X] &= \operatorname{E}[5 - 3X] - \operatorname{E}[(2-X)^2] + \operatorname{E}^2[2-X] \\ &= \operatorname{E}[5] - \operatorname{E}[3X] - \operatorname{E}[4 - 4X + X^2] + (\operatorname{E}[2] - \operatorname{E}[X])^2 \\ &= 5 - 3 \operatorname{E}[X] - 4 + 4\operatorname{E}[X] - \operatorname{E}[X^2] + (2 - 0)^2 \\ &= 5 - 4 - \operatorname{E}[X^2] + 4 \\ &= 5 - \operatorname{E}[X^2]. \end{align}$$

But what is $\operatorname{E}[X^2]$? It is certainly not $0$. It is $$\operatorname{E}[X^2] = \int_{x=-3}^3 x^2 \cdot \frac{1}{6} \, dx = \left[\frac{x^3}{18}\right]_{x=-3}^3 = \frac{2(27)}{18} = 3.$$ Thus the result is $5 - 3 = 2$, same as with the second method.