# Help on the density of sum of two uniform variables.

1. Jun 17, 2005

### gimmytang

Hi, I need to calculate the density function of Z=X+Y, where X and Y are independent uniform distributed on [0,1]. The calculation is in the following:
$$f_{Z}(z)=\int_{A}dx$$
a. If 0<z<1, A={x:0<x<z} then f(z) = z;
b. If 1<z<2, A={x:0<x<1} then f(z) = 1;
Step b is wrong, but I don't know where I am wrong. Any hint will be appreciated!
Thanks
gim

2. Jun 17, 2005

### mathman

For step b, the domain of x is z-1 to 1, so f(z)=2-z.

The reason for that is z-x=y, which is restricted to (0,1).

3. Jun 18, 2005

### gimmytang

yep, you are right. thanks!