Solution (source code)

= Solution

Let $Y_{\rm He}\simeq0.25$ be the present <primordial helium mass fraction>. If $n_{\rm He}$ is the helium-nucleus density and $n_H$ the hydrogen-nucleus density, then
$$
n_b=n_H+4n_{\rm He},
\qquad
n_p=n_H+2n_{\rm He}.
$$
Since $Y_{\rm He}=4n_{\rm He}/n_b$,
$$
\boxed{\frac{n_p}{n_b}=1-\frac{Y_{\rm He}}2\simeq0.875}.
$$
This retains the correction from <neutrons> bound in helium. <Charge neutrality> requires one <electron> per proton, including bound electrons, so with the <baryon-to-photon ratio> $\eta=n_b/n_\gamma\simeq6\times10^{-10}$,
$$
\boxed{\frac{n_e}{n_\gamma}
=\frac{n_p}{n_b}\eta
\simeq5.3\times10^{-10}}.
$$