# Conditional expectation in the discrete case

Let $$X: \Omega \to \mathbb{R}$$ be a random variable with $$\mathbb{E}[|X|]< \infty$$, and suppose that $$Y: \Omega \to \mathbb{R}^d$$ is a discrete random vector.

Define $$f(y) = \begin{cases}\frac{1}{P(Y=y)} \int_{\{Y=y\}}XdP \quad P(Y=y) > 0\\ 0 \quad P(Y=y) =0\end{cases}$$

I'm trying to show that $$f$$ is a version of $$E[X|Y=y]$$. For this, I'm trying to prove that for $$B$$ a borel part of $$\mathbb{R}^d$$:

$$E[XI_{\{Y \in B\}}] = \int_B f(y) P_Y(dy)$$

I tried to work out both sides. Define $$S:= \{y \in \mathbb{R}^d: P(Y=y) > 0\}$$. This is by assumption at most countable, thus a Borel subset.

$$E[XI_{\{Y \in B\}}] = \int_{\{Y \in B\}} X dP$$

$$\int_B f(y) P_Y(dy) = \int_{B \cap S} \left(\frac{1}{P(Y=y)} \int_{\{Y=y\}}XdP\right)P_Y(dy)$$

Now, I'm stuck as to how to continue. I tried things like Fubini and applying the formula

$$\int_{A} gdP_Y = \int_{\{Y \in A\}} g \circ Y dP$$

but I could not find anything useful.

Any help will be appreciated!

Let $$A:=\left\{ y\mid P\left(Y=y\right)>0\right\}$$.

Then $$A$$ is countable, so that:

$$\mathbb{E}X\mathbf{1}_{Y\in B}=\mathbb{E}X\mathbf{1}_{Y\in A\cap B}=\mathbb{E}\sum_{y\in A\cap B}X\mathbf{1}_{Y=y}=\sum_{y\in A\cap B}\mathbb{E}X\mathbf{1}_{Y=y}=$$$$\sum_{y\in A\cap B}f\left(y\right)P\left(Y=y\right)=\sum_{y\in A}f\left(y\right)\mathbf{1}_{y\in B}P\left(Y=y\right)=\mathbb{E}f\left(Y\right)\mathbf{1}_{Y\in B}$$This proves that $$\mathbb E[X\mid Y]=f(Y)$$.

• Thanks for your answer! How do you justify swapping expectation and series?
– user661541
Commented Apr 13, 2019 at 15:16
• If $\int\sum_{n=1}^{\infty}\left|f_{n}\right|<\infty$ and $s_{n}=\sum_{k=1}^{n}f_{k}$ and $s=\sum_{n=1}^{\infty}f_{n}$ then $\left|s_{n}\right|\leq\int\sum_{n=1}^{\infty}\left|f_{n}\right|<\infty$ and by dominant convergence theorem: $\sum_{k=1}^{\infty}\int f_{k}=\lim_{n\to\infty}\int s_{n}=\int s=\int\sum_{k=1}^{\infty}f_{k}$ This can be applied on $X\mathbf{1}_{A\cap B}=\sum_{y\in A\cap B}X\mathbf{1}_{Y=y}$ where $A\cap B$ is countable. Here it is used that $\mathbb{E}\left|X\right|<\infty$ Commented Apr 13, 2019 at 15:36
• Thank you! It seems that I can't upvote your answer (yet?) though.
– user661541
Commented Apr 13, 2019 at 16:22
• You are welcome anyway ;-) Commented Apr 13, 2019 at 18:15
• I can upvote now! Thanks again!
– user661541
Commented Apr 14, 2019 at 9:17