# conditional distribution of random variable given its sum with another random variable

I am trying to figure out the following problem:

I have two random variables: $X$ with pdf $f_X(x)$ on $[0,A]$ and $Y$ with pdf $g_Y(y)$ on $[0,B]$. Let's denote $Z=X+Y$. What should be the distribution of $X$, given $Z$?

Many thanks!

-
Which definition of conditional distribution are you using? –  Did Mar 20 '13 at 14:57
What do you mean? I was thinking of defining h(X|Z=X+Y) and expressing it somehow in terms of f(.) and g(.) –  VeryThankful Mar 20 '13 at 15:52
Equivalently: what have you been taught to check that a conditional density is indeed correct? (Unrelated: please use @user to comment to user.) –  Did Mar 20 '13 at 16:02
no, i need to use this conditional density in order to proof something else, but I don't know how to derive it –  VeryThankful Mar 20 '13 at 16:05
Use @ please. –  Did Mar 20 '13 at 17:58

In full generality, the conditional distribution of a random variable $X$ conditionally on a random variable $Z$ is a family $(\nu_z)_z$ of distributions such that $\mathbb E(\varphi(X)\mid Z)=A_\varphi(Z)$ for every bounded measurable function $\varphi$, where $$A_\varphi(z)=\int\varphi(x)\mathrm d\nu_z(x).$$ This means that, for every bounded measurable function $\psi$, $$\mathbb E(\varphi(X)\psi(Z))=\mathbb E(A_\varphi(Z)\psi(Z)).$$ In the present case, assuming that $X$ and $Y$ are independent, one gets $$\mathbb E(\varphi(X)\psi(Z))=\iint\varphi(x)\psi(x+y)f(x)g(y)\mathrm dx\mathrm dy,$$ and the goal is to identify $\varphi\mapsto A_\varphi$ such that this coincides with $$\mathbb E(A_\varphi(Z)\psi(Z))=\iint A_\varphi(x+y)\psi(x+y)f(x)g(y)\mathrm dx\mathrm dy,$$ for every bounded measurable function $\psi$. Can you proceed from here?

-
Many thanks!I need to think about it. –  VeryThankful Mar 20 '13 at 18:07
I followed the explicit expression in the second answer and I have a short follow-up question to it. I am not sure how it works and who sees my comments so I post it here as well. I need to find conditions for which the ratio of the conditional probability to the prior is increasing in the random variable. In other words: $\frac{\partial}{\partial X}\left(\frac{g(Z-X)}{\int_{Max(0,Z-B)}^{Min(Z,A)} f(X)g(Z-X)dX}\right) \geq 0$. I am not sure how to proceed with this weird bounds of integration. Any help will be very highly appreciated. –  VeryThankful Mar 20 '13 at 21:03
I am not sure I like the way you ask a new question by appending a comment to each answer you received. As they say, if you have a new question, then post a new question. –  Did Mar 21 '13 at 21:20
Sorry, did not know how to do that, I am new here –  VeryThankful Apr 1 '13 at 19:04
Nonsense. You asked a question before, do it again. –  Did Apr 1 '13 at 19:13
show 1 more comment

Assuming $X$ and $Y$ are independent and continuous, find the joint probability density function for $X$ and $Z$, i.e. $f_{X,Z}(x,z)$.

The probability density function of the conditional random variable then reads: $$f_{X|Z}\left(x\mid z\right) = \frac{f_{X,Z}(x,z)}{f_Z(z)}$$ where $f_Z(z)$ is the marginal pdf of $Z$, which is obtained as $f_Z(z) = \int_0^A f_{X,Z}(x,z) \mathrm{d}x$.

To find $f_{X,Z}(x,z)$ simply change measure in an expectation of a bounded function: $$\mathbb{E}\left(h(X,Z)\right) = \int_0^A \int_0^B h(x,x+y) f_X(x) g_Y(y) \mathrm{d}x \mathrm{d}y = \int_0^A \int_0^{A+B} h(x,z) f_{X,Z}(x,z) \mathrm{d}x \mathrm{d}z$$ to find $$f_{X,Z}(x,z) = f_X(x) g_Y(z-x) [ 0<x<A, x<z<B+x ]$$ and therefore: $$f_Z(z) = \int_{\max(0,z-B)}^{\min(z,A)} f_X(x) g_Y(z-x) \mathrm{d}x$$

-
Thank you vey much!Isn't Min(Z,A)=A? –  VeryThankful Mar 20 '13 at 18:27
Appearance of $\min(z,A)$ simply says that when $z<A$, $f_Z(z)$ is zero. –  Sasha Mar 20 '13 at 18:30
oh, I see, thanks. And Max(0,z-B)? Z-B is in [-B,A] –  VeryThankful Mar 20 '13 at 18:36
I have a short follow-up question: I need to find conditions for which the ratio of the conditional probability to the prior is increasing in the random variable. In other words: $\frac{\partial}{\partial X}\left(\frac{g(Z-X)}{\int_{Max(0,Z-B)}^{Min(Z,A)} f(X)g(Z-X)dX}\right) \geq 0$. I am not sure how to proceed with this weird bounds of integration. Any help will be very highly appreciated. –  VeryThankful Mar 20 '13 at 20:57