# How do I find $E\lfloor X \rfloor$ when $X \sim \text{exp}(2)$?

I am trying to learn from my mistakes, and faced the following problem:

Let $$X \sim \exp(2)$$ and $$Y=\lfloor X \rfloor$$, compute $$E[Y]$$.

Well my false attempt was:

First compute the PDF of Y:

$$F_Y(t)=P(Y\leq t)=P(\lfloor x \rfloor \le X)$$ (:I guess the problem is here) $$=P(t\leq X\leq t+1)=F_X(t+1)-F_X(t)=(1-e^{-2t-2})-(1-e^{-2t})=e^{-2}e^{-2t}-e^{-2t}$$

Then I would like to take the derivative:

$$f_y(t)=-2e^{-2}e^{-2t}+2e^{-2t}$$ (I always consider the case where $$t\geq 0$$ )

Then:

$$E[Y]=-e^{-2}\int_{0}^{\infty}2te^{-2t}+\int_{0}^{\infty}2te^{-2t}=\frac{1}{2}-\frac{1}{2e^{-2}}$$

I can guess that I have made the following wrong assumptions but I will really appreciate to know what exactly is wrong:

Y is obviously discrete, but I computed $$F_Y, f_y, E[Y]$$ as if it was continous - but I am not completely sure what is wrong with that since I only used X to compute Y, and since X is continuous I though I could do that.

Edit another approach Iv'e tried was to compute that directly:

$$E[Y]=\int_{0}^{\infty} \lfloor x \rfloor f_X(x) dx=\sum_{n=0}^{\infty} \int_{n}^{n+1} \lfloor x \rfloor f_X(x) dx$$ But now I am not sure what do do, what can I do with that floor function?

• $Y$ is a discrete random variable; no differentiating the cdf. How to find pmf from cdf? And since you are asked for the expectation only, why not find directly $$E\lfloor X\rfloor=\int \lfloor x\rfloor f_X(x)\,dx$$ – StubbornAtom Feb 12 at 7:48
• @StubbornAtom hmmm, I am not sure – superuser123 Feb 12 at 7:50
• Compute $P\{Y=n\}$ for each $n$. – Kavi Rama Murthy Feb 12 at 7:51
• @StubbornAtom I edited my second attempt – superuser123 Feb 12 at 7:58
• Yes, go ahead. It is straightforward integration and then summation when you consider what is $\lfloor x\rfloor$ when $n\le x<n+1$. – StubbornAtom Feb 12 at 7:59