# What is the joint probability distribution of two same variables

Let $f\left(x\right)$ be the probability density function of the random variable $X$. What is the joint probability distribution of $f_{X,Y}\left(x,y\right)$ if $Y=X$?

• Hint: $f(x,y) = f(y|x) \cdot f(x)$. Now, for a fixed $x$, what must the conditional density $f(y|x)$ look like? Jan 7, 2013 at 16:41
• It seems like a Dirac delta function, right? Jan 7, 2013 at 16:43
• Right, so $f(x,y) = 0$ when $x \neq y$. What about when $x=y$? Jan 7, 2013 at 16:46
• @Macro Please help in this related question Conditioning on probability zero: Can we say $P(B \le A|B=b) = P(b \le A|B=b)$?
– BCLC
Mar 26, 2021 at 11:27

$X$ is not jointly continuous with itself in the sense that there is no joint density function (pdf) $f_{X,X}(s,t)$ that has positive value over a region of positive area in the plane with coordinate axes $s$ and $t$. All the probability mass lies on the straight line of slope $1$ through the origin (a region of zero area) and the joint cumulative probability distribution function CDF is $$F_{X,X}(s,t) = P\{X \leq s, X \leq t\} = P\{X \leq \min(s,t)\} = F_X(\min(s,t)).$$ As whuber points out in the comments on another answer, $\frac{\partial^2F_{X,X}(s,t)}{\partial s\partial t}$ is not defined for $s=t$.

$F_{(X,X)}(t,s) = P[X \le t,X \le s] = P[X \le \inf(s,t)]$

$f(s,t) = \frac{ \partial ^2F_{(X,X)}}{\partial s \partial t}(t,s) = \frac{\partial^2 (P[X \le t] \Large{1_{\{s=t\}}})}{\partial^2 t }$

Where $\frac{\partial \Large{1_{\{s=t\}}}}{\partial t}$ $= lim_{\sigma \mapsto 0} \frac{1}{\sqrt{2\sigma \pi}} e^{\frac{-s^2}{\sigma^2}}$ More info about the indicator function derivation are here

• What does that second line mean? How do you justify the two equalities? How do you even make sense of the last expression (the indicator function is not differentiable)?
– whuber
Jan 7, 2013 at 19:16
• $f$ is pdf and $F$ is the cdf. Maybe I missed something but : I consider case $s\not= t$ where the derivative is zero, and the other case where $s= t$ where it is not. In other words, I do not differentiate the indicator. Jan 7, 2013 at 19:54
• I see. Nevertheless, your manipulations do not appear to be correct. For example, let $X$ have a uniform distribution. Your conclusion is that $f(s,t)$ is identically zero, which is obviously false. One of the problems is clear: $F(t,s)$ is not differentiable where $s=t$.
– whuber
Jan 7, 2013 at 20:03
• Yes yes, my mistake: If everything apart from the derivative is clear, then yes we do need to differentiate the indicator function wrt to $t$, the result will the delta function ( the result can be represented as a mathematical limit (of a gaussian when its variance tends to zeo, , more info are here : en.wikipedia.org/wiki/Dirac_delta_function) Jan 7, 2013 at 20:55

Random Discrete Variables Case:

For Y=X, then pij = 0 as xi and Xj are always exclusive for i=j and pij=pi for i=j. as xi and xi to happen in the same time has pi chance.

So E[X^2] = E[XX] = Sum (xi^2*pi) for both cases