Finding $pdf$ of $V=X+Y$ where $X$~$unif(0,1)$ and $f_Y(y) =e^{−y}I_{(0,\infty)}(y)$

113 Views Asked by At

Consider independent random variables $X$ and $Y$, where $X$ has a uniform $(0,1)$ distribution and $Y$ has $pdf$ $$f_Y(y) =e^{−y}I_{(0,\infty)}(y)$$

Give the pdf of $V=X+Y$.

I found a similar problem here but I would like to make sure I am applying it correctly to this problem.

In the case that $v \geq 1$ we have

$$\begin{align*} F_{X+Y}(v) &= \int_0^1 \int_0^{v-x} e^{-y}dydx \\\\ &= \int_0^1 -e^{-y} |_0^{v-x}dx \\\\ &= \int_0^1(-e^{-(v-x)}-(-e^0))dx \\\\ &= \int_0^1 (-e^{-v}e^x+1)dx \\\\ &= (-e^{-v}e^x+x) |_0^1 \\\\ &= (-e^{-v}e+1)-(-e^{-v}e^0+0) \\\\ &= -e^{-v+1}+e^{-v}+1 \\\\ \end{align*}$$

And so differentiating, I get that

$$f_{X+Y}(v)=e^{-v+1}-e^{-v}$$

In the case that $v\in(0,1)$ we have

$$\begin{align*} F_{X+Y}(v) &= \int_0^v \int_0^{v-x} e^{-y}dydx \\\\ &= \int_0^v -e^{-y} |_0^{v-x}dx \\\\ &= \int_0^v(-e^{-(v-x)}-(-e^0))dx \\\\ &= \int_0^v (-e^{-v}e^x+1)dx \\\\ &= (-e^{-v}e^x+x) |_0^v \\\\ &= (-e^{-v}e^v+v)-(-e^{-v}e^0+0) \\\\ &= -1+v+e^{-v}\\\\ \end{align*}$$

And so differentiating, I get that

$$f_{X+Y}(v)=1-e^{-v}$$

So the $pdf$ would be a piecewise function looking like

$$ f_{X+Y}(v)= \begin{cases} 1-e^{-v} & 0 \lt v \lt 1 \\ e^{-v+1}-e^{-v} & v \ge 1 \end{cases} $$

1

There are 1 best solutions below

0
On

Here is an alternate proof :

The pdf of the sum of two independant random variables is equal to the convolution of their pdfs, say $\varphi$ and $\psi$ under the form:

$$f_{X+Y}(v)= \int \varphi_X(v-y)\psi_Y(y)du=\int 1_{[0,1]}(v-y)1_{[0,+\infty)}e^{-y}dy=$$

$$= \int_{\max(v-1,0)}^v e^{-y}dy=[-e^{-y}]_{\max(v-1,0)}^v=e^{-\max(v-1,0)}-e^{-v}$$

whence your result.

Now, how can we check it ? One of the best ways to test a pdf is to use simulation.

Here is the result showing an excellent fit between theory (red curve) and experiment (histogram on one million samples):

enter image description here

Here is the Matlab program that has generated the figure (note that the standard exponential distribution is equivalent with $-\ln(U)$ where $U$ is a uniform variable on $[0,1]$):

clear all;close all;hold on

n=1000000;set(gcf,'color','w');

S=rand(1,n)-log(rand(1,n));

hist(S,100)

u=0:01:1;v=1:0.01:7;

M=145000;

plot(u,M*(1-exp(-u)),'r')

plot(v,M*(exp(-v+1)-exp(-v)),'r')