Probability Essentials Exercise 23.9 I've been learning probability theory (under theoretical measure theory) and below is a problem that I cannot solve:
Let $Y$ be an exponential random variable such that $P(Y > t) = e^{-t}$ for $t>0$. Let $Z$ be the random variable such that $Z = Y$ if $Y \leq 2$ and $Z=2$ if $Y >2$. Derive the conditional expectation $E[Y \vert Z]$.
I noticed that the joint pdf of $Y$ and $Z$ is singular, so I can't use elementary methods to do this. Anyone offer some help?
 A: For $z \le 2$, we just have $E[Y|Z=z] = z$.
For $z > 2$, we have $$\begin{align}
E[Y | Z=z] &= E[Y | Y>2 ] \\
&= \frac{\int_2^\infty y e^{-y} dy}{P[Y>2]} \\
&= \frac{\Big[ -(y+1)e^{-y} \Big]_2^\infty}{\int_2^\infty e^{-y} dy} \\
&= \frac{3e^{-2}}{\Big[-e^{-y} \Big]_2^\infty} \\
&= \frac{3e^{-2}}{e^{-2}} \\
&= 3.
\end{align}$$
Note you could actually save yourself the trouble of that computation if you know about the "memoryless" property of the exponential distribution. That property says that the distribution of $Y$, conditioned on $Y \ge c$ for some $c \ge 0$, is exactly the same as "c plus the non-conditioned distribution of $Y$". We know $E[Y]=1$ by properties of the exponential distribution, so $E[Y | Y \ge c] = c+1$.
A: The desired conditional expectation will have the form $g(Z)$ for a Borel measurable $g$, and will satisfy
$$
E[Yf(Z)] =E[g(Z)f(Z)]\qquad (1)
$$
for all bounded Borel measurable $f$. Because $Z\in[0,2]$, we'll regard $g$ as a function on $[0,2]$. To figure out what $g$ might be, let's make some simple choices for $f$. First, consider $f=1_{\{2\}}$.
Then $f(Z)=1_{\{Y\ge 2\}}$ and (1) becomes
$$
E[Y; Y\ge 2] = E[g(2); Y\ge 2],
$$
or
$$
3e^{-2}=\int_2^\infty ye^{-y}\,dy =g(2)e^{-2}.
$$
Therefore $g(2)$ must equal $3$, because $P[Y\ge 2]>0$.
Second, consider $f=1_{[0,t]}$, where $0\le t < 2$.
Then (1) becomes
$$
E[Y; Y\le t] = E[g(Y); Y\le t],
$$
or
$$
\int_0^t ye^{-y}\,dy =\int_0^t g(y)g^{-y}\,dy,\qquad\forall t\in[0,2).
$$
Differentiate this with respect to $t$ to learn that $g(t)=t$ for (a.e.) $t\in[0,2)$. Thus, we suspect that the function
$$
g(t):=\cases{t,&$0\le t<2$;\cr 3,& $t=2$,\cr}
$$
will do the job. It's now a straightforward matter to check that, with this choice of $g$, equation (1) holds for all $f$ . In short, $E[Y|Z]=Z\cdot1_{\{Z<2\}}+3\cdot 1_{\{Z=2\}}$.
[Corrected final formula — thanks to Asbjørn Holk!]
