I really do not know how to do this.

Let $X$ have a uniform distribution on $(0,2)$ and let $Y$ be independent of $X$ with a uniform distribution over $(0,3)$. Determine the cumulative distribution function of $S=X+Y$.


Solution 1:

The density of $S$ is given by the convolution of the densities of $X$ and $Y$: $$f_S(s) = \int_{\mathbb R}f_X(s-y)f_Y(y)\ \mathsf dy. $$ Now $$ f_X(s-y) = \begin{cases} \frac12,& 0\leqslant s-y\leqslant2\\ 0,&\text{otherwise} \end{cases} $$ and $$ f_Y(y) = \begin{cases} \frac13,& 0\leqslant y\leqslant3\\ 0,&\text{otherwise.} \end{cases} $$ So the integrand is $\frac16$ when $s-2\leqslant y\leqslant s$ and $0\leqslant y\leqslant3$, and zero otherwise. There are three cases (drawing a picture helps to determine this); when $0\leqslant s<2$ then $$f_S(s)=\int_0^s\frac16\mathsf dy = \frac16s. $$ When $2\leqslant s< 3$ then $$f_S(s)=\int_{s-2}^s\frac16\ \mathsf dy = \frac16(s-(s-2))= \frac13. $$ When $3\leqslant s\leqslant 5$ then $$f_S(s)=\int_{s-2}^3\frac16\ \mathsf dy = \frac16(3 - (s-2)) = \frac56 - \frac16s. $$ Therefore the density of $S$ is given by $$ f_S(s) = \begin{cases} \frac16s,& 0\leqslant s<2\\ \frac13,& 2\leqslant s<3\\ \frac56-\frac16s,& 3\leqslant s<5\\ 0,&\text{otherwise.} \end{cases} $$ The distribution function of $S$ is obtained by integrating the density, i.e. $$F_S(s)=\mathbb P(S\leqslant s)=\int_{-\infty}^s f_S(t)\ \mathsf dt. $$

Solution 2:

If $F$ denotes the CDF of $S$ then it is clear that $F(s)=1$ if $s\geq 5$ and $F(s)=0$ if $s\leq0$.

Now let $s\in(0,5)$. Prescribe function $g_s$ on $\mathbb R$ by $\langle x,y\rangle\mapsto1$ if $x+y\leq s$ and $\langle x,y\rangle\mapsto0$ otherwise.

$$F(s)=P(X+Y\leq s)=\int\int f_X(x)f_Y(y)g_s(x,y)dxdy=\frac16\int_0^2\int_0^3g_s(x,y)dydx$$ Here $f_X$ and $f_Y$ denote the PDF of $X$ resp. $Y$.

Finding $\int_0^2\int_0^3g_s(x,y)dydx$ comes to the same as finding the area of set: $$\{\langle x,y\rangle\in(0,2)\times(0,3)\mid x+y\leq s\}$$