# Thread: sum of random variables - help to evaluate support of function

1. ## sum of random variables - help to evaluate support of function

Question.

$f_{X,Y}(x,y)= xy, 0\leq{x}<1, 0\leq{y}<2$
$0$ otherwise

Suppose Z=X+Y. Find the density function of Z.

$f_Z(z)=\int_{-\infty}^{\infty}f_{X,Y}(u,z-u)du$

I am having difficulty understanding how to work out the support for Z. I guess I would try to make u and (z-u) non-negative, right?

For example, I know that $0\leq{x}<1, 0\leq{y}<2$

Then if X=u then Y=z-u and in this case

$0\leq{u}<1, 0\leq{z}-u<2$

Where to from here?... split the z interval into ? (just looking at similar questions, they do split z into several intervals, but I haven't figured out how they decide which ones).

2. Originally Posted by Volga
Question.

$f_{X,Y}(x,y)= xy, 0\leq{x}<1, 0\leq{y}<2$
$0$ otherwise

Suppose Z=X+Y. Find the density function of Z.
Is it not obvious that:

$f_Z(z) \ne 0$ for $z \in (0,3)$ and $f_Z(z)=0$ otherwise?

So the required support is $(0,3)$

CB

3. Is that really that simple? that was my first intuitive response. So basically I should be looking for intervals where z is non negative.

Do you not need to evaluate z-u and u separately? Sorry, I am asking because I saw that in similar questions.

For example, this chapter, example 7.3 on page 8
there are two intervals for z in the final density function, one based on interval for y, another based on interval for z-y
http://www.dartmouth.edu/~chance/tea...k/Chapter7.pdf
This is what I don't get, the split intervals in the final density function.

Furthermore, if I want to draw the area of integration for the sum function fz, can I use (x,y) coordinates? and will it help me to see the required area?

4. Originally Posted by Volga
Is that really that simple? that was my first intuitive response. So basically I should be looking for intervals where z is non negative.

Do you not need to evaluate z-u and u separately? Sorry, I am asking because I saw that in similar questions.

For example, this chapter, example 7.3 on page 8
there are two intervals for z in the final density function, one based on interval for y, another based on interval for z-y
http://www.dartmouth.edu/~chance/tea...k/Chapter7.pdf
This is what I don't get, the split intervals in the final density function.

Furthermore, if I want to draw the area of integration for the sum function fz, can I use (x,y) coordinates? and will it help me to see the required area?
A simple sketch graph of the line y = -x + z over the region defined by the support of $f_{XY}$ shows that you need to consider the cases $0 \leq z \leq 1$, $1 \leq z \leq 2$, $2 \leq z \leq 3$.

5. Originally Posted by mr fantastic
A simple sketch graph of the line y = -x + z over the region defined by the support of $f_{XY}$ shows that you need to consider the cases $0 \leq z \leq 1$, $1 \leq z \leq 2$, $2 \leq z \leq 3$.
I am still not getting it (although closer). First of all, what the graph would look like in 3D? I have the 'triangle' area on XY-plane, bounded by (0,0), (0,1) and (2,0), according to the bounds of X and Y. Then I have the third dimension in the direction Z (z=x+y is a plane right?), which can take values from 0 to 3. But in between these values (of z, from 0 to 3), the function of z=x+y is not the same - ie the probability of z is not determined by one function on the interval - there will be three different density functions on the intervals from 0 to 1, 1 to 2 and 2 to 3.

on 0<z<1, I think I can take z=x+y as the 'top' curve, so the density function for 0<z<1 would be

$\int_0^zf_{X,Y}(u,z-u)du=\int_0^zu(z-u)du=[z\frac{u^2}{2}-\frac{u^3}{3}]_0^z=\frac{z^3}{6}$

Further on, for 1<z<2 and 2<z<3, I am still not sure how to proceed...

PS I realise this is now about competing the question, not just about intervals for z, but I guess I need help with the whole thing...

6. Originally Posted by Volga
I am still not getting it (although closer). First of all, what the graph would look like in 3D? I have the 'triangle' area on XY-plane, bounded by (0,0), (0,1) and (2,0), according to the bounds of X and Y. Then I have the third dimension in the direction Z (z=x+y is a plane right?), which can take values from 0 to 3. But in between these values (of z, from 0 to 3), the function of z=x+y is not the same - ie the probability of z is not determined by one function on the interval - there will be three different density functions on the intervals from 0 to 1, 1 to 2 and 2 to 3.

on 0<z<1, I think I can take z=x+y as the 'top' curve, so the density function for 0<z<1 would be

$\int_0^zf_{X,Y}(u,z-u)du=\int_0^zu(z-u)du=[z\frac{u^2}{2}-\frac{u^3}{3}]_0^z=\frac{z^3}{6}$

Further on, for 1<z<2 and 2<z<3, I am still not sure how to proceed...

PS I realise this is now about competing the question, not just about intervals for z, but I guess I need help with the whole thing...
Using the method of distribution functions:

Case 1: z < 0.

$G(z) = \Pr(Z \leq z) = 0$

$\displaystyle \Rightarrow g(z) = \frac{dG}{dz} = 0$.

Case 2: $0 \leq z \leq 1$.

$\displaystyle G(z) = \Pr(Z \leq z) = \Pr(X + Z \leq z) = \int_{x = 0}^{x = z} \int_{y = 0}^{y = -x + z} xy \, dx \, dy = \int_{x = 0}^{x = z} \frac{x}{2} (z - x)^2 \, dx = ....$

$\displaystyle \Rightarrow g(z) = \frac{dG}{dz} = ....$

Case 3: $1 \leq z \leq 2$.

$\displaystyle G(z) = \Pr(Z \leq z) = \Pr(X + Z \leq z) = ....$

$\displaystyle \Rightarrow g(z) = \frac{dG}{dz} = ....$

Case 4: $2 \leq z \leq 3$.

$\displaystyle G(z) = \Pr(Z \leq z) = \Pr(X + Z \leq z) = ....$

$\displaystyle \Rightarrow g(z) = \frac{dG}{dz} = ....$

Case 5: $z > 3$.

$\displaystyle G(z) = \Pr(Z \leq z) = \Pr(X + Z \leq z) = 1$

$\displaystyle \Rightarrow g(z) = \frac{dG}{dz} = 0$.

The terminals for the double integral in cases 2-4 are found by doing what I said in my previous post. "...." denotes work for you to do.

7. I let W=X and Z=X+Y. The Jacobian is then one.
So the joint density of W and Z is w(z-w).
The region to integrate isn't bad at all.
Draw the z as the "y-axis" and w as the "x-axis".
Then you have the region bounded between 0<w<1 and the two lines z=2+w and z=w.

In the case of 0<z<1, you integrate w with the bounds of 0 and z
In the case of 1<z<2, you integrate w with the bounds of 0 and 1
In the case of 2<z<3, you integrate w with the bounds of z-2 and 1.

Hopefully you obtain a valid density, I'm heading to the gym.

8. Thank you both Mr Fantastic and Matheagle for your patience! I promise I am not dumb, but I may be having a 'bad convolution' day

I earnestly wanted to try both methods - even though I think they are the same but explained in two different math 'dialects' - and the second one (change of variable language) proved to be easier for me. I did see the three different regions of integration in the W,Z coordinates and the rest was automatic.

0<z<1

$\int_{z=0}^1\int_{w=0}^z(wz-w^2)dwdz=\int_0^1dz[\frac{w^2}{2}z-\frac{w^3}{3}]_0^z=\int_0^1\frac{z^3}{6}dz$

which means $f_Z(z)=\frac{z^3}{6}, 0

1<z<2

$\int_{z=1}^2\int_{w=0}^1(wz-w^2)dwdz=\int_1^2dz[\frac{w^2z}{2}-\frac{w^3}{3}]_0^1=\int_1^2\frac{z}{2}dz$

therefore density is $\frac{z}{2}, 1

2<z<3

$\int_{z=2}^3\int_{w=z-2}^1(wz-w^2)dwdz=\int_2^3dz[\frac{w^2z}{2}-\frac{w^3}{3}]_{z-2}^{1}=\int_2^3\frac{-z^3+15z-18}{6}dz$ (or thereabouts...)

therefore density is $\frac{-z^3+15z-18}{6}, 2

I hope I did get it right this time...

When I tried to do distribution functions method using definition of G(z)=P(Z<z), I did get lost again, and I'd love to get to the bottom of it - Mr Fantastic, if you don't mind, could you let me know if you referred to 3D coordinates (x,y,z) or 2D coordinates (z,x) in your sentence "simple sketch graph of the line y = -x + z over the region defined by the support f_XY"? Also, is it

$G(z)=P(X+Z\leq{z})$ or $P(X+Y\leq{z})$

9. Originally Posted by Volga
Thank you both Mr Fantastic and Matheagle for your patience! I promise I am not dumb, but I may be having a 'bad convolution' day

I earnestly wanted to try both methods - even though I think they are the same but explained in two different math 'dialects' - and the second one (change of variable language) proved to be easier for me. I did see the three different regions of integration in the W,Z coordinates and the rest was automatic.

0<z<1

$\int_{z=0}^1\int_{w=0}^z(wz-w^2)dwdz=\int_0^1dz[\frac{w^2}{2}z-\frac{w^3}{3}]_0^z=\int_0^1\frac{z^3}{6}dz$

which means $f_Z(z)=\frac{z^3}{6}, 0

1<z<2

$\int_{z=1}^2\int_{w=0}^1(wz-w^2)dwdz=\int_1^2dz[\frac{w^2z}{2}-\frac{w^3}{3}]_0^1=\int_1^2\frac{z}{2}dz$

therefore density is $\frac{z}{2}, 1

2<z<3

$\int_{z=2}^3\int_{w=z-2}^1(wz-w^2)dwdz=\int_2^3dz[\frac{w^2z}{2}-\frac{w^3}{3}]_{z-2}^{1}=\int_2^3\frac{-z^3+15z-18}{6}dz$ (or thereabouts...)

therefore density is $\frac{-z^3+15z-18}{6}, 2

I hope I did get it right this time...

When I tried to do distribution functions method using definition of G(z)=P(Z<z), I did get lost again, and I'd love to get to the bottom of it - Mr Fantastic, if you don't mind, could you let me know if you referred to 3D coordinates (x,y,z) or 2D coordinates (z,x) in your sentence "simple sketch graph of the line y = -x + z over the region defined by the support f_XY"? Mr F says: It's a sketch of the line y = -x + z in the xy-plane. z is a parameter here not a variable.

Also, is it

$G(z)=P(X+Z\leq{z})$ or $P(X+Y\leq{z})$ Mr F says: By the given definition Z = X + Y so surely it must be the latter ....!
..

10. you're not dumb and you shouldn't feel that way
(Only cows call people dumb)

11. Dumm, not dumb

12. Originally Posted by Moo
Dumm, not dumb
One of my favorite books was written by a Dumas, I'll have you both know ....

(Probably time to close this thread. Anyone with more mathematics to add can ask me in a pm to open it).