Solution (source code)

= Solution

For $\nu=1/2$, the <gas-phase metallicity> relation reduces to $Z=2y(1-M/M_0)$. Elimination of $M$ from <mass conservation> gives
$$
M=M_0\left(1-\frac Z{2y}\right),\qquad
S=2(M_0-M)=\frac{M_0Z}{y}.
$$
With a fixed <initial mass function>, let $\kappa$ be the number of surviving low-mass tracer <stars> per unit formed stellar mass. Successive <stars> inherit the monotonically increasing <gas-phase metallicity>, so the cumulative and differential counts are respectively
$$
\boxed{N(<Z)=\frac{\kappa M_0}{y}Z,\qquad \frac{dN}{dZ}=\frac{\kappa M_0}{y}},\qquad 0<Z<Z_f,
$$
where $Z_f=2y(1-M_f/M_0)$ is the abundance at the epoch when star formation stops. Above $Z_f$ the cumulative count is constant, and the differential count vanishes. In the complete gas-exhaustion limit, $Z_f\to2y$ and $N_{\rm total}=2\kappa M_0$, so the normalized <metallicity distribution function> is $p_Z=1/(2y)$ on $0<Z<2y$; at a finite stopping epoch it is $1/Z_f$. \b[The distribution is flat in linear metallicity.] A <logarithmic metallicity distribution> instead satisfies $dN/d\log_{10}Z=(\ln10)Z\,dN/dZ$ and is not flat.