Finding conditional expectation and conditional probability Let $\xi $ be a random variable in $(\Omega, \mathcal{F}, \mathbb{P})$ distributed according to $\mathrm{Unif}\{-2,...,3\}$. Hence, 
$$\mathbb{P}(\xi = -2) = \mathbb{P}(\xi = -1) =\mathbb{P}(\xi = 0) =\mathbb{P}(\xi = 1) =\mathbb{P}(\xi = 2) =\mathbb{P}(\xi = 3) =1/6$$
Now let $\mathcal{D}=\{D_1,D_2,D_3\}$ where $D_1=\{\xi&lt;0\}$ $D_2=\{\xi \in [0,2]\}$ $D_3=\{ \xi &gt;2 \}$. 

I need to find:

1) $\mathbb{E}(\xi^2|\mathcal{D})$ (The conditional expectation).

2) $\mathbb{P}(\xi&lt;1|\mathcal{D})$.

I am not sure, but I think that for 1) I should use formula $\mathbb{E}(\xi^2 |\mathcal{D})(\omega)= \sum_{i} \frac{\mathbb{E}(\xi^2 \mathbf{1}_{D_i)}}{\mathbb{P}(D_i)} \mathbf{1}_{D_i} (\omega) $. But how should I use it?
I assume that $\mathbb E[\xi^2\mid\mathcal D]$ denotes the same as $\mathbb E[\xi^2\mid\mathcal\sigma(\mathcal D)]$



$\mathbb{E}\left[\xi^{2}\mid\mathcal{D}\right]$ is measurable wrt
$\sigma\left(\mathcal{D}\right)$ implying here the existence of coefficients
$a,b,c$ with $$\mathbb{E}\left[\xi^{2}\mid\mathcal{D}\right]=a\mathbf{1}_{\xi&lt;0}+b\mathbf{1}_{0\leq\xi\leq2}+c\mathbf{1}_{\xi&gt;2}\tag1$$

Secondly we have the equalities: $$\mathbb{E}\left[\xi^{2}\mathbf{1}_{D}\right]=\mathbb{E}\left[\mathbb{E}\left[\xi^{2}\mid\mathcal{D}\right]\mathbf{1}_{D}\right]\text{ for every }D\in\sigma\left(\mathcal{D}\right)\tag2$$

Substituting $\left(1\right)$ in $(2)$ we find for  $D=\{\xi&lt;0\}$, $\{0\leq\xi\leq2\}$ and $\{\xi&gt;2\}$:


$\mathbb{E}\left[\xi^{2}\mathbf{1}_{\xi&lt;0}\right]=aP\left(\xi&lt;0\right)$
$\mathbb{E}\left[\xi^{2}\mathbf{1}_{0\leq\xi\leq2}\right]=bP\left(0\leq\xi\leq2\right)$
$\mathbb{E}\left[\xi^{2}\mathbf{1}_{\xi&gt;2}\right]=cP\left(\xi&gt;2\right)$


Or equivalently 


$a=\mathbb{E}\left[\xi^{2}\mid\xi&lt;0\right]=\frac{1}{2}\left(-2\right)^{2}+\frac{1}{2}\left(-1\right)^{2}=\frac{5}{2}$
$b=\mathbb{E}\left[\xi^{2}\mid0\leq\xi\leq2\right]=\frac{1}{3}0^{2}+\frac{1}{3}1^{2}+\frac{1}{3}2^{2}=\frac{5}{3}$
$c=\mathbb{E}\left[\xi^{2}\mid\xi&gt;2\right]=3^{2}=9$.


So we end up with: $$\mathbb{E}\left[\xi^{2}\mid\mathcal{D}\right]=\frac{5}{2}\mathbf{1}_{\xi&lt;0}+\frac{5}{3}\mathbf{1}_{0\leq\xi\leq2}+9\mathbf{1}_{\xi&gt;2}$$



edit:

Observe that $\mathbb P(\xi&lt;1\mid\mathcal D)=\mathbb E(\mathbf1_{\xi&lt;1}\mid\mathcal D)$.

We can find it exactly as above if we replace $\xi^2$ there by $\mathbf1_{\xi&lt;1}$:


$\mathbb{E}\left[\mathbf1_{\xi&lt;1}\mathbf{1}_{\xi&lt;0}\right]=aP\left(\xi&lt;0\right)$
$\mathbb{E}\left[\mathbf1_{\xi&lt;1}\mathbf{1}_{0\leq\xi\leq2}\right]=bP\left(0\leq\xi\leq2\right)$
$\mathbb{E}\left[\mathbf1_{\xi&lt;1}\mathbf{1}_{\xi&gt;2}\right]=cP\left(\xi&gt;2\right)$


Or equivalently:


$a=\mathbb P(\xi&lt;1\mid\xi&lt;0)=1$
$b=\mathbb P(\xi&lt;1\mid0\leq\xi\leq2)=\frac13$
$c=\mathbb P(\xi&lt;1\mid \xi&gt;2)=0$


So we end up with: $$\mathbb{P}\left[\xi&lt;1\mid\mathcal{D}\right]=\mathbf{1}_{\xi&lt;0}+\frac{1}{3}\mathbf{1}_{0\leq\xi\leq2}$$
First, we define the underlying probability space $(\Omega, \mathcal{A}, \mathbb{P}) := (\{-2,...,3\}, 2^{\{-2,...,3\}}, \mathrm{Unif}\{-2,...,3\})$. $\xi$ is a random variable from $\Omega$ into itself, say $\xi \equiv \mathrm{id}_\Omega$. Hence, $\xi(\omega) = \omega$.
Note that $\mathbb{E}[\xi^2|\mathcal{D}]$ is also a random variable, from $\Omega$ into itself. Hence, we need to compute its value (in principal) for every $\omega \in \Omega$. Also note that the outcome really depends on the definition of $\xi$ above. Only the distribution of $\mathbb{E}[\xi^2|\mathcal{D}]$ is unique.
We can now just apply the formula:
\begin{align}
\mathbb{E}[\xi^2|\mathcal{D}](-2) &amp;= \frac{(-2)^2 \cdot 1/6 + (-1)^2 \cdot 1/6}{1/3} = 2.5\\
\mathbb{E}[\xi^2|\mathcal{D}](-1) &amp;= \frac{(-2)^2 \cdot 1/6 + (-1)^2 \cdot 1/6}{1/3} = 2.5\\
\mathbb{E}[\xi^2|\mathcal{D}](0) &amp;= \frac{0^2 \cdot 1/6 + 1^2 \cdot 1/6 + 2^2 \cdot 1/6}{1/2} = 5/3\\
\mathbb{E}[\xi^2|\mathcal{D}](1) &amp;= \frac{0^2 \cdot 1/6 + 1^2 \cdot 1/6 + 2^2 \cdot 1/6}{1/2} = 5/3\\
\mathbb{E}[\xi^2|\mathcal{D}](2) &amp;= \frac{0^2 \cdot 1/6 + 1^2 \cdot 1/6 + 2^2 \cdot 1/6}{1/2} = 5/3\\
\mathbb{E}[\xi^2|\mathcal{D}](3) &amp;= \frac{3^2 \cdot 1/6}{1/6} = 9.
\end{align}
If I didn't do any mistakes, this should be the correct conditional expectation, given the modelling of $\xi$.
The second example you can probably solve yourself, remember that $\mathbb{P}(\xi &lt; 1|\mathcal{D} ) = \mathbb{E}[\mathbf{1}_{\xi &lt; 1}|\mathcal{D}]$.