Computing the probability that a function of random variables takes particular values

52 Views Asked by At

If one rolls two fair die, the sum of the two rolls is most likely to be $7$, and $2$ and $12$ are very improbable. Likewise, if one averages two random numbers in the interval $[0,1]$, the most likely result is $0.5$ and the most unlikely are $0$ and $1$.

More generally, I would like to compute the continuous probability density $P\left(A=\frac{X+Y}{2}, \,\, B=X-Y\right)$ given independent continuous probability distributions $P(X),P(Y)$, and cannot seem to remember how to do this. I thought it went as $$ P\left(A=\frac{X+Y}{2}, \,\, B=X-Y\right) \\= \int_0^1 \int_0^1 P(X)P(Y) \delta\left(A-\frac{X+Y}{2}\right)\delta\left(B-(X-Y)\right) dX dY $$ but this cannot be right. For uniform $P(X),P(Y)$ it just gives either 0 or 1.

What is the proper way to calculate this probability? For that matter, for the life of me, I can't even remember what the right distribution for uniform $P(X),P(Y)$ in the above example is called.

1

There are 1 best solutions below

3
On BEST ANSWER

Note that we have $$\begin{pmatrix}A\\B\end{pmatrix}=M\begin{pmatrix}X\\Y\end{pmatrix}=\begin{pmatrix}1/2&1/2\\1&-1\end{pmatrix}\begin{pmatrix}X\\Y\end{pmatrix}.$$ Observe that $\det M=-1$ and $M^{-1}=\begin{pmatrix}1&1/2\\1&-1/2\end{pmatrix}$. Then the density of $(A,B)$ is given by \begin{align*} f_{A,B}(a,b)=\frac{1}{\lvert\det M\rvert}f_{X,Y}(M^{-1}y)&=f_{X,Y}(a+b/2,a-b/2)\\ &=f_X(a+b/2)\cdot f_Y(a-b/2). \end{align*} This is a special case of the general change of variables formula for integrals. Since our transformation is linear, the Jacobian is just $\lvert J\rvert=\det(M^{-1})$.

The marginal density of $A$ is $$f_A(a)=\int_{-\infty}^\infty f_{A,B}(a,b)\mathop{}\!\mathrm{d}b=\int_{-\infty}^\infty f_X(a+b/2)f_Y(a-b/2)\mathop{}\!\mathrm{d}b.$$ When $X$ and $Y$ are both $\mathcal U[0,1]$, we have $f_X(x)=\mathbf1(0\leq x\leq1)$, so the integrand is positive iff $a\in[0,1]$ and $\max\{-a,a-1\}\leq b/2\leq\min\{1-a,a\}$. Then we have $$f_A(a)=\int_{\max\{-a,a-1\}}^{\min\{1-a,a\}}1\mathop{}\!\mathrm{d}b=2\min\{1-a,a\},$$ which is clearly maximised for $a=1/2$.