Condition for probability of even number heads to be $1/2$

combinationsdiscrete mathematicsprobability

Suppose we flip $n$ coins (each flip is independent, but not necessarily identically distributed). Under what conditions will the probability that we flip an even number of heads be exactly $1/2$?

I know that when all the coins are fair, then the probability is half (see e.g. this thread). But I'm not sure how to handle the case if the coins aren't fair.

Best Answer

Pick a coin, suppose it comes up heads with probability $p$. Suppose the other $n-1$ coins give an even number of heads with probability $q$. Then we need $$p(1-q)+(1-p)q=\frac{1}{2}\implies p+q-2pq=\frac{1}{2}\implies(2p-1)(2q-1)=0.$$ So either $p=\frac{1}{2}$ or $q=\frac{1}{2}$. Inducting downwards implies that the probability of an even number of heads is $\frac{1}{2}$ iff at least one of the coins is fair.

Related Question