# Conditional expectation with indicator function

I'm trying to get familiar with indicator functions.

Let $Y$ and $X$ be two independent dices and $\Omega=\{1,2,3,4,5,6\}$ and $X\sim Y \sim Uni(\Omega)$ and $Z$ is the sum $Z=Y+X$. Now I want to compute the conditional expectation $E(Z\mid X)$ using indicator functions.

So my attempt:

We have $E(Z\mid X)(\omega):=\sum\limits_{i=1}^6 \operatorname{E}(Z\mid X=x_i)\mathrm1_{X=x_i}$

So it follows $$\operatorname{E}(Z\mid X=x)=\frac{\operatorname{E}(Z\mathrm1_{X=x})}{P(X=x)}=\frac{\sum\limits_{\Omega' \cap \{X=x\}}zP(Z=z)}{P(X=x)}$$

$P(X=x)=1/6$ and if I set $\Omega'_0:={\Omega' \cap \{X=x\}}$ then it becomes

$$\operatorname{E}(Z\mid X=x)=6\sum\limits_{\Omega'_0}zP(Z=z)$$

Now I know that the RHS makes a new conditional measure. But how can I compute further?

• Are $X,Y$ functions $\Omega\to\mathbb R$ here? If so then how are they defined? As (the outcomes of) dice they will take values in $\Omega$, so it seems that you are confusing domain and codomain. – drhab Oct 21 '16 at 18:37
• @drhab Yes I see there is a problem. No $X,Y$ should be discrete random variables $\Omega' \to \Omega$ – MarcE Oct 21 '16 at 19:11

The probability of Z = z is as follows:

0, z = 2 .. x

$\frac{1}{6}$, z = x+1 .. x+6

0, z = x+7 .. 12

$\sum{z \cdot P(z|x)}=(x+1+x+2+..x+6)\cdot\frac{1}{6}=(6x+21)\cdot\frac{1}{6}=x+3.5$

This should stand to reason as E(y) = 3.5

of course this assumes that X and Y are independent

• Hi, thanks for your answer. But how can I come to this using my attempt: $\frac{\sum\limits_{\Omega' \cap \{X=x\}}zP(Z=z)}{P(X=x)}$ – MarcE Oct 21 '16 at 19:25
• To calculate P(z) you have to use P(z given x) and sum over x. I don't think there's any other way, since z is not independent of x. – MikeP Oct 21 '16 at 19:36

There is a smooth solution for this that leaves out indicator functions. So it is not really an answer to your question, but it might interest you anyway:

$$\mathbb E(Z|X)=\mathbb E(Y+X\mid X)=\mathbb E(Y|X)+\mathbb E(X\mid X)=\mathbb E(Y|X)+X$$

If moreover $X$ and $Y$ are independent then $\mathbb E(Y|X)=\mathbb EY$ so we end up with:$$\mathbb E(Z|X)=\mathbb EY+X=3.5+X$$