# Joint PDF of two random variables in a triangle

Let the random variables $X$ and $Y$ have a joint PDF which is uniform over the triangle with vertices at $(0, 0), (0, 1 )$ and $(1, 0)$.

1. Find the joint PDF of $X$ and $Y$.

So apparently the answer is $2$. And it's related with the area of this triangle that easily we can see is $1/2$. How do we get that answer? I guess I don't understand the meaning of joint PDF. Could someone explain that to me too?

• Just to clarify, what do you mean by the answer is 2? 2 isn't a PDF, a PDF is a function. – EHH Mar 18 '16 at 16:52
• @EHH I know. I just wanted to be brief. I meant it's 2 in the interval where X and Y is defined and 0 otherwise. – Manuel Mar 18 '16 at 17:48

The random variable $(X,Y)$ is uniformly distributed over the region, lets call it $R$, i.e. the pdf $f_{X,Y}(x,y) = k$ for some constant on the region. Now lets integrate over the region

$$\int\int_R f_{X,Y}(x,y)dxdy = \int\int_R k \:dxdy$$

$$\int\int_R f_{X,Y}(x,y)dxdy = k * area(R)$$

$$\int\int_R f_{X,Y}(x,y)dxdy = k * \frac{1}{2}$$

We also know that

$$\int\int_R f_{X,Y}(x,y)dxdy = 1$$

so

$$k * \frac{1}{2} = 1 \Rightarrow k = 2$$

And we end up with this pdf:

$$f_{X,Y}(x,y) = \begin{cases} 2, & (x,y) \in R \\ 0, & \text{otherwise} \end{cases}$$

Firstly you need to determine the support $S$ of the random vector $(X,Y)$ $$S=\{(x,y)\in \Bbb R^2: 0\le x\le 1, \; 0\le y\le 1-x\}$$ You should draw a picture (is the only way to solve exercises with two random variables) of this domain. Now, since $(X,Y)$ has uniform distribution, you know that $$f(x,y)=c$$ for some constant $c$ over the support $S$. Two ways to proceed. The first is indeed to observe that the area of this triangle is equal to $1/2$, the other which is more systematic, but does not make use of the special structure of this problem, is to solve $$1=\int_{X}\int_Yf_{XY}(x,y)dydx=\int_{0}^1\int_{0}^{1-x}c\;dydx=c\int_0^11-x\;dx=c\cdot\frac12 \implies c=2$$

• Hello. Thanks for the answer. Is there a reason why we integrate w.r.t. $y$ first and not $x$? – Seankala Nov 20 '18 at 4:28
• @Sean The reason is because he range of $y$ depends on $x$ whereas the range of $x$ does not depend on $y$. We could of course rewrite the ranges of $x,y$ and integrate w.r.t. $x$ and then for $y$ but why do that? – Jimmy R. Nov 20 '18 at 4:32
• Thanks for the response. Sorry, but just for clarification, does this mean that we integrate w.r.t. the dependent variable first? – Seankala Nov 20 '18 at 5:14
• @Sean Yes, exactly! – Jimmy R. Nov 20 '18 at 5:20
• @Sean You are welcome and sorry for not being more clear from the beginning. You practically answered this by yourself! – Jimmy R. Nov 20 '18 at 5:28