How is this expected value calculated? $E[Y]$ I have been reading "A first look at rigorous probability theory". In Chapter 4, there is the example:
Let $(\Omega, \mathcal{F}, \mathbf{P})$ be a Lebesgue measure on $[0,1]$ , and define simple random variable
$
Y = \begin{cases}
2,  & \omega \text{ rational} \\
4, & \omega = \frac{1}{\sqrt{2}} \\
6, & \text{other } \omega \leq 1/4\\
8, & \text{otherwise }
\end{cases}
$
The book said it is easily seen that $E[Y] = 15/2$. Can some one show me how this $15/2$ is calculated? I do not know how to deal with $\mathbf{P}(\omega \text{ rational})$.
 A: The measure of rational is $0$, and so is the measure of a single point of $\frac{1}{\sqrt{2}}$. So the expectation is:
$$2 \times 0 + 4 \times 0 + 6 \times \frac{1}{4} + 8 \times \frac{3}{4}=\frac{15}{2} $$
A: The given random variable is a simple random variable. This means, that there exist some finite number of sets $A_1,...,A_n$ such that on each $A_i$ the value that the random variable takes is constant. Let that value be $Y_{A_i}$.
The expectation, for a simple random variable, is defined as $E[Y] = \sum_{i=1}^n Y_{a_i} \mathbf{P}(A_i)$.
In our case, note that $\mathbf P(\mathbb Q) = 0$, $\mathbf P\left(\left\{\frac 1 {\sqrt 2}\right\}\right) = 0$, so these values do not contribute to the expectation.
On the other hand, $\mathbf P(\{\omega \leq \frac 14, \omega \notin \mathbb Q\}) = \frac 14$ and $\mathbf P(\{\omega \geq \frac 14, \omega \neq \frac 1{\sqrt 2}\}) = \frac 34$.
Therefore, the expectation is:
$$\bbox[yellow,5px,border:2px solid red]
{E[Y] = 2 \times 0  + 4 \times 0 + 6 \times \frac 14 + 8 \times \frac 34 = \frac{15}2}
$$
