Condition expectation exponential variable Let $A=\{\Omega, \emptyset, [0,c],(c,\infty)\}$ be a sub-$\sigma$-algebra.
I want to compute $E[X\mid A](\omega)$ for $\omega \in [0,c]$ and $X \sim \mathrm{Exp}(\lambda)$. Let's define $\mu(dx)=\lambda e^{-\lambda x} \, dx$ What I've is the following:
$$E[X\mid A]=\frac{1}{\mu(0,c)}\int_0^c x\lambda e^{-\lambda x}\,dx = \frac{1}{1-e^{-\lambda c}} \left[-c e^{-\lambda c}-\frac{1}{\lambda} e^{-\lambda c}+\frac{1}{\lambda} \right]=\frac{1}{\lambda}-\frac{c}{e^{\lambda c}-1}.$$ 
For $\omega \in (c,\infty)$ I know that the conditional expectation equals $c+\dfrac{1}{\lambda}$.
Now I have to show that $E[E[X\mid A]]=E[X]$ but adding these answers does not give $E[X]=\dfrac{1}{\lambda}$.
Does anyone see my mistake?
 A: Write $$E[E[X\mid A]] = \int_\Omega E[X\mid A](\omega) \, dP(\omega)
=\int_{\{X\in[0,c]\}}E[X\mid A](\omega) \, dP(\omega) + \int_{\{X\in(c,\infty)\}} E[X\mid A](\omega) \, dP(\omega).
$$
On the two sets $\{X\in[0,c]\}$ and $\{X\in(c,\infty)\}$ the value of $E[X\mid A]$ is constant, as you've calculated (correctly). Pull out the constants and you'll multiply them with the probabilities of the two sets. This should get you the right answer $1/\lambda$.
A: You need to find four numbers:


*

*$a=\operatorname{E}(X\mid X\le c)$,

*$b=\operatorname{E}(X\mid X> c)$,

*$p=\Pr(X\le c)$,

*$q=\Pr(X > c)$.


You've already found the first two and it is clear you know how to find the others.
Then the random variable $\operatorname{E}(X\mid A)$ is
$$
\operatorname{E}(X\mid A) = \left. \begin{cases} a & \text{if } X\le c, \\  b & \text{if } X > c, \end{cases} \right\} = \begin{cases} a & \text{with probability } p, \\ b & \text{with probability }q. \end{cases}
$$
In other words, conditioning the expected value on $A$ means finding conditional expected values when you are given information telling you which members of $A$ the outcome $\omega$ is in.
The expected value of that is $ap+bq$ and should be the same as the expected value of $X$.
