$\frac{1}{2}$
a) If we flip a fair coin $5$ times, what is the probability that the number of heads is an even number (note that 0, 2 and 4 are even numbers)?
b) Does your answer depend on the number of flips?
$\frac{1}{2}$
a) In the random experiment of tossing a coin $5$ times, an example outcome can be represented by the ordered pair,$(H,T,T,H,T)$. Assuming that order matters, the total number of outputs,$|\Omega|=2.2.2.2.2=2^5=32$, and each outcome has equal probability.
Let us denote by $E$ the event that the number of heads is an even number.Therefore, its complement, $E^C$, denotes the event that number of heads is anodd number. Note that our example output $(H,T,T,H,T) \in E$.
We claim that $E$ and $E^C$ contain equal number of outcomes from $\Omega$. We can show this by writing down a bijection (a one-to-one mapping between the elements of $E$ and the elements of $E^C$
We define $f$ to be the map that changes just the first flip in the sequence. For example,$f(HTTHT)=TTTHT$. Define a switch function $s$ as $s(H) = T$ and $s(T)=H$. For an arbitrary outcome $(o_1,o_2,o_3,o_4,o_5)$ where $o_1,o_2,o_3,o_4,o_5 \in {H,T}$, we can write,
$f\big((o_1,o_2,o_3,o_4,o_5)\big) = (s(o_1),o_2,o_3,o_4,o_5)$
To show that $f$ is bijective, we may show that it is invertible. In fact, $f$ is its own inverse, since
$f\bigg(f\big((o_1,o_2,o_3,o_4,o_5)\big)\bigg) = f\big( (s(o_1),o_2,o_3,o_4,o_5) \big) = \big(s(s(o_1)),o_2,o_3,o_4,o_5\big) = (o_1,o_2,o_3,o_4,o_5)$
Since $E$ and $E^C$ have the same number of outcomes and each outcome is equally likely, $P(E) = P(E^C)$.
Using the complement rule, we then get\[\begin{align}P(E)+P(E')&=1\\
\implies 2P(E)&=1,\text{ since }P(E)=P(E')\\
\implies P(E)&=\frac{1}{2}.\end{align}\]
b) The above proof works for any positive number of flips, just by changing the length of the outcomes from 5 to an arbitrary $n$.