Solution (source code)

= Solution

For zero <chemical potential>, each species contributes $S_i=(U_i+P_iV)/T=4U_i/(3T)$. Thus
$$
\boxed{\frac{S_B}{V}=\frac{2\pi^2}{45}g_Bk_{\rm B}
\left(\frac{k_{\rm B}T}{\hbar c}\right)^3,\qquad
\frac{S_F}{V}=\frac78\frac{2\pi^2}{45}g_Fk_{\rm B}
\left(\frac{k_{\rm B}T}{\hbar c}\right)^3.}
$$
<Entropy density> scales as $T^3$ at fixed relativistic particle content; total <entropy> also includes the changing proper volume. An isolated adiabatically expanding comoving gas has conserved total <entropy> and $aT$ constant, rather than its total <entropy> falling as $T^3$.

At equal <temperature>, single <electrons> and <photons> each have two spin/polarization states. In the <ultrarelativistic> approximation,
$$
\boxed{\frac{S_{e^-}}{S_\gamma}=\frac78.}
$$
<Positrons> are a separate species with the same contribution, so $(S_{e^-}+S_{e^+})/S_\gamma=7/4$. This distinction is needed for the heating count in part <4/d>. At the exact supplied <temperature> the <electron> rest mass gives corrections to the ideal $7/8$ ratio; it is the limiting relativistic value requested by the problem.

There is also a sign convention issue in the introductory <entropy> formula. With the chemical-potential convention used in the supplied distribution, the Euler relation is $U=TS-PV+\sum_i\mu_iN_i$, so $S=(U+PV-\sum_i\mu_iN_i)/T$. Its chemical-potential term has the opposite sign to the printed one. For a concrete counterexample, a dilute monatomic <ideal gas> with one internal state and $n\lambda_T^3=e^{-1}$, where $\lambda_T$ is the <thermal de Broglie wavelength>, has $\mu=-k_{\rm B}T$, $U=3Nk_{\rm B}T/2$ and $PV=Nk_{\rm B}T$. Its <entropy> is $7Nk_{\rm B}/2$; the printed plus sign would instead give $3Nk_{\rm B}/2$. All <chemical potentials> have been neglected here, so this source error does not change any of the above results.