Actuarial Exam P problem (expected value of a max function.) Question
A device that continuously measures and records seismic activity is placed in a remote region. The time, $T$, to failure of this device is exponentially distributed with mean $3$ years. Since the device will not be monitored during its first two years of service, the time to discovery of its failure is $X = \max(T, 2)$.
I understand that the density function of $T$ is $f(t)=\frac{1}{3} e^{-\frac{t}{3}}$ and I'm pretty sure that $\max(T,2)= T$ if $T>2$ and $2$ elsewhere.
Here's where I'm stuck:
$$\text{E}(X)=\text{E}(\max(T,2))=\text{?}$$
I'm not sure how to figure this part out.
 A: Hint: $\Pr(X=2) = \Pr(T\leq2)$
Addendum: There are two common ways to ensure $X\geq a$ (here $a=2$): left-truncating, and left-censoring. I will mention both, but I believe the latter is what you want in this case.
For truncating, take $X=T|T\geq a$. Samples of $X$ are obtained by taking samples of $T$ and discarding them if they are less than $a$. The CDF would be
$$F_X(x)=\begin{cases}0,& x<a\\
\frac{F_T(x)-F_T(a)}{1-F_T(a)},& x\geq a
\end{cases}$$
Note in this case that $F_X(a)=0$. The probability associated with $T<a$ is removed, and the remaining probability is "scaled up" so that the goal is still $1$ for $X$.
For censoring, take $X=T\vee a$ (the greater of $T$ and $a$). Samples of $X$ are obtained by taking samples of $T$ and replacing them by $a$ if they are less than $a$. The CDF would be
$$F_X(x) =\begin{cases}0,& x<a\\
F_T(x),& x\geq a
\end{cases}$$ Note that there is a point mass at $X=a$, and $\Pr(X=a) = \Pr(T\leq a)$. The probability associated with $T\leq a$ is "squeezed" into the point $X= a$.
The answer: Since you want the left-censored variety, with $a=2$, you then get
$$\operatorname{E}[X] = 2\cdot\Pr(X=2) + \int_2^{\infty}x\cdot f_X(x)\;dx$$
$$=2\int_0^2\tfrac13e^{-x/3}\;dx + \int_2^{\infty}x\cdot\tfrac13e^{-x/3}\;dx$$
$$= 2 + 3e^{-2/3}\approx \boxed{3.5403}$$
A: Comment. Here is a simulation in R statistical software with very nearly the correct numerical answer. A direct method based on $X$ is used. You can compare the result (to two or three places)
with your analytic answer.
t = rexp(10^6, rate = 1/3)
x = pmax(x,2)
mean(x)       
## 3.538123          # aprx E(X) from simulation

mean(t > 2)
## 0.51334           # aprx P(T > 2) from simulation
1 - pexp(2, 1/3)
## 0.5134171         # exact P(T > 2)

A little over
half of the devices survive beyond 2.
