Solution (source code)

= Solution

Let $n_n$ and $n_p$ count the available <neutrons> and <protons> immediately before their incorporation into nuclei. In the usual <neutron-limited helium synthesis> approximation, all surviving neutrons go into ${}^4\mathrm{He}$ and the remaining protons form ${}^1\mathrm H$. Each helium nucleus contains two neutrons and two protons, so
$$
n_{\rm He}=n_n/2,\qquad n_{\rm H}=n_p-n_n.
$$
Using the equal-nucleon-mass approximation and neglecting trace nuclei and binding-energy corrections, the <primordial helium mass fraction> is
$$
\boxed{Y_p=\frac{4n_{\rm He}}{n_{\rm H}+4n_{\rm He}}
=\frac{2n_n}{n_p+n_n}
=2\left(1+\frac{n_p}{n_n}\right)^{-1}.}
$$
The ratio is the pre-assembly nucleon ratio, not the number ratio of free hydrogen nuclei to helium nuclei afterward. The derivation assumes enough protons to bind all the neutrons, as in standard <Big Bang nucleosynthesis>. The familiar $n_p/n_n\simeq7$ gives $Y_p\simeq1/4$ and <hydrogen mass fraction> $X_p\simeq3/4$.