Let $X$ ~ $Bin(n,p)$ and $Y$ ~ $Bin(m,p)$ be two independent random variables. Find the distribution of $Z=X-Y$.
see also Difference of two binomial random variables
I figured this out:
$$ P(Z=z)=\cases{\sum_{i=o}^{min(m,n)} Bin(k+i,n,p)*Bin(i,m,p), &if $z\ge0$;\cr \sum_{i=0}^{min(m,n)} Bin(i,n,p) * Bin(i-z, m, p),&otherwise. \cr}$$
I also validated it by Monte Carlo simulation. For $n=30$, $m=20$ and $p=0.5$, I get the following distribution, where the circles are the analytical probabilities and the line connects the MC estimates.
Because that looked to me pretty much like a binomial distribution, I gave it a try and figured out that its actually a binomial, just shifted by m to the left. This can be simply written as $P(Y=y) = Bin(y+m, m+n, p)$. Hence, given equal success probabilities, the sum of two independent binomially distributed random variables is binomial, but also their difference, just shifted to the left.
This question here difference between independent binomial variables is actually the same as mine, but received no answer and only the comment that there would be no simple formula. But the above formula looks pretty simple to me.
- Is it correct that for the case of equal success probabilities, the above equations actually describes the distribution of $Z=X-Y$?
- I read in a book that $Z$ could not be binomial distributed because it had negative support. Is it right to call it a shifted binomial?