# A fair coin is tossed four times. What is the probability...

HW problem here. I know the answer is 6/16 (per the back of the book) but I can't figure out how they got that.

A fair coin is tossed four times. What is the probability that the number of heads appearing on the first two tosses is equal to the number of heads appearing on the second two tosses?

My thought was that the probability of getting x heads on the first two throws would be $\frac{1}{2} \times \frac{1}{2} = \frac{1}{4}$ and the same thing on the other side and then multiply the events together getting $\frac{1}{4} \times \frac{1}{4} = \frac{1}{16}$

So where am I going wrong? How do they get the 6?

Thanks.

There are $3$ cases : either you have $0$ head appearing on the first two tosses, either you have $1$ or either you have $2$. You treated the case when you have $2$. The case when you have $0$ gives the same probability of $\frac{1}{16}$. The probability that the number of heads is $1$ on the first two tosses is $2 \times \frac{1}{2} \times \frac{1}{2} = \frac{1}{2}$. Therefore you must add $\frac{1}{2} \times \frac{1}{2} = \frac{1}{4} = \frac{4}{16}$ to $\frac{2}{16}$.

What are the possibilities that the number of heads on the first two tosses equals the number of heads on the second two tosses? The possibilities are: TTTT, HTHT, THHT, HTTH, THTH, HHHH. So those are six possibilities. There are 16 possibilities total. So the answer is 6/16.

If the problem were different so that it had so many flips that it became annoying to write them all out individually you could (a) use a computer, or (b) calculate the probability of getting 0 heads in the first half and 0 heads in the second half, 1 head in the first half and 1 head in the second half, etc. And then find the probability of any of those events happening.

There are clearly 16 different outcomes. If the equal number of heads is $0$, so both the first two and the last 2 have $0$ heads, we have all tails, which is 1 solution.

If both are 2, we have all heads, also 1 solution.

If both are one, each side separately has two options: TH, HT, independent of each other, which gives $2 \times 2 = 4$ solutions, altogether 6.

For a generalization, suppose the coin has a probability $p$ of landing heads, and the outcome of individual tosses are independent and identically distributed. For $n$ tosses, the number $X$ of heads observed is binomially distributed: $X \sim \mathrm{Binomial}(n,p)$ with probability mass function $$\Pr[X = x] = \binom{n}{x} p^x (1-p)^{n-x}.$$ Then if we toss the coin $2n$ times, the probability that the number of heads in the first $n$ tosses equals the number of heads in the last $n$ tosses is simply $$\sum_{x=0}^n \biggl(\binom{n}{x} p^x (1-p)^{n-x}\biggr)^2.$$ When $n = 2$, this simplifies to $$(1-p)^4 + 4p^2(1-p)^2 + p^4.$$ For $p = 1/2$, the sum is $$\frac{1}{4^n} \sum_{x=0}^n \binom{n}{x}^2.$$ For both $n = 2$ and $p = 1/2$, we get $$\frac{1}{16}(1 + 4 + 1) = \frac{6}{16} = \frac{3}{8}.$$