Probability Distributions – Probability That Two Univariate Gaussian Random Variables Are Equal

probability distributions

Let $X_1$ and $X_2$ be two independent univariate Gaussian random variables, s.t.
$$X_1\sim \mathcal N (m_1,\sigma_1^2)$$
$$X_2\sim \mathcal N (m_2,\sigma_2^2)$$
So now what is $P(X_1=X_2)$?

I tried in the following way:

$$P(X_1=X_2=x)=P(X_1=X_2=x\mid X_1=y)P(X_1=y)\tag{1}$$
$$P(X_1=X_2=x\mid X_1=y)=\begin{cases}
0, & \text{if x $\neq$ y} \\
P(X_2=x), & \text{if x=y}\end{cases}\tag{2}$$
Thus we can proceed with
$$P(X_1=X_2=x)=P(X_1=x)P(X_2=x)\tag{3}$$
Then
$$P(X_1=X_2)=\int_\Bbb R P(X_1=X_2=x) dx\tag{4}$$
$$=\int_\Bbb R P(X_1=x)P(X_2=x) dx\tag{5}$$
$$=\int_\Bbb R {1 \over \sqrt{2 \pi \sigma_1^2}}e^{-{(x-m_1)^2 \over 2\sigma_1^2}} {1 \over \sqrt{2 \pi \sigma_2^2}}e^{-{(x-m_2)^2 \over 2\sigma_2^2}} dx\tag{6}$$
And by simple Algebra, we have
$$P(X_1=X_2)={1 \over \sqrt{2 \pi (\sigma_1^2+\sigma_2^2)}}e^{-{(m_1-m_2)^2 \over 2(\sigma_1^2+\sigma_2^2)}}\int_\Bbb R {1 \over \sqrt{2 \pi \sigma^2}}e^{-{(x-\mu)^2 \over 2\sigma^2}}dx\tag{7}$$
where
$$\mu = {m_1\sigma_2^2 + m_2\sigma_1^2 \over \sigma_1^2+\sigma_2^2}\tag{8}$$
$$\sigma^2 = {\sigma_1^2 \sigma_2^2 \over \sigma_1^2+\sigma_2^2}\tag{9}$$
Now, finish the integral in (7), we get
$$P(X_1=X_2)={1 \over \sqrt{2 \pi (\sigma_1^2+\sigma_2^2)}}e^{-{(m_1-m_2)^2 \over 2(\sigma_1^2+\sigma_2^2)}}\tag{10}$$
But this is not a correct answer since the value is not bounded in $[0,1]$.

Can anyone show me at which step I made mistake?

Best Answer

The probability is zero. Write $Y:=X_1-X_2$. By independence, $Y$ has a gaussian distribution with mean $m_1-m_2$ and variance $\sigma^2_1+\sigma^2_2$. The probability you seek is $P(Y=0)$.

As for the error in your argument, the transition to step (6) is incorrect. The probability that a gaussian variable takes any specific value is 0; you don't plug in the density in place of $P(X_1=x)$ or $P(X_2=x)$.

Also, step (1) [and therefore step (4)] is not quite right. If you want to condition on $X_1$, the proper way to do this is to write:

$$P(X_1=X_2) = \int P(X_1=X_2\mid X_1=y)f_{X_1}(y)\,dy$$

Then the gaussian density occurs in the integral, but the other factor $P(X_1=X_2\mid X_1=y)$ is zero for all $y$.

Related Question