X is a uniform [0,4] continuous RV. Y is an exponential RV with parameter = 2.
Z = X + Y. Find the PDF of Z.
A walkthrough on solving this would be super helpful.
I used both the CDF-derive method and the convolution formula and got $\frac{1}{4} e^{-2z} \cdot (e^8 -1)$ which is only partly correct.
Solution is here (problem 1.4): http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-041sc-probabilistic-systems-analysis-and-applied-probability-fall-2013/unit-ii/quiz-2/MIT6_041SCF13_quiz02_sol.pdf
It seems I got the domain wrong. But I'm not sure why. I don't know where max(0,z-4) came from or why the pdf would be different from 0 to 4. I get it has to do with the bounds of the uniform RV, but not specifically why that makes a difference.
I'm learning this totally on my own so any direction towards learning resources or clarification will be a life saver!
The convolution integral is
\begin{equation*} f_Z(a) = \int_{0}^{\infty} f_X(y) f_Y(a-y) dy \end{equation*}
In this case, $f_X$ is $1/4$ on $[0,4]$ and zero elsewher, and $f_Y(t)=2e^{-2t} \forall t \ge 0$ and $f_Y(t)=0 \forall t < 0$.
\begin{align*} f_Z(a) =& \int_{0}^{4} f_X(y) f_Y(a-y) dy + \int_{4}^{\infty} f_X(y) f_Y(a-y) dy \\ =& \int_{0}^{4} \frac{1}{4} f_Y(a-y) dy \end{align*}
Case 1: $0 \le a \le 4$
Note that $a-y < 0 \implies f_Y(a-y) = 0$.
\begin{align*} f_Z(a) =& \frac{1}{4} \int_{0}^{4} f_Y(a-y) dy \\ =& \frac{1}{4} \int_{0}^{a} f_Y(a-y) dy \\ =& \frac{1}{4} \int_{0}^{a} 2e^{-2(a-y)} dy \\ =& \frac{1}{4} \int_{0}^{a} 2e^{-2y} dy \\ =& \frac{1}{4} (1-e^{-2a}) \end{align*}
Case 2: $a > 4$
\begin{align*} f_Z(a) =& \frac{1}{4} \int_{0}^{4} f_Y(a-y) dy \\ =& \frac{1}{4} \int_{0}^{4} 2e^{-2(a-y)} dy \\ =& -\frac{1}{4} \int_{0}^{4} e^{-2(a-y)} d(2(a-y)) \\ =& -\frac{1}{4} (-e^{-2(a-y)}) |_0^4 \\ =& -\frac{1}{4} (e^{-2a}-e^{-2a+8}) \\ =& \frac{e^{-2a}(e^8-1)}{4} \end{align*}
Hence, the density function of $Z$ is
$$f_Z(z)= \begin{cases} \frac{1}{4} (1-e^{-2z}) &\text{if } 0 \le z \le 4 \\ \frac{e^{-2a}(e^8-1)}{4} &\text{if } z \ge 4. \end{cases}$$