Let $E_1$ be the event that the selected person is male and $E_2$ be the event that its a female.

$ P (E_1) = \large\frac{1}{2} = $$P (E_2)$

$E_1$ and $E_2$ are mutually exclusive and exhaustive, so we can apply Bayes theorem.

Let E: be the event that the person has grey hair. 5% of men picked at random have grey hair $\rightarrow P \large (\frac{E}{E_1}) = \frac{5}{100} = \frac{1}{20}$

We can calcuate the probability: $P \large \left(\frac{E_1}{E}\right) = \Large \frac{P\left(\frac{E}{E_1}\right ). P(E_1)} { (P\left(\frac{E}{E_1}\right ).P(E_1)) + (P\left(\frac{E}{E_2}\right ).P(E_2))}$

$P \large \left(\frac{E_1}{E}\right) = \Large \frac{\frac{1}{20} \frac{1}{2}} { \frac{1}{20}\frac{1}{2} + \frac{1}{400}\frac{1}{2}} = \frac{20}{21}$