6

Suppose $X$ is binomial $B(n,p)$. How can I find the probability that $X$ is even ?

I know $$P(X = k ) = \frac{ n!}{(n-k)!k!} p^k(1-p)^{n-k} $$

where $X=1,....,n$. Are they just asking to find $P(X = 2m )$ for some $m > 0$ ?

Mike Earnest
  • 75,930
  • Yes, that is the question. If $n$ is odd, the answer is very simple, since this probability must be the same as that of $X$ being odd. If $n$ is even, it requires a bit more work. – Hans Engler Feb 15 '15 at 16:51
  • 4
    Isn't the support of a binomial random variable over $0, \dots, n$, rather than $1, \dots, n$? – Clarinetist Feb 15 '15 at 16:55
  • 2
    "Are they just asking to find $P(X=2m)$ for some $m>0$ ?" No, they want you to find the value of $P(X=0)+P(X=2)+P(X=4)+ \cdots = P(X~\text{is even})$, not the values of the individual terms of the sum. – Dilip Sarwate Feb 15 '15 at 17:17

3 Answers3

11

I claim that the answer is $\frac{1}{2}(1+(1-2p)^n)$.

To see why, first of we have to realise what the binomial distribution actually stands for. If an event happens with probability $p$, and we make $n$ trials, then $P(X=k)$ as you defined tells us the chance that we have $k$ "successes", i.e. the chance that the event happens exactly $k$ times. We want to determine the probability that in a process of $n$ trials with success probability $p$, we have an even number of successes. Now lets say that we have performed $n-1$ trials. If we then have an odd number of successes, we will need the last trial to be a success in order for the total number of successes to be even. If the number of successes after $n-1$ trials is already even, then the last event should not be a success. So if we denote by $X_{n,p}$ a random variable with distribution $B(n,p)$, we find:

$P(X_{n,p}\text{ is even})=P(X_{n-1,p}\text{ is odd})*p+P(X_{n-1,p}\text{ is even})*(1-p)$.

Now we are ready to prove the claim, by using induction on n:

For $n=0$, the result should be clear, since then we will always have $0$ (an even number) of successes, hence the chance of $X$ being even is $1$, agreeing with the formula.

Now suppose it holds for $n-1$. Then by the previous result:

\begin{align} P(X_{n,p}\text{ is even}) &=P(X_{n-1,p}\text{ is odd})*p+P(X_{n-1,p}\text{ is even})*(1-p)\\ &=(1-\frac{1}{2}(1+(1-2p)^{n-1}))p+\frac{1}{2}(1+(1-2p)^{n-1})(1-p)\\ &=p-\frac{1}{2}p-\frac{1}{2}p(1-2p)^{n-1}+\frac{1}{2}(1-p)+\frac{1}{2}(1-p)(1-2p)^{n-1}\\ &=p-p+\frac{1}{2}+\frac{1}{2}(1-2p)(1-2p)^{n-1}\\ &=\frac{1}{2}(1+(1-2p)^n). \end{align} Completing the proof.

Ragnar
  • 6,233
Uncountable
  • 3,520
  • How did you get the intuition to make the claim that the expression in your first sentence is correct? The hard part seems to be coming up with that expression from scratch. – user5965026 Mar 02 '21 at 04:34
6

Let $X$ denote a discrete random variables taking on nonnegative integer values $0, 1, 2, \ldots$ with probabilities $p_0, p_1, p_2,\ldots$. Then, $$\begin{align} P\{X ~ \text{even}\} &= \sum_{k \geq 0} p_{2k} = p_0 + p_2 + \cdots\\ P\{X ~ \text{odd}\} &= \sum_{k \geq 0} p_{2k+1} = p_1 + p_3 + \cdots\\ \text{Adding and subtracting, we get}\hspace{0.3in}&\\ P\{X ~ \text{even}\} + P\{X ~ \text{odd}\} &= \sum_{k \geq 0} p_k\tag{1}\\ &= 1\\ P\{X ~ \text{even}\} - P\{X ~ \text{odd}\} &= p_0 - p_1 + p_2 - p_3 + \cdots\\ &= \sum_{k \geq 0} (-1)^kp_k\tag{2}. \end{align}$$ For many specific cases of random variables (including Binomial random variables), closed-form expressions can be found for $(2)$. For example, for Poisson random variables $$\sum_{k \geq 0} (-1)^kp_k = \sum_{k \geq 0} (-1)^k e^{-\lambda}\frac{\lambda^k}{k!} = e^{-\lambda}\sum_{k \geq 0}\frac{(-\lambda)^k}{k!} = e^{-2\lambda}\tag{3}$$ allowing us to conclude from $(1)$ and $(2)$ that $$P\{X ~ \text{even}\} = \frac{1+e^{-2\lambda}}{2} = e^{-\lambda}\cosh(\lambda).$$ I will leave the similar calculation for binomial random variables to you as an exercise: the final result works out to be what Uncountable showed.

Dilip Sarwate
  • 25,197
2

Here is a perhaps more direct solution. We will use one "trick;" the following function is equal to $1$ when $k$ is an even integer, and equal to $0$ when $k$ is an odd integer: $$ \frac{(-1)^k+1}2 $$ Therefore, $$ P(X\text{ is even})=\sum_{k=0}^n \frac{(-1)^k+1}{2}\cdot P(X=k)=\frac12\sum_{k=0}^nP(X=k)+\frac12\sum_{k=0}^n (-1)^k P(X=k) $$ The first summation, $\sum_{k=0}^nP(X=k)$, obviously equals one. For the second, if you plug in $\binom{n}{k}p^k(1-p)^{n-k}$ for $P(X=k)$, you will find that this summation can be simplified using the binomial theorem.

Mike Earnest
  • 75,930