# Thread: Sum of two distributions

1. ## Sum of two distributions

Hi,

I was not able to decide the limits of the integrals while calculating pdf in following question:

Consider two independent random variables X and Y. Let fX(x) = 1 − x/2
if 0 < x < 2 and 0 otherwise. Let fY (y) = 2 − 2y for 0 < y < 1 and 0
otherwise. Find the probability density function of X + Y.

Thanks,

2. Originally Posted by garryp
Consider two independent random variables X and Y. Let fX(x) = 1 − x/2
if 0 < x < 2 and 0 otherwise. Let fY (y) = 2 − 2y for 0 < y < 1 and 0
otherwise.
These are (left) triangular distributions, sometimes called Simpson's distributions.

Originally Posted by garryp
I was not able to decide the limits of the integrals while calculating pdf [of X+Y]
This question was discussed at sci.stat.math: Re: sum of triangular distributions where someone said:

> You would normally use convolution from -infinity to +infinity.
> But in the case of the two triangular distributions, you would use
> the range minimum of the low end of the ranges and the maximum
> of the high end of the ranges of the distributions.

In your case, the support of the distribution of sums is [0,3].

3. Thank You!!

I went through the thread you have given in your reply but did not find my answer. I found theoretical statements like sum of two triangular distributions will not be a triangular distribution and sum of >10 uniform distributions will be approx normal distribution.

Is there any mathematical explanation on setting the limits of integral?

4. Originally Posted by garryp
Thank You!!

I went through the thread you have given in your reply but did not find my answer. I found theoretical statements like sum of two triangular distributions will not be a triangular distribution and sum of >10 uniform distributions will be approx normal distribution.

Is there any mathematical explanation on setting the limits of integral?
How are you trying to do the calculation? Finding the convolution? Or calculating the cumulative distribution function and then taking the derivative?

5. From the given domain of X and Y it is clear that X + Y is defined over 0 to 3.
but since Y is defined only on 0 to 1 and X is only defined on 0 to 2 we have to break our calculation in intervals (0,1), (1,2) and (2,3).
now calculating F(Z = a) where Z = X + Y
Case 1: when a is between 0 to 1.

F(a) = P(X+Y<a) = area under X + Y (and since a is less than 1 the overall area will be area between (0,0), (0,a) and (a,0).
To calculate it we can integrate it with following limits:

int(a,0)int(a-y,0) f(x)f(y) dx dy
now differentiating it will give the pdf of (X+Y) for 0<a<1

Case2: when a is between 1 to 2.
Case3: when a is between 2 to 3.

For case 2 and 3, I am not able to understand how to set the limits. This is what I wanted to understand.

6. Originally Posted by garryp
From the given domain of X and Y it is clear that X + Y is defined over 0 to 3.
but since Y is defined only on 0 to 1 and X is only defined on 0 to 2 we have to break our calculation in intervals (0,1), (1,2) and (2,3).
now calculating F(Z = a) where Z = X + Y
Case 1: when a is between 0 to 1.

F(a) = P(X+Y<a) = area under X + Y (and since a is less than 1 the overall area will be area between (0,0), (0,a) and (a,0).
To calculate it we can integrate it with following limits:

int(a,0)int(a-y,0) f(x)f(y) dx dy
now differentiating it will give the pdf of (X+Y) for 0<a<1

Case2: when a is between 1 to 2.
Case3: when a is between 2 to 3.

For case 2 and 3, I am not able to understand how to set the limits. This is what I wanted to understand.
Draw the rectangle defined by 0 < x < 2 and 0 < y < 1. Now draw the line X = -Y + a, labelling the coordinates of all points of intersection with the sides of the rectangle.

Case 2: Draw the line such that 1 < a < 2.

Case 3: Draw the line such that 2 < a < 3.

The region of integration in each case is the area of the rectangle that is under the line. So use this to get your integral terminals.