I 'll be very grateful if you can help me , here is the question :
When a person sends an email, the probability that there is an attachment is 0.5. If there is an attachment then the size of the file is exponentially distributed with mean 5 kbytes. Let $X$ denote the size of the attachment received . Find the probability density function, distribution function of $X$ and $E[(X-2)^2]$.
Can you solve this question , i 'll try to understand it by your answers. There are some parts that i don't understand, and i think i can understand them by looking at the answers. Thank you so much.
Denote $Z$ a Bernoulli random variable with $p = \frac12$ and $Y$ an exponential random variable with parameter $\lambda = \frac15$ which represent the size of an attachment if there is one. The two variables are supposed to be independent, then the size of the attachment received is given by $X = ZY$.
Therefore, we have \begin{align*} t\geq 0, \mathbb{P}(X \leq t) &= \mathbb{P}(ZY \leq t) \\ &= \mathbb{P}(ZY \leq t, Z=0) + \mathbb{P}(ZY \leq t, Z=1)\\ &= \frac{1}{2}(1 + \mathbb{P}(Y \leq t))\\ &= \frac{1}{2}(1 + 1 - \exp(-t/5))\\ &= 1 - \frac12\exp(-t/5))\\ \end{align*} In the second equality we used the independance. So the density function is $f(x) = \frac{1}{10}\exp(-x/5)1_{x\geq0}$