Question: Given two random variables $X$ and $Y$ uniformly distributed on $[0,1]$, what is their joint density function $f_{X,Y}?$

In this post, it seems that @Hans Parshall mentioned that the joint PDF is given by $f(x,y) = 6.$

Why is this the case?

  • $\begingroup$ The post you link is answering a different question. Assuming independence, the joint density is simply $$f_{X,Y}(x,y) = f_X(x)f_Y(y) = 1 \cdot 1 = 1$$ for $0 \leq x,y \leq 1$. $\endgroup$ – averagemonkey Feb 14 at 9:42
  • $\begingroup$ Within the constraints the distribution is uniform so the density is constant. But you want the total probability to be $1$; in the linked question this is across a sixth of the unit square and so the density needs to be $6$ for that to happen, while in this question it is across the whole unit square so the density needs to be $1$ $\endgroup$ – Henry Feb 14 at 9:51
  • $\begingroup$ @averagemonkey That is only if both $X$ and $Y$ are independent. What if they are not? $\endgroup$ – Idonknow Feb 14 at 13:29
  • $\begingroup$ If the variables are not assumed independent, a million things could happen. As an example we might have $X = Y$ or $X = 1-Y$, in which case the joint density does not even exist. $\endgroup$ – averagemonkey Feb 15 at 1:47

There is exactly one segment out of the six $(X,Y,(X-Y)1_{X-Y}, 1-X,1-Y,(Y-X)1_{Y-X})$ that is the shortest.

Thus the expectation is $\mathbb{E}[\text{whichever is the shortest}]$, and the integral should be carried out over the entire square for each point within the unit square $(x,y) \in [0,1]^2$, using the density $f_{XY}(x,y) = 1$.

That is, with density $f_{XY}(x,y) = 1$ the integrand is not always $x$. There are six regions, and only within one of the regions is the integrand (shortest length) $x$.

At this point, one can recognize the $6$-fold symmetry, and integrates only over the one-sixth region $\{x<\frac13, x<y, x \leq y - x\}$ as shown in the diagram there, then multiply the whole thing by $6$.

In that answer, stating that "the density is $6$" is implicitly considering the conditional expectation $\mathbb{E}[X \mid \text{shortest is $X$}]$. Again, if one were doing this unconditionally, one would need to add $$\mathbb{E}[X\cdot 1_{\text{{$X$ is the shortest}}}]+\mathbb{E}[Y\cdot 1_{\text{{$Y$ is the shortest}}}] + \mathbb{E}[(1-X)\cdot 1_{\text{{$1-X$ is the shortest}}}]+\cdots$$

Here, doing this conditionally one has the conditional density $$f_{\text{conditional}} = \frac{ f_{\text{joint}} }{ \Pr_{\text{conditional}} } = \frac{ 1 }{ \frac12 \cdot \frac13 } = 6$$ where the $1$ on top is the usual uniform-over-square, the $1/2$ below is for $X<Y$, and the $1/3$ comes from the fact "It's not hard to show that they all have probability $1/3$ of being the shortest."

Allow me to be pedantic.

Since the six segments are interchangeable, all the conditional expectations are the same. Namely, one will arrive at the same answer: $$\mathbb{E}[X \mid \text{shortest is $X$}] = \mathbb{E}[Y \mid \text{shortest is $Y$}] = \mathbb{E}[1-X \mid \text{shortest is $1-X$}] =\cdots$$

The reason that anyone of them gives the desired expectation (that answer by Hans Parshall picked to calculate $\mathbb{E}[X \mid \text{shortest is $X$}]$) is because \begin{align} &\hphantom{{}={}}\mathbb{E}[\text{whichever is the shortest}] \\ &= \frac16\mathbb{E}[X \mid \text{shortest is $X$}] + \frac16 \mathbb{E}[Y \mid \text{shortest is $Y$}] + \frac16 \mathbb{E}[1-X \mid \text{shortest is $1-X$}] + \cdots \\ &= 6\cdot\frac16 \mathbb{E}[X \mid \text{shortest is $X$}] \\ &= \mathbb{E}[X \mid \text{shortest is $X$}] \end{align}


Not the answer you're looking for? Browse other questions tagged or ask your own question.