# Finding the joint probability density function of two independent random variables

Is there a way of determining the joint probability density function of two random variables? If we have two independent random variables, $$X$$ and $$Y$$ that both are uniform on [0,1], then how do one calculate the joint probability density function, knowing that the two PDFs are 1 each? It wouldn't simply be the product of the two PDFs, right?

• the PDF will be just a product, the CDF won't be Jul 27, 2020 at 12:43

If $$X$$ and $$Y$$ have densities $$f_X$$ and $$f_Y$$ respectively then independence of $$X$$ and $$Y$$ is exactly the statement that $$(X,Y)$$ has density $$g(x,y)=f_X(x)f_Y(y)$$.
• Can we derive an expression for the joint PDF when the two variables are dependent, and thus $g(x,y)\neq f_X(x)f_Y(y)$? Jul 28, 2020 at 8:05
• The answer to this is uhm... complicated. So it's not clear that $(X,Y)$ even has density. To see this, assume $X$ is standard normal and toss an independent coin. Define $Y$ to be $X$ if the coin comes up heads and $-X$ if the coin comes up tails. Then, $Y$ is also standard normal, since $X$ and $-X$ have the same distribution. However, $(X,Y)$ always lies either on the diagonal or the anti-diagonal, and thus, cannot have density. Jul 28, 2020 at 8:12
• If $(X,Y)$ does have density $g$, then you can let $f_X$ be the marginal of $X$ and define $f_{Y|X=x}(y)=\frac{g(x,y)}{f_X(x)}$, which gives you the "naïve conditional density" and it is, by definition, true that $\mathbb{P}((X,Y)\in A\times B)=\int_{A\times B} f_{Y|X=x}(y) f_X(x)\textrm{d}y\textrm{d}x$. Jul 28, 2020 at 8:16
• So in general, what you need is a good notion of a) the marginal of one variable and b) the conditional distribution of the second variable given the first. As it turns out, for nice cases (real-valued random variables in particular), there is always some good notion of $b)$ going via conditional expectations (see en.wikipedia.org/wiki/Regular_conditional_probability), but it won't, in general, yield a probability distribution with density. Jul 28, 2020 at 8:19