Solution (source code)

= Solution

A star inherits the <gas-phase metallicity> at its birth. Set $y_e=y/(1+\nu)$; the preceding calculation gives $G(Z)=G_0e^{-Z/y_e}$ and $dS/dZ=G(Z)/y$. If the <initial mass function> is fixed, let $\kappa$ be the number of the counted stars per unit formed stellar <mass>; this includes any restriction to surviving long-lived tracers. The <metallicity distribution in a leaky box> is therefore
$$
\boxed{\frac{dN}{dZ}=\frac{\kappa G_0}{y}\exp\left[-\frac{(1+\nu)Z}{y}\right].}
$$
The total eventual formed stellar <mass> is $G_0/(1+\nu)$, so $N_\infty=\kappa G_0/(1+\nu)$ and the equivalent normalized <metallicity distribution function> is
$$
\boxed{\frac1{N_\infty}\frac{dN}{dZ}=\frac{1+\nu}{y}e^{-(1+\nu)Z/y}.}
$$
If $N(Z)$ means a cumulative count rather than a count per <stellar metallicity> interval, <integration> yields
$$
\boxed{N(<Z)=N_\infty\left[1-e^{-(1+\nu)Z/y}\right].}
$$
At a finite observation time these expressions end at the current <gas-phase metallicity> $Z_f$ and the normalized distribution divides by $1-e^{-Z_f/y_e}$. A distribution per logarithmic <stellar metallicity> instead multiplies $dN/dZ$ by $(\ln10)Z$; it is not the same shape as the distribution per linear <stellar metallicity>.