Solution (source code)

= Solution

The nucleons are nonrelativistic, so the <Maxwell-Boltzmann distribution> gives
$$
n_i=g_i\left(\frac{m_iT}{2\pi}\right)^{3/2}e^{(\mu_i-m_i)/T},\qquad i=n,p.
$$
Both spin degeneracies are two. Taking the ratio and using the specified negligible <chemical potentials> yields the <neutron-to-proton ratio>
$$
r_F=\left(\frac{m_n}{m_p}\right)^{3/2}e^{-(m_n-m_p)/T_F}
\simeq\boxed{e^{-Q/T_F}}.
$$
The mass prefactor differs from unity only at the per-mille level. The dependence on $T_F$ is much stronger: $d\ln r_F/d\ln T_F=Q/T_F>0$. Thus \b[earlier, hotter weak freeze-out leaves more <neutrons> relative to <protons>]. For illustration, $T_F=1\,\mathrm{MeV}$ gives $r_F\simeq0.28$; $T_F=0.8\,\mathrm{MeV}$ gives $r_F\simeq0.20$. <Free-neutron decay after freeze-out> lowers the ratio further before most <Big Bang nucleosynthesis> takes place.