How to find $\mathbb{E}(X\mid\mathbf{1}_{X
Given that $X,Y\stackrel{\text{i.i.d.}}{\sim}\text{Exp}$ with mean $\lambda(>0)$ and $Z=\mathbf{1}_{X<Y}$, what is $\mathbb{E}(X\mid Z=z)$ ?
We have $Z=1$ with probability $\Pr(X<Y)$ and $Z=0$ with probability $1-\Pr(X<Y)$. 
But $\Pr(X<Y)=\frac{1}{2}$ as $X$ and $Y$ are i.i.d. random variables. 
Does this mean I can simply say that $Z\sim\text{Ber}\left(\frac{1}{2}\right)$ ? 
Then, $\mathbb{E}(X)=\mathbb{E}(X\mid Z=0)\times\frac{1}{2}+\mathbb{E}(X \mid Z = 1) \times \frac{1}{2}$
$\implies2\lambda=\mathbb{E}(X\mid Z=0)+\mathbb{E}(X\mid Z=1)$. 
But I cannot conclude anything from here. I couldn't find the conditional distribution of $X\mid Z$ either. Maybe I have to condition on another variable $U$ so that $\mathbb{E}(X\mid Z)=\mathbb{E}\,[\mathbb{E}(X\mid Z,U)\mid Z]$. 
 A: $$\mathbb E[X\mid X<Y]=\frac{\mathbb E[X\mathbf 1_{X<Y}]}{\mathbb P(X<Y)}=2\mathbb E[X\mathbf 1_{X<Y}].$$
To find expectation of any measurable function $g(X,Y)$ of pair of independent r.v.'s $X$ and $Y$ with pdf's $f_X(x)$ and $f_Y(y)$, use Law of the unconscious statistician: 
$$
\mathbb E[g(X,Y)] = \iint g(x,y)f_X(x)f_Y(y)\,dx\,dy.
$$
So, 
$$
\mathbb E[X\mathbf 1_{X<Y}] = \int\limits_0^\infty \int\limits_0^\infty x\mathbf 1_{x<y} f_X(x)f_Y(y)\,dx\,dy = \ldots = \frac{\lambda}{4}
$$
So, 
$$
\mathbb E[X\mid X<Y]= \frac{\lambda}{2}.
$$
You can do the same for $\mathbb E[X\mid X>Y]$.
On the other side, you can notice that $$\mathbb E[X\mid X<Y]=\mathbb E[\min(X,Y)],$$ 
$$\mathbb E[X\mid X>Y]=\mathbb E[\max(X,Y)]$$
and find these expectations from distributions of $\min(X,Y)$ and $\max(X,Y)$.
A: By definition, since $P(Z\in\{0,1\})=1$, $E(X\mid Z)$ is the random variable equal to $$E(X\mid Z)=E(X\mid Z=1)\mathbf 1_{Z=1}+E(X\mid Z=0)\mathbf 1_{Z=0}$$ and, for every $z$ in $\{0,1\}$, $E(X\mid Z=z)$ is the real number equal to $$E(X\mid Z=z)=\frac{E(X;Z=z)}{P(Z=z)}$$ In your case, $P(Z=1)=P(Z=0)=\frac12$ by symmetry.
To complete the formulas for $E(X\mid Z)$ and $E(X\mid Z=z)$, note that, by independence of $(X,Y)$, $$P(X<Y\mid X)=1-F_Y(X)=e^{-X/\lambda}$$ hence $$E(X;Z=1)=E(X;X<Y)=E(Xe^{-X/\lambda})=\int_0^\infty xe^{-x/\lambda}\,e^{-x/\lambda}\,dx/\lambda=\lambda/4$$ and $$E(X;Z=0)=E(X)-E(X;Z=1)=3\lambda/4$$
A: You're looking for both $\operatorname E(X\mid X<Y)$ and $\operatorname E(X\mid X>Y).$ Since the events $X<Y$ and $X>Y$ each have probability $1/2,$ the equally weighted average of these two conditional expected values must be $\lambda,$ so if you find one of them, you can quickly deduce the other.
\begin{align}
\operatorname E(X\mid X<Y) & = \left. \iint\limits_{\{\, (x,y) \,:\, 0\,<\,x\,<\,y \,\}} x e^{-x/\lambda} e^{-y/\lambda}\, \frac{d(x,y)}{\lambda^2} \right/ \Pr(X<Y) \\[10pt]
& = 2\int_0^\infty \left( \int_x^\infty xe^{-x/\lambda} e^{-y/\lambda} \, \frac{dy} \lambda \right)  \, \frac{dx} \lambda \\[10pt]
& = 2\int_0^\infty xe^{-x/\lambda} e^{-x/\lambda} \, \frac{dx} \lambda \\[10pt]
& = 2\int_0^\infty x e^{-2x/\lambda} \, \frac{dx} \lambda \\[10pt]
& = 2\int_0^\infty \left( \frac{2x} \lambda \right) e^{-2x/\lambda} \left( \frac{2\,dx} \lambda \right) \cdot\frac\lambda 4 \\[10pt]
& = 2\int_0^\infty u e^{-u} \, du \cdot \frac \lambda 4 \\[10pt]
& = \frac \lambda 2. 
\end{align}
A: For convenience let $\lambda=1$. 
This can be repaired easily and our notations will be "cleaner".
$\mathsf P(\min(X,Y)>t)=\mathsf P(X>t)\mathsf P(Y>t)=e^{-2t}$ showing that $\min(X,Y)\sim\mathsf{Exp}(2)$.
$\mathsf E(X\mid Z=1)=\mathsf E(X\mid X<Y)=\mathsf E\min(X,Y)=0.5$.
$\mathsf E(X\mid Z=0)=\mathsf E(X\mid X>Y)=\mathsf E\max(X,Y)=\mathsf E[X+Y-\min(X,Y)]=1.5$.
So for $z\in\{0,1\}$ we found that:$$\mathsf E(X\mid Z=z)=1.5-z$$
Since $\mathsf P(Z\in\{0,1\})=1$ this justifies the conclusion that:$$\mathsf E(X\mid\mathbf1_{X<Y})=\mathsf E(X\mid Z)=1.5-Z$$
In the more general setting that will be:$$\mathsf E(X\mid\mathbf1_{X<Y})=\mathsf E(X\mid Z)=(1.5-Z)\lambda$$
