# How to add two random variable's pdf? [closed]

X,Y are independent random variables. X's pdf = f(x) Y's pdf = g(x) if Z= X+Y what is the Z's pdf? Can it be calculated?

• The first hit upon Googling the very title of this question produces a good answer: please read our faq about the wisdom of doing a little bit of research before asking a question.
– whuber
Jun 19, 2011 at 16:35
• @whuber but now this question is ;) Jun 10, 2013 at 1:59

If $X$ and $Y$ are two independent, continuous random variables, then you can find the distribution of $Z=X+Y$ by taking the convolution of $f(x)$ and $g(y)$:$$h(z)=(f*g)(z)=\int_{-\infty}^{\infty}f(x)g(z-x)dx$$If $X$ and $Y$ are two independent, discrete random variables, then you can find the distribution of $Z=X+Y$ by taking the discrete convolution of $X$ and $Y$:$$\mbox{P}(Z=k)=\sum_{i=-\infty}^{\infty}\mbox{P}(X=i)\cdot\mbox{P}(Y=k-i)$$
• It's pretty much the same as what I've written above. $X-Y$ is the same as $X+(-Y)$. The distribution of $-Y$ is the same as the distribution of $Y$ except that it is mirrored over the vertical line at 0. Jun 19, 2011 at 18:15
If $A$ is the domain for $f(x)$ then $h(z)=\int_{x\in A}f(x)g(z-x)\,dx$.