Let $X$ be a random variable whose probability density function is: $f_{X}(x)=e^{-x}$
Then, obtain the Moment Generating of function of $Y=1-e^{-X}$
What I did:
We can find a bound for $y$ using $x$, which gives, $0<y<1$
$F_Y(y)=P(Y<y)=P(1-e^{-x}<y)$
$=P(X<-log(1-y))=\int^{-log(1-y)}_0 e^{-x} dx$
$\implies F_Y(y)=y$
Therefore $f(y)=F^{'}(y)=1$
Therefore $M_Y(t)=\int^1_0 e^{ty} \cdot 1 dy =\large \frac{e^{t}-1}{t}$
May someone point out the mistakes, if any?
Also I tried, in a similar way, to obtain $f(y)$ directly using $f(x)$ but I can't do that right? Because probabilty at a particular point is $0$. Am I correct?
Thanks for reading.
What you have done is correct. You can do it also directly without finding the distribution of $Y$, i.e. $$\int e^{-x}e^{(1-e^{-x})t}\mathrm{d}x$$ and consider $a=1-e^{-x}$ and $e^{-x}\mathrm{d}x=\mathrm{d}a$ which will give you $$\int_{0}^1e^{at}\mathrm{d}a=(e^t-1)/t$$