Expected value of X-x for exponential distribution Assume $X\sim$ exponential$(\lambda)$.
In class we noted that $E[X-x|X\geq x]=\frac{1}{\lambda}$. Why is this? I would have thought that $E[X]-E[x]=\frac{1}{\lambda}-x$.
 A: Let us fix $x>0$.
Let $f(du)$ be the distribution of $X$ conditionally to the event  $X\ge x$.
What you look for is
$$
\int_x^\infty (u-x) f(du)
$$
Now let us compute $f$. As the conditional random variable has real values, 
it is determined by $$
g(y) = P(X>y | X>x) 
$$
This is $1$ when $y<x$ and otherwise it is
$$
\frac{ P(X>y \text{ and } X>x) }{ P( X>x) }
=\frac{ P(X>y) }{ P( X>x) } = \frac{\exp(-\lambda y)}{\exp(-\lambda x)}
= \exp(-\lambda (y-x))
$$
As this is a derivable function, it proves that 
$f(du) = -g'(u) du = \lambda \exp(-\lambda (u-x)) du$
Then the final computation:
$$
\int_x^\infty (u-x) f(du) =
\int_x^\infty (u-x)  \lambda \exp(-\lambda (u-x)) du
$$
let $\delta = u-x$. The integral becomes
$$
= \int_0^\infty \delta  \lambda \exp(-\lambda \delta) d\delta  
$$
This is the expected value of $X$, which is $\frac 1\lambda$.
A: Indeed, you are right to note that $$E[X-x]=E[X]-x=\frac{1}{\lambda}-x,$$ but this result is unrelated to the value of the conditional expectation $E[X-x|X\geqslant x]$, defined as $$E[X-x|X\geqslant x]=\frac{E[(X-x)\mathbf 1_A]}{P(A)},\qquad A=[X\geqslant x].$$ Note that $P(A)=\mathrm e^{-\lambda x}$ and that $$E[(X-x)\mathbf 1_A]=\int_x^\infty(t-x)f_X(t)\mathrm dt=\int_x^\infty(t-x)\lambda\mathrm e^{-\lambda t}\mathrm dt.$$ A careful computation of this integral yields $$E[(X-x)\mathbf 1_A]=\mathrm e^{-\lambda x}\frac1\lambda,$$ hence finally, $$E[X-x|X\geqslant x]=\frac1\lambda.$$
