"Let x and y be independent random variables, which are both uniform in (-2,6) If z=x+y find and plot its pdf."
How can I draw this pdf?
My working:
"Let x and y be independent random variables, which are both uniform in (-2,6) If z=x+y find and plot its pdf."
How can I draw this pdf?
My working:
You nearly have the correct answer. It is true that $\displaystyle f_Z(z) = \int_{-2}^6 f_X(z-y)f_Y(y)\,\mathrm dy$ but the value of the integral is not $\frac 18$ as you write. Bear in mind that your task is to find the value of the density $f_Z(z)$ for each and every real number $z, -\infty < z < \infty$. For example, that integral is telling you that $$f_Z(5) = \int_{-2}^6 f_X(5-y)f_Y(y)\,\mathrm dy.$$ But notice that as $y$ varies from $-2$ to $8$, the argument of $f_X$ inside the integral decreases from $5-(-2) = 7$ to $5-6=-1$ and since $f_X$ equals $0$ when its argument exceeds $6$, we have that $$f_X(5-y)f_Y(y) = \begin{cases}0\times\frac 18 = 0, & -2 < y < -1,\\\frac 18\times \frac 18 = \frac{1}{64}, & -1 \leq y < 6\end{cases}$$ It follows that $$f_Z(5) = \int_{-2}^6 f_X(5-y)f_Y(y)\,\mathrm dy = \int_{-2}^{-1} 0\,\mathrm dy + \int_{-1}^{6} \frac{1}{64}\,\mathrm dy = \frac{7}{64}.$$ Repeat this calculation for numerous other values of $5$ (say integers in the range $-5$ to $14$) and you will get different values for $f_Z$, enough that you can plot them and get a rough idea about what the graph of $f_Z(z)$ looks like. Now, as far as mathematical formulas are concerned, you might start with something like
Let $z$ denote some fixed number in $(-4,4)$. Then, as $y$ varies from $-2$ to $6$, $f_X(z-y)$ is nonzero only for $y \in \cdots$ and so $\displaystyle f_Z(z) = \int_{-2}^6 f_X(z-y)f_Y(y)\,\mathrm dy$ has value $\frac{g(z)}{64}$.
Next let $z$ denote some fixed number in $(4,12)$. Then, as .....