Let X and Y be independent random variables with X having a binomial distribution with parameters 5 and 1/2 and Y having a binomial distribution with parameters 7 and 1/2. Find the probability that |X − Y | is even.
2 Answers
We can think of $X$ as the number of heads in $5$ tosses of a fair coin. The probability of $0$ heads is $\frac{1}{32}$. The probability of $2$ heads is $\frac{\binom{5}{2}}{32}=\frac{10}{32}$. And the probability of $4$ heads is $\frac{\binom{5}{4}}{32}=\frac{5}{32}$. So the probability the number of heads is even is $\frac{1+10+5}{32}=\frac{1}{2}$. Thus the probability that the number $X$ of heads is odd is also $\frac{1}{2}$.
A similar but somewhat longer calculation shows that the probability that $Y$ is even is also $\frac{1}{2}$. We leave that calculation to you.
Now $|X-Y$ is even if (i) $X$ and $Y$ are both even or (ii) $X$ and $Y$ are both odd. Note that (i) has probability $\frac{1}{2}\cdot\frac{1}{2}=\frac{1}{4}$. Similarly, the probability of (ii) is $\frac{1}{4}$. Thus the probability that $|X-Y|$ is even is $\frac{1}{2}$.
Remark: One can prove in various ways that if a fair coin is tossed $n$ times, then the probability that the number of heads is even is $\frac{1}{2}$. This can be done by induction, or by using the Binomial Theorem to expand $(1+x)^n$ and setting $x=-1$. So the $5$ and $7$ of the problem were irrelevant, they could equally well have been $m$ and $n$.
Note also that $|X-Y|$ is even if and only if $X+Y$ is even. And $X+Y$ is the number of heads in $12$ tosses of a fair coin.
We could also have proved the result for $5$ and $7$ by a symmetry argument. For example, for $7$ tosses, $0$ heads and $7$ are equally likely, as are $2$ and $5$, as are $4$ and $3$, as are $6$ and $1$. So the probability that the number of heads is even ($0$, $2$, $4$, $6$) is the same as the probability that the number of heads is odd ($7$, $5$, $3$, $1$). Thus each probability is $\frac{1}{2}$.
This sort of symmetry argument works for all odd $n$, since in general $\binom{n}{k}=binom{n}{n-k}$. But, as mentioned earlier, a more sophisticated argument shows that with probability $\frac{1}{2}$ the number of heads is even, whatever $n$ may be.
- 507,029
André Nicolas has provided a very neat solution based on symmetry properties and careful thought. For fun, I thought I'd try a computational approach taking a more general approach. Instead of fixing parameter $p = \frac 12$ for both $X$ and $Y$, allow instead for general Binomial parameters $p$ and $q$, for $X$ and $Y$ respectively. Then, the joint pmf is, say, $f(x,y)$:
The probability that Abs[$X-Y$] is EVEN can be computed as:
where Prob is a mathStatica function. In the special case, where $p = q = \frac 12$, the solution is simply:
Here is a plot of how the EVENS probability sol varies with $p$ and $q$, in the more general case when they are not fixed at $\frac 12$ each:
- 5,174



