How to find the probability that $|X-Y|=0$?

220 Views Asked by At

So I have $X$, a $Bin(5,0.5)$ variable and $Y$, a $Bin(7,0.5)$ variable. I have to find $P[|X-Y|=0]$. According to my understanding, this probability is equivalent to $P[X=Y]$, which is equal to $$\sum\limits_{k=0}^5 P[X=k,Y=k]$$

I took the upper limit of of the sum as 5 and not 7, since those probabilities are zero anyway. Is this method correct?

1

There are 1 best solutions below

0
On

Let $X\sim\mathsf{Bin}(n,p)$ and $Y\sim\mathsf{Bin}(n,q)$. Then \begin{align} \mathbb P (|X-Y|=0) &= \mathbb P (X=Y)\\ &= \sum_{i=0}^n \mathbb P(X=i,Y=i)\\ &= \sum_{i=0}^n \mathbb P(X=i)\mathbb P(Y=i)\\ &= \sum_{i=0}^n \binom ni p^i(1-p)^{n-i}\binom ni q^i (1-p)^{n-i}\\ &= (1-p)^n (1-q)^n \, _2F_1\left(-n,-n;1;\frac{p q}{(p-1) (q-1)}\right) \end{align} where ${}_{2}F_{1}$ denotes a hypergeometric function. In the case where $n=5$ and $p=q=\frac12$ this reduces to $$ \sum_{i=0}^5 \binom 5 i^2 \left(\frac12\right)^{10} = \frac{63}{256}. $$