# Why $P(X=Y) = 0$ when $X$ and $Y$ are identically distributed, independent, continuous random variables?

If $X$ and $Y$ are identically distributed, independent, continuous random variables, then $P(X=Y) = 0$.

I know that for any particular value $x$, $P(X=x)=0$, but how to show the above rigorously?

• $P (X=Y) = P (X-Y = 0)$ – G. Snapsmath Dec 5 '16 at 14:03
• A limiting argument shows the situation pretty clearly. Suppose that the variables are not continuous but finite with $n$ equally likely possibilities: then $P(x = y) = n/n^2 = 1/n$. Now let $n \to \infty$. – Tom Collinge Dec 5 '16 at 14:10
• Actually, "identical" may be a wrong choice of terminology. "Identically distributed" seems better. Because, to me, "identical" means $X\equiv Y$, i.e. $X(\omega)=Y(\omega)$ for any $\omega\in\Omega$ where $(\Omega,\Sigma,P)$ is our probability space. And this makes the statement false. – MoebiusCorzer Dec 5 '16 at 14:10
• @G.Snapsmath So you know how to prove that if $X$ and $Y$ are continuous and independent then $P(X-Y=0)=0$? Is the proof any easier than solving the original question? – Did Dec 5 '16 at 14:18
• @fizis OK, let us assume this, if you wish, and then... what? What does this imply regarding the continuity of the distribution of $X-Y$? – Did Dec 5 '16 at 14:32

Hint: $$P(X = Y) = E[I\{X = Y\}] = \int \int I\{x = y\}\, dP^X(x)\, dP^Y(y)$$

Let $\epsilon\to0$, $F,f$ be the CDF and PDF of r.v. $X$. From the total probability theorem: $$P(X-Y\le \epsilon)=\int_{-\infty}^\infty P(X-t\le\epsilon)P(Y=t)dt=\int_{-\infty}^\infty F(t+\epsilon)f(t)dt$$

$$P(X-Y\le -\epsilon)=\int_{-\infty}^\infty P(X-t\le-\epsilon)P(Y=t)dt=\int_{-\infty}^\infty F(t-\epsilon)f(t)dt$$

$$P(X-Y\le \epsilon)-P(X-Y\le -\epsilon)\approx2\epsilon\int_{-\infty}^\infty f(t)f(t)dt\to 0$$

Therefore, the CDF of $X-Y$ is continuous at $0$.

• Do you mean $P(X-Y \geq -\varepsilon)$? And then calculate $P(X-Y \in [-\varepsilon,\varepsilon])$ in the third line? – Therkel Dec 5 '16 at 15:06
• @Therkel The first line is $F_{X-Y}(\epsilon)$, the second line is $F_{X-Y}(-\epsilon)$, the third line is showing that they are equal in the limit of $\epsilon\to0$ – fizis Dec 5 '16 at 15:10
• Then you may have shown that $F_{X-Y}(0) = 0$. What does that have to do with $P(X-Y ~{\color{red}=}~ 0)$? Also, where does your approximation in line 3 come from? – Therkel Dec 5 '16 at 15:13
• There are a lot of mistakes in your calculation, starting with the fact that a merely continuous random variable doesn't need to have a density. – Dominik Dec 5 '16 at 15:13
• @Therkel $F(t+\epsilon)-F(t-\epsilon)\approx f(t)\cdot 2\epsilon$ – fizis Dec 5 '16 at 15:15