How many ways can we get an even number of tails from two groups of people? Consider two groups of people: one containing $N$ persons and the other containing $M$. Each person is asked to toss a coin. What is the probability that each group gets an even number of tails?
Please walk me through the derivation. Thank you.
My initial guess: Probably something of the form 
$$ \sum_{n=1}^{?} {{?}\choose{2n}} \big/{2^{N+M}} \,?$$

[Motivation: Toric code in Quantum Computation. :) ]
 A: Try to break it into steps.
Step $(1)$: what is the probability that the number of tails in $K$ coin tosses is even? Hint: what is the probability that the number of tails in $K$ coin tosses is exactly some integer $j$?
Step $(2)$: What is the probability that each group has an even number of tails symoultaneously? Hint: use independence!

Let $E_{j,K}$ be the event that exactly $j$ of the $K$ coin tosses are tails; we wish to calculate the probability $p_{j,K}=\mathbb{P}\left(E_{j,K}\right)$.
It can be found as follows:
choose $j$ of the $K$ coin tosses to be tails, in $\binom{K}{j}$ ways; the remaining (unchosen) tosses are heads.
There is a one-to-one correspondence between these choices and qualifying sets of $K$ coin tosses.
Moreover, each such choice has a ${\left(\frac12\right)}^K$ probability of occurring.
The total probability is hence
$$p_{j,K}=\binom{K}j\cdot\frac1{2^K}$$
Now, since for $j_1\neq j_2$ the events $E_{j_1,K}$ and $E_{j_2,K}$ are disjoint, we have that
$$\mathbb{P}\left(E_{j_1,K}\cup E_{j_2,K}\right)=p_{j_1,K}+p_{j_2,K}$$
Therefore, for the probability that the number of tails in $K$ coin tosses be even, we need only sum the $p_{j,K}$ over even $j$.
