# Use the convolution formula to find the pdf

Let $X$ and $Y$ be two independent uniform random variables such that $X\sim unif(0,1)$ and $Y\sim unif(0,1)$.

A) Using the convolution formula, find the pdf $f_Z(z)$ of the random variable $Z = X + Y$, and graph it.

B) What is the moment generating function of $Z$?

So far I got to $$f_Z(z) = \int_{-\infty}^{\infty} f_Y(y)f_X(z-y)dy = \int_0^1 f_X(z-y)dy.$$ Where do I go from here?

• I've tried to edit your post using mathjax to improve readability. Please check whether these edits did not unintentionally change the meaning of your post. – B. Mehta Nov 28 '17 at 22:19
• That improved it, thanks @B.Mehta – Chance Gordon Nov 28 '17 at 22:20
• Here is a guide on how to use mathjax. It is pretty simple to learn! – Remy Nov 28 '17 at 22:21
• Did you mean to say that $X$ and $Y$ are uniformly distributed? – John Barber Nov 28 '17 at 22:25
• Do you know anything more about the distribution of $X$ and $Y$ other than that they are independent random variables that take values on $(0,1)?$ Currently, this does not seem tractable. – Carlo Nov 28 '17 at 22:26

By assumption that $X$ and $Y$ are Uniform$(0,1)$ random variables, it follows that $f_X(x) = \mathbf{1}_{(0,1)}(x)$ and $f_Y(y) = \mathbf{1}_{(0,1)}(y)$ so that $$f_Z(z) = \int_{-\infty}^{\infty} f_Y(y) f_X(z-y) \, dy = \int_0^1 f_X(z-y) \, dy = \int_0^1 \mathbf{1}_{(0,1)}(z-y) \, dy.$$ Consider the following two cases.
1.) Given that $0 < z < 1,$ we have that $\mathbf{1}_{(0,1)}(z-y) = 1$ if and only if $0 < y < z,$ hence we have that $f_Z(z) = \int_0^z dy = z$ in this case.
2.) Given that $1 \leq z < 2,$ we have that $\mathbf{1}_{(0,1)}(z-y) = 1$ if and only if $z-1 < y < 1,$ hence we have that $f_Z(z) = \int_{z-1}^1 dy = 2-z$ in this case.
We conclude that $f_Z(z) = z \cdot \mathbf{1}_{(0,1)}(z) + (2-z) \cdot \mathbf{1}_{(1,2)}(z).$ Furthermore, we have that the moment generating function of $Z$ is given by \begin{align*} \psi_Z(t) = \mathbb{E} e^{tZ} &= \int_0^1 z e^{tz} \, dz + \int_1^2 (2-z) e^{tz} \, dz \\ \\ &= \frac{e^t(t-1) + 1}{t^2} + \frac{e^t(-t + e^t - 1)}{t^2} \\ \\ &= \frac{e^{2t}}{t^2} - \frac{2e^t}{t^2} + \frac{1}{t^2}. \end{align*}
• @ Dylan_Carlo_Beck when $0<z<1$, why then $y$ is constraint in $(0,z)$? – user13 Dec 21 '17 at 23:13
• Our $y$ must be between 0 and 1 by assumption but no more than $z.$ For if $y \geq z,$ we have that $z - y \leq 0.$ – Carlo Dec 26 '17 at 8:02