How to obtain the following upper bound for the number of heads for coin tosses

probability

I have $n$ coins, each with probability
$p$ of being head and coin flips are independent of each other, the probability of at least $n/2$ heads is at most
${n\choose n/2} p^{n/2}$. Why is this so?

In other words, I am asking the proof of why \begin{align*} P[\text{#heads}\geq n/2]\leq{n\choose n/2}p^{n/2}\end{align*}

Best Answer

If the number of heads is $\geq n/2$, then there is some subset $A \subset \{1,2,\ldots,n\}$ with $|A| = n/2$ such that $i \in A$ implies flip $i$ was a head.

That is, $$\{\#\text{heads} \geq n/2\} \subseteq \bigcup_{|A| = n/2} \{\forall i \in A, \text{ flip } i \text{ is a head}\}$$

By monotonicity and subadditivity of $P$, we have $$P[\#\text{heads} \geq n/2] \leq \sum_{|A|=n/2}P[\forall i \in A, \text{ flip } i \text{ is a head}] = \sum_{|A|=n/2} p^{n/2} = \binom{n}{n/2}p^{n/2}$$