# a question related to distribution of a sum of random variables

Under the snapshot below, how does A transform into B? Also, please dwell on the relocation of "z" from A to B.

I know it's a newbie question for many of you, so any help would be highly appreciated. Thank you.

\begin{align*} F_{X+Y}(z)&=\Bbb P[X+Y\le z]\\\\ &=\Bbb P[X\le z-Y]\tag{A}\\\\ &=\int_{-\infty}^{+\infty}\left(\int_{-\infty}^{z-y}f_X(x)dx\right)f_Y(y)dy\tag{B}\\\\ &=\int_{-\infty}^{+\infty}F_X(z-y)f_Y(y)dy\;. \end{align*}

-
Independence of X and Y has been assumed here. –  Gautam Shenoy Nov 30 '12 at 12:17

## In general

What we're doing from step (A) to step (B) is basically calculating the probability of $X$ being smaller-or-equal-than $z-Y$, with the help of double integrals. To begin with, let's generalize a little bit. Let's calculate the probability of events that satisfy $G(x,y)\leqslant 0$.

On the $XOY$ plane you can draw out the domain $D_{XOY}$ that solves $G(x,y)\leqslant 0$. Integrate the probability over the region where $X\leqslant z-Y$ will give you the desired probability. So:

$$\operatorname{Pr}[X \leqslant z-Y] = \iint_{D_{XOY}} f_{X,Y}(x, y) \mathrm d x \mathrm d y$$

With the definition of the Joint Proability Distribution in mind, there would be $f_{X,Y}(x, y) = f_{X|Y}(x|y)f_Y(y) = f_{Y|X}(y|x)f_X(x)$.

When and only when X and Y are independent from one another, do $f_{X,Y}(x,y)=f_X(x)f_Y(y)$.

## Proper domain

Remember that with a proper shape of $D_{XOY}$ you could rewrite the double integral by choosing an optimal order of integration. This is discussed here: References at Order of Integration | Wikipedia.

If your domain is improper, it simply tells you that you should divide your $D_{XOY}$ into multiple parts with proper domain, and sum their probability.

## A few common cases

### Case of Addition, $G(x,y)=ax+by-c\geqslant0$

In your case, assuming $X$ and $Y$ are IDV.

As a matter fact, remember that your domain $D_{XOY}$ is a proper shape of a triangle you could integration in any order. Let's try first $x$ last $y$, a.k.a. for every possible $y\in Y$, $x\in D_x(y)=\left[x_{min}(y),x_{max}(y)\right]$ then

$$\iint_{D_{XOY}} f_{X,Y}(x, y) \mathrm d x \mathrm d y = \int_{D_Y} \int_{x=x_{min}(y)}^{x_{max}(y)} f_{X,Y}(x, y) \mathrm d x \mathrm d y$$

Assuming independence, then $f_{X,Y}(x,y)=f_X(x)f_Y(y)$.

$$\int_{D_Y} \int_{x=x_{min}(y)}^{x_{max}(y)} f_{X,Y}(x, y) \mathrm d x \mathrm d y = \int_{-\infty}^{+\infty} {\color{blue}{\int_{-\infty}^{z-y} f_X(x)f_Y(y) \mathrm d x}}\mathrm d y = \int_{-\infty}^{+\infty} F_x(z-y) f_Y(y) \mathrm d y$$

Since your domain of integration $D_{XOY}$ is also vertically-sliceable (first $y$ last $x$), we may also calculate it in the following manner:

\begin{align} \operatorname{Pr}[X \leqslant z-Y] &= \iint_{D_{XOY}} f_{X,Y}(x, y) \mathrm d x \mathrm d y = \int_{-\infty}^{+\infty} {\color{blue}{\int_{-\infty}^{z-x} f_X(x)f_Y(y) \mathrm d y}}\mathrm d x\\ &= \int_{-\infty}^{+\infty} F_Y(z-x) f_X(x) \mathrm d x \end{align}

### About Multiplication, $G(x,y)=xy-z\leqslant0$

Given any distributions $X\geqslant0$, $Y\geqslant0$ where X and Y are independent, find $\operatorname{Pr}[XY\leqslant z]$ where $z\geqslant0$. So here we have $G(x,y)=xy-z\leqslant0$.

All right. It's the area to the lower left of hyperbola $xy=z$. So, Find $\operatorname{Pr}[X\leqslant z/Y]$ and apply the same steps above.

### About Division, $G(x,y)=y/x-z\leqslant0$

Given any distributions $X>0$, $Y\geqslant0$ where X and Y are independent, find $\operatorname{Pr}[\frac{Y}{X}\leqslant z]$. Hmm, this looks suspicious.

It so happens that $\operatorname{Pr}[\frac{Y}{X}\leqslant z] = \operatorname{Pr}[Y\leqslant z X]$. Remember that the geometric interpretation for $\frac{Y}{X}$ is the slope of line segment with ends $(0,0)$ and $(X,Y)$. So, the desired shape of integration is yet another infinitely-large triangular area.

### Other cases

It's high time that you tried the general method on all other cases.

-
thank you so much!! –  user1486802 Dec 1 '12 at 0:07
@shle2821 I'm glad if it had helped you. But since you're quite a new user, I hope you won't mind that I point out a few things that will improve your user experience: 1. when your rep is $\geqslant15$, please upvote answers that you enjoy. 2. You may upvote and accept the answer to your questions, but no need to hassle because better answers take time to form. 3. A higher "accept" rate means you care about your questions and other users' answers. 4. Have fun in this community! –  FrenzY DT. Dec 1 '12 at 2:09
thanks for the tip!! –  user1486802 Dec 1 '12 at 23:17

The following are the steps in between (A) and (B) $$P[X \leq z-Y] = \int_{-\infty}^{\infty}P[X\leq z-y|Y=y]f_Y(y)dy$$ This is by total probability theorem. Now use independence of X and Y to get $$=\int_{-\infty}^{\infty}P[X\leq z-y]f_Y(y)dy$$ $$=\int_{-\infty}^{\infty}\int_{-\infty}^{z-y}f_X(x)f_Y(y)dxdy$$

-