Given $X \sim exp(\lambda)$ and a constant $c \ge 0$. Let $Y=\min(X,c)$. I would like to find $E[Y]$ and tried looking for possible approaches in link1 and link2.
However, the accepted answers in both URLs give very different results. For example, according to the answer in link1
\begin{align*} \mathsf E(Y) & = \mathsf E(Y\mid X\leq c)\,\mathsf P(X\leq c)+\mathsf E(Y\mid X>c)\,\mathsf P(X> c) \\ & = \mathsf E(X\mid X\leq c)\,\mathsf P(X\leq c) +\mathsf E(c\mid X>c)\,\mathsf P(X>c) \\ & = \mathsf E(X\mid X\leq c)\,\mathsf P(X\leq c) +c\,\mathsf P(X>c) \\ & = (1-e^{-\lambda c})\int_0^c t\lambda e^{-\lambda t}dt + ce^{-\lambda c} \end{align*}
and according to the accepted answer in link2: \begin{align*} E(Y)&= \int_0^\infty P( Y > t) dt \\ &= \int_0^\infty P( X > t, c > t) dt \\ &= \int_0^\infty P( X > t)1\{ c > t\} dt \\ &= \int_0^c P(X > t)dt \\ &= \int_0^c e^{-\lambda t}dt \end{align*}
What even confused me more is another direct solution to this problem shown in the second answer in link1.
Which one is correct? Honestly I am not sure how to start with this problem, but the first answer seems to make more sense to me.