p=probability for heads,

n=number of throws....

the probability of getting an even number of heads can be expressed

by expanding the binomial,

or logically as follows....

even number of heads={no heads and n tails} or {2 heads and n-2 tails} or {4 heads and n-4 tails} or {6 heads and n-6 tails} or.......etc

and we must count all the ways these pairings can occur.

the probability is P(0H and nT)+P(2H and [n-2]T)+........