Lets say I toss a coin $n$ times where $n \geq 1$. Is it always the case that the probability of getting an even number of heads is $\frac{1}{2}$. If so can someone explain mathematically why? edit: as an additional question, If I introduce some subset of the n coins as unfair coins(i.e. probability of getting heads may not be 0.5) how does this effect the probability of getting an even number of heads?
-
1Yes, and this will remain true as long as at least one of the coins is fair. – Qiaochu Yuan Nov 23 '17 at 00:13
-
Why does no fair coins break the symmetry? – GTOgod Nov 23 '17 at 00:13
-
2For example, all of the coins could always be heads. – Qiaochu Yuan Nov 23 '17 at 00:16
1 Answers
You can look into the problem using binomial distribution. Let $X$ denotes the number of heads obtained and $p$ denotes the probability of getting head.
So $$X\sim \operatorname{B}(n,p)$$
The probability of getting even numbers of heads is $$P_E=\sum_{k=0}^{\lfloor{n/2}\rfloor} {n \choose {2k}}p^{2k}(1-p)^{n-2k}$$
and the probability of getting odd numbers of heads is simply $$P_O=1-P_H$$
So if every coin has different bias and there is not a single fair coin we can consider this:
Let $p_i$ denotes the probability the $i$-th is a head, $q_i=1-p_i$.
Let $e_i$ denotes the probability that the total number of heads by the first $i$ coins is even, $o_i=1-e_i$.
We can then define the probability as $$e_i=q_i \cdot e_{i-1} + p_i \cdot o_{i-1}$$
If $q_n=p_n=\frac 1 2$ then we have $$e_n=\frac 1 2 (e_{n-1}+o_{n-1})=\frac 1 2$$.
I think this is the most compact form already.
- 4,323
-
2It is much simpler than this. Suppose that at least one of the coins is fair. Flip all of the other coins; there are an odd number of heads with some probability $p$ and an even number of heads with some probability $q = 1 - p$, whatever those are. Now flip the last, fair, coin: the probability of getting an even resp. odd number of heads is now $\frac{p + q}{2} = \frac{1}{2}$ in both cases. – Qiaochu Yuan Nov 23 '17 at 06:13
-
But that will not hold if we do not have any fair coin at all. If there is at least one fair coin, then yes your result will hold and it's actually a very nice result. – Karn Watcharasupat Nov 23 '17 at 06:17
-
Yes, I said that in the comments already. But this answer doesn't address the case where the coins have different biases. – Qiaochu Yuan Nov 23 '17 at 06:22
-
That way I think it's easier if we just use a recursive formula. – Karn Watcharasupat Nov 23 '17 at 06:36
-
@QiaochuYuan Is the converse true? If you have a finite set of (independent) coins, and if the probability of an odd number of heads is $\frac12,$ does it follow that at least one of the coins is fair? – bof Nov 23 '17 at 08:07
-
1@bof: yes. The key observation is the following. The probability generating function for the number of heads you get if you toss $n$ coins with biases $p_1, \dots p_n$ (the probabilities of getting heads) is $\prod_{i=1}^n (1 - p_i + p_i x)$. Substituting $x = -1$ produces the probability of getting an even number of heads minus the probability of getting an odd number of heads, which is zero iff one of the factors of this product is zero. More generally we get that if all the coins are biased then even is more likely than odds iff the number of $i$ such that $p_i > \frac{1}{2}$ is even. – Qiaochu Yuan Nov 23 '17 at 08:12