Even Heads with Mixed Fair and Unfair Coins
You flip 10 coins: 5 are fair (each heads with probability $\frac{1}{2}$) and 5 are unfair with some unknown fixed bias $q \in [0, 1]$. All flips are independent. What is the probability that the total number of heads is even?
Hints
- Try an extreme case first -- what if the unfair coins always show heads (or always show tails)? Does the answer simplify to something clean?
- For $n$ independent coins with head probabilities $p_1, \ldots, p_n$, the probability of an even number of heads satisfies $P(\text{even}) = \frac{1 + \prod_{i=1}^{n}(1 - 2p_i)}{2}$.
- Evaluate $(1 - 2p_i)$ for a fair coin with $p_i = \frac{1}{2}$. What does that do to the product over all 10 coins?
Worked Solution
How to Think About It: Before calculating anything, ask yourself: does the bias of the unfair coins even matter? You have 5 fair coins in the mix. Each fair coin is perfectly symmetric -- heads and tails are equally likely. Intuitively, that symmetry might dominate. Your first move at a whiteboard should be to check whether the answer is just $\frac{1}{2}$ regardless of $q$, and if so, explain why.
Quick Estimate: Start with an extreme case to build intuition. Suppose the 5 unfair coins are all double-headed ($q = 1$), so they always show heads. Then you always get exactly 5 heads from the unfair coins, and the total parity is determined entirely by the 5 fair coins. The probability of an even number of heads from 5 fair coins is $\frac{1}{2}$ by symmetry (equal chance of any number from 0 to 5, and exactly half the configurations sum to even). So the answer is $\frac{1}{2}$ in this extreme case. Try the other extreme: $q = 0$ (all tails always). Same logic -- parity is again determined by the 5 fair coins, giving $\frac{1}{2}$. The answer looks like $\frac{1}{2}$ no matter what.
Approach: Use the standard generating-function identity for even-head probabilities. For $n$ independent coins with head probabilities $p_1, \ldots, p_n$, the probability of an even number of heads is:
$$P(\text{even heads}) = \frac{1 + \prod_{i=1}^{n}(1 - 2p_i)}{2}$$
This follows from evaluating the probability generating function at $-1$: setting $z = -1$ in $\prod_{i=1}^{n}(1 - p_i + p_i z)$ gives $\prod_{i=1}^{n}(1 - 2p_i)$, and combining with the evaluation at $z = 1$ (which gives 1) yields the result.
Formal Solution:
Label the fair coins $i = 1, \ldots, 5$ with $p_i = \frac{1}{2}$, and the unfair coins $i = 6, \ldots, 10$ with $p_i = q$. Apply the identity:
$$P(\text{even heads}) = \frac{1 + \prod_{i=1}^{10}(1 - 2p_i)}{2}$$
For the fair coins, each factor contributes: $$1 - 2 \cdot \frac{1}{2} = 0$$
So the product over all 10 coins contains $(0)^5 = 0$ as a factor, regardless of $q$:
$$\prod_{i=1}^{10}(1 - 2p_i) = (0)^5 \cdot (1 - 2q)^5 = 0$$
Therefore: $$P(\text{even heads}) = \frac{1 + 0}{2} = \frac{1}{2}$$
Answer:
$$\boxed{\frac{1}{2}}$$
The bias $q$ of the unfair coins is completely irrelevant.
Intuition
The key principle here is that a single fair coin kills all dependence on everything else in the parity calculation. Once you have even one fair coin in your collection, the total count of heads is equally likely to be even or odd -- no matter how many other coins you add and no matter what their biases are. The fair coin acts like a parity randomizer: it independently flips the total parity with probability $\frac{1}{2}$, overwhelming any structure the other coins might impose.
This is a useful pattern to internalize. In generating-function or characteristic-function arguments, a factor of $(1 - 2p_i) = 0$ at a fair coin collapses the entire product to zero, which means the even/odd probabilities are exactly balanced. You see analogous logic in XOR-based randomness: XOR-ing any bitstring with a uniformly random bit produces a uniformly random result, regardless of the original bitstring's distribution. In interview settings, problems with mixed symmetric and asymmetric components often have cleaner answers than they first appear -- the symmetric component dominates. The real skill is recognizing that and going straight to the key factor, rather than grinding through casework on $q$.