$$ F_i(x)= \begin{cases} 0 &\quad x <-1\\ \frac{1}{2i} &\quad x \in [-1,1)\\ \frac{1}{2} +\frac{1}{2}(x-1) &\quad x \in [1,2]\\ 1 &\quad x>2 \\ \end{cases}$$
Hello, I want to calculate the expected value of the corresponding random variable (X) of F2. The solution that was presented to me is: $$ EX= -1 * P(X=-1)+ 1* P(X=1) + \int_{1}^{2} \frac{1}{2}x \,dx$$
Now, my question is why do we need to add P(X=1) and do we still need to consider it when calculating the expected value of the random variable corresponding to F1 where there's no jump at 1?
When considering $F_1$
$$\mathbb{P}[X=1]=0$$
so nothing changes if you consider it or not.
Observe that, as $F_1$ is concerned, the drawing is the following
The mean is the areas with (+) minus the area with (-). Being the areas of the two rectangle identical, they cancel thus the mean is exactly the area of the triangle marked with (+).
Thus $E(X)=\frac{1}{4}$ without doing any calculation
Generalizing the formula for any random variable you get
$$\mathbb{E}[X_i]=-\frac{1}{2i}+\left(1-\frac{1}{2i}\right)+\frac{1}{4}$$
$i=1,2,3,...$
this is awesome too...