# Expected value of joint discrete continuous distribution

This is a problem from All of Statistics by Wasserman that I have been struggling with for a while.

Problem

Let $$X \sim \text{Uniform}(0,1)$$. Let $$0. Let $$$$Y = \begin{cases} 1 & 0 $$$$Z = \begin{cases} 1 & a

a) Are $$Y$$, $$Z$$ independent? Why/Why not?

b) Find $$E(Y|Z)$$. Hint: What values $$z$$ can $$Z$$ take?

• related problem that I was looking at: stats.stackexchange.com/questions/473537/… Oct 30 '20 at 18:15
• There are only $2\times 2 = 4$ possible values for $(Y,Z).$ Make a table of their probabilities.
– whuber
Oct 30 '20 at 18:25

With help from the comments above, I believe I figured it out:

Using the fact that $$X\sim\text{Uniform}(0,1)$$,

$$P(Y=1,Z=1)=P(x\in(0,b)~\land x\in(a,1)) = b-a$$

Similarly,

$$P(Y=1)P(Z=1) = b(1-a)$$

This shows that $$Y,Z$$ are dependent.

For part (b), following the hint, we have

\begin{align} E(Y|Z=z) &= \sum_{y} y P(Y=y | Z = z) \\ &= \sum_{y} y P(Y=y,Z=z)/P(Z=z)\\ &= 0 + (1)P(Y=1,Z=z)/P(Z=z)\\ &= P(Y=1,Z=z)/P(Z=z)\\ \end{align}

Compute the probabilities $$P(Y=1,Z=z)$$ and $$P(Z=z)$$ for $$Z=0,1$$ to find \begin{align} E(Y|Z=z) = \begin{cases} \frac{b-a}{1-a} & z=1\\ 1 & z=0 \end{cases} \end{align}