# Deriving Joint probability density functions

Question: Let X and Y be two continuous random variables with joint probability density function

$$f(x,y)=\begin{cases}\frac{1}{2} & \text{if} \ \lvert x \rvert + \lvert y \rvert \le 1 & \\ 0 :\ \ \ \ \ \ \ \ \ \text{otherwise}\end{cases}$$

Find the joint probability density function of $U=X+Y$ and $V=X-Y$

My attempt: I know the general method with these types of questions is very similar however I'm not sure how to calculate any of it in this case.

• Did you draw a picture to understand the (U,V)-domain? – Did Apr 12 '16 at 15:13
• Yes I did, but I didn't help me to deal with this question – THISISIT453 Apr 12 '16 at 15:20
• Which (U,V)-domain did you get? – Did Apr 12 '16 at 15:44
• I don't understand what you mean by $(U,V)$ domain. I meant that I drew out the domain of $f(x,y)$ and got a rhombus. How would this relate to U and V? – THISISIT453 Apr 12 '16 at 15:46
• Maybe a square? What kind of transformation is $u = x + y,\, v = x - y$? – BruceET Apr 13 '16 at 6:45

Here is a somewhat related transformation. Does it give you any ideas?

Suppose the joint distribution of $U$ and $V$ is uniform on the square with vertices at $(0,0)$ and $(1,1).$ Then consider the joint distribution of $X = (U + V)/2$ and $Y = (U-V)/2.$

Here are plots of 20,000 such points:

  u = runif(20000);  v = runif(20000)
x = (u + v)/2;  y = (u - v)/2
par(mfrow=c(1,2), pty = "s")
plot(u,v, pch="."); plot(x, y, pch=".")
par(mfrow=c(1,1), pty = "m")


Addendum: Because of continuing interest in this Question, I am appending a demonstration of the exact transformation described (rather than a 'related' transformation as a hint.)

The joint distribution of $X$ and $Y$ has the density function $f_{X,Y}(x,y) = 1/2,$ for $x$ and $y$ in the square with vertices at $(1, 0),\, (0, 1),\, (-1, 0),$ and $(0, -1),$ and $0$ elsewhere. The program below uses an acceptance-rejection method to generate 20,000 points in the support of $(X, Y)$. The distribution is illustrated by these points in the left-hand panel of the figure below.

Then it uses the transformation $U = X + Y,\,$ $V = X - Y$ of these points to illustrate the jointly uniform distribution of $U$ and $V$ on the square with diagonal vertices at $(-1, -1)$ and $(1,1).$ The target joint PDF is $f_{U,V}(u,v) = 1/4,$ for $(x,y)$ in that square, and $0$ elsewhere. This distribution is illustrated in the right-hand panel of the figure below.

The transformation can be described as a reflection about the $x$-axis followed by a 45 degree clockwise rotation (so far orthonormal), and then a scaling to double the area of the support of $(U,V).$ A point and its image under transformation are plotted in the same color to help show the nature of the transformation. (Red components of the RGB color specification are proportional to $x$ and blue components proportional to $y$; the 'background' green component is constant.)

I guess, all that remains for the requested 'canonical' derivation of the PDF of $(U,V)$ is to show the Jacobian of the transformation and algebra to verify the support of $(U,V).$

The R code is shown below, in case it is of interest.

 x.cand = runif(50000, -1, 1); y.cand = runif(50000, -1, 1)
accept = (abs(x.cand) + abs(y.cand) < 1)
mean(accept)
## 0.4978          # about half accepted
x = x.cand[accept];  y = y.cand[accept]
x = x[1:20000]; y = y[1:20000]   # keep 20,000
rr = round((x+1)*255/2)  # redscale magnitudes to color accepted points
bb = round((y+1)*255/2)  # bluescale magnitudes, scaled btw 0 and 255

par(mfrow=c(1,2), pty="s")  # two panels per figure, both square
plot(x,y, pch=".", col=rgb(rr,255/2,bb,max=255))   # plot of X and Y
abline(h=0, col="green4"); abline(v=0, col="green4")

u = x + y;  v = x - y       # transformation
plot(u,v, pch=".", , col=rgb(rr,255/2,bb,max=255)) # plot of U and V
abline(h=0, col="green4"); abline(v=0, col="green4")