Finding expected time of discovery of failure $1)$ A machine starts operating at time $0$ and fails at a random time $T$. The distribution of $T$ has density $f(t) = \frac{1}{3}e^{-\frac{t}{3}}$
for $t > 0$. The machine will not be monitored until time $t = 2$.
What will be the expected time of discovery of the machine's failure ?
The question was asked in an examination. I solved in the following way in my answer script.
I think there are two possible cases-
$(1)$ The failure is discovered at the instant $t=0$ if the machine has already failed before time $t$ (in between the time $t=0$ to $t=2$)
$(2)$ The second possible case is that the failure is discovered at time $t>0$
Now, we are required to find an expectation.
$$E(t)=2\times P(0<t<2)+\int_{2}^{\infty} tf(t) dt$$
$$=2(1-e^{-\frac{2}{3}})+5e^{-\frac{2}{3}}$$
$$=2+3e^{-\frac{2}{3}}$$
Someone objected me " how  can you take $t=2$ ? $t$ is a continuous variable."
Am I correct ? 
 A: Assuming it can fail only once, your solution seems correct. If it fails at any time when $t \lt 2$ with probability 
$$\int_0^2 \frac{1}{3}e^{-\frac{t}{3}}dt=1-e^{-\frac{2}{3}}$$
then the observed time is $t=2$ since that's the time of $discovery$.
A: The time of discovery is not $T$ itself: it is $2$ when $T \le 2$ and otherwise is $T$.  We might write this as a function $X$ of $T$ in the form
$$X(T) = \max(2, T).$$
Accordingly, its expectation is
$$E[X(T)] = \int_0^\infty X(t) f(t) dt = \int_0^\infty \max(2,t) \frac{e^{-t/3}}{3}dt.$$
It's convenient to compute the integral by splitting it into the integral over the interval $[0,2],$ where $X(t)=2,$ and the integral over $[2,\infty),$ where $X(t) = t.$  This gives
$$E[X(T)] = \int_0^2 2 \frac{e^{-t/3}}{3}dt + \int_2^\infty t \frac{e^{-t/3}}{3}dt.$$
A smart test-taker will compare this to the offered choices before proceeding.  They all have an additive constant, usually $2.$  We can force it to appear by rewriting
$$X(T) = 2 + \mathcal{I}(t\gt 2)(t-2)$$
where $\mathcal{I}(t\gt 2)$ is zero when $t\le 2$ and otherwise equal to $1.$  This yields
$$E[X(T)] = 2 + \int_2^\infty (t-2) \frac{e^{-t/3}}{3}dt.$$
At this point it's possible, simply by looking at the forms of the choices, to choose the correct answer without doing any further calculation!
