[Math] Compute the probability mass function of $X -Y$

probabilityprobability theory

I'd be very thankful if someone help me guide how to solve the following problem.

Let $X$ and $Y$ be independent and geometrically distributed with the same parameter $p$.

1) Compute the probability mass function of $X – Y$.

2) Can you also compute $P(X=Y)$ now?

Hi, this is how i tried for 1) but not sure whether it is correct. Since $X$ and $Y$ are geometric distributed we have
$$
P(X=x) = (1-p)^x p,
$$
where $x\geq 0$. Let $Z=X-Y$. Then
$$
\begin{align}
P(Z=z) &= \sum_{x=1}^z P(X=x,Y=y) \\
&= \sum_{x=1}^z P(X=x , Y=x-z) \\
&= \sum_{x=1}^z P(X=x) P(Y=x-z) \\
&= \sum_{x=1}^z (1-p)^x p (1-p)^{x-z} p \\
&= \sum_{x=1}^z p^2 (1-p)^{2x-z} \\
&= (z+1) p^2 (1-p)^{2x-z}
\end{align}
$$

2) $P(X=Y) = P(X-Y=1) = P(Z=1)$. So, will substitute $z=1$ in 1).

Best Answer

You're working in the correct mindset, but there are a few issues to iron out. The event $\{Z = z\}$ is certainly the union of events of the type $\{X=x, Y=x-z\}$. However, since $X$ and $Y$ are geometric, the values they are allowed to take are non-negative integers, so $X=x$ makes sense when $x = 0, 1, 2, ..$ but $Y=x-z$ only makes sense for $x = z, z+1, z+2,... $ Let's consider two cases:

Case 1: $z \geq 0$. The union you're looking for is $$ \{Z=z\} = \bigcup_{x=z}^{\infty} \{X=x,Y=x-z\} $$ The events in the union are disjoint, this translates to $$ P(Z=z) = \sum_{x=z}^{\infty} P(X=x,Y=x-z) $$ and by independence of $X$ and $Y$ (as you used above!) $$ \sum_{x=z}^{\infty} P(X=x,Y=x-z) = \sum_{x=z}^{\infty}P(X=x)P(Y=x-z). $$ Finally, to finish off $$ \sum_{x=z}^{\infty} P(X=x)P(Y=x-z)=\sum_{x=z}^{\infty} p(1-p)^x p(1-p)^{x-z} = p^2 \sum_{x=z}^{\infty} (1-p)^{2x-z} \\ = p^2(1-p)^z\sum_{x=z}^{\infty}(1-p)^{2(x-z)} = p^2 (1-p)^z \sum_{x=0}^{\infty} (1-p)^{2x} \\ = p^2 (1-p)^z \frac{1}{1-(1-p)^2} = \frac{p(1-p)^z}{2-p} $$ Notice that the manipulations I did were so that I could apply the geometric series formula. So we arrive at $P(Z=z) = \frac{p(1-p)^z}{2-p}$ when $z \geq 0$.

Case 2: $z < 0$. The union you're looking for this time is $$ \{Z=z\} = \bigcup_{x=0}^{\infty} \{X=x,Y=x-z\}. $$ In a similar fashion to the previous case, you will end up with $$ P(Z=z) = p^2 \sum_{x=0}^{\infty}(1-p)^{2x-z} = p^2(1-p)^{-z}\sum_{x=0}^{\infty}(1-p)^{2x} \\ = p^2 (1-p)^{-z}\frac{1}{1-(1-p)^2} = \frac{p(1-p)^{-z}}{2-p} $$ So, when $z < 0$ you find $P(Z=z) = \frac{p(1-p)^{-z}}{2-p}$.

If you wanted to compile this into a nice expression for all $z$, you can notice that the only difference when $z$ was negative compared to positive is that in the negative case you have $-z$, but when $z$ is negative $-z = |z|$. So, for any $z$ $$ P(Z=z) = \frac{p(1-p)^{|z|}}{2-p}. $$

For your second question, you have the right idea, but $P(X=Y) = P(X-Y=0)=P(Z=0)$ and since you now have the probability mass function for $Z$, you can just evaluate at $z=0$.