Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to understand an example from my textbook.

Let's say $Z = X + Y$, where $X$ and $Y$ are uniform random variables with range $[0,1]$. Then the PDF is $$f(z) = \begin{cases} z & \text{for $0 < z < 1$} \\ 2-z & \text{for $1 \le z < 2$} \\ 0 & \text{otherwise.} \end{cases}$$

How was this PDF obtained?

Thanks

share|improve this question
    
There are a couple of ways. Have you done convolutions? Not the best way in my opinion, but certainly useful elsewhere. And there is a straightforward geometric approach. –  André Nicolas Apr 11 '13 at 0:49
    
what would be the bounds if i were to use convolutions? also, I don't quite understand the geometric approach. Can you direct me to an example? –  Zhulu Apr 11 '13 at 1:19
    
For convolution, you want $\int_{-\infty}^\infty f_Y(z-x)f_X(x)\,dx$. So since density is $0$ outside $(0,1)$, we need $0\le z-x\le 1$, or equivalently $x\le z\le x+1$. For $z\le 1$, the first bound is the one to use. For $1\lt z\le 2$, it is the second. –  André Nicolas Apr 11 '13 at 1:33
    
So fy is 1 and fx is 1. What am I supposed to write in place of positive and negative infinity? 0 to 1 and then 1 to 2? –  Zhulu Apr 11 '13 at 2:04
1  
I sort of gave the bounds. For $0\le z\le 1$, integrate from $x=0$ to $x=z$. For $1\lz\le 2$, integrate from $z-1$$ to $1$. Will maybe write up answer. –  André Nicolas Apr 11 '13 at 2:19

1 Answer 1

up vote 3 down vote accepted

If we want to use a convolution, let $f_X$ be the full density function of$X$, and let $f_Y$ be the full density function of $Y$. Let $Z=X+Y$. Then $$F_Z(z)=\int_{-\infty}^\infty f_X(x)f_Y(z-x)\,dx.$$

Now let us apply this general formula to our particular case. We will have $f_Z(z)=0$ for $z\lt 0$, and also for $z\ge 2$. Now we deal with the interval from $0$ to $2$. It is useful to break this down into two cases (i) $0\lt z\le 1$ and (ii) $1\lt z\lt 2$.

(i) The product $f_X(x)f_Y(z-x)$ is $1$ in some places, and $0$ elsewhere. We want to make sure we avoid calling it $1$ when it is $0$. In order to have $f_Y(z-x)=1$, we need $z-x\ge 0$, that is, $x\le z$. So for (i), we will be integrating from $x=0$ to $x=z$. And easily $$\int_0^z 1\,dx=z.$$ Thus $f_Z(z)=z$ for $0\lt z\le 1$.

(ii) Suppose that $1\lt z\lt 2$. In order to have $f_Y(z-x)$ to be $1$, we need $z-x\le 1$, that is, we need $x\ge z-1$. So for (ii) we integrate from $z-1$ to $1$. And easily $$\int_{z-1}^1 1\,dx=2-z.$$ Thus $f_Z(z)=2-z$ for $1\lt z\lt 2$.

Another way: (Sketch) We can go after the cdf $F_Z(z)$ of $Z$, and then differentiate. So we need to find $\Pr(Z\le z)$.

For fixed $z$, draw the line with equation $x+y=z$. Draw the square $S$ with corners $(0,0)$, $(1,0)$, $(1,1)$, and $(0,1)$.

Then $\Pr(Z\le z)$ is the area of the part $S$ that is "below" the line $x+y=z$. That area can be calculated using basic geometry. There is a switch in basic shape at $z=1$.

share|improve this answer
    
Thank very much for writing this up! This really helped me fully understand the concept of convolution. –  Zhulu Apr 11 '13 at 3:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.