Solution (source code)

= Solution

The <cosmological visibility function> is the probability density for last scattering, so the stipulated two instantaneous populations give
$$
\boxed{g(\eta)=p\,\delta_D(\eta-\eta_*)
+(1-p)\delta_D(\eta-\eta_1)}.
$$
Since $g=\partial_\eta e^{-\tau}$ and $e^{-\tau}$ vanishes before the first transparent epoch,
$$
\boxed{
e^{-\tau(\eta)}=
\begin{cases}
0,&\eta<\eta_*,\\
p,&\eta_*<\eta<\eta_1,\\
1,&\eta>\eta_1.
\end{cases}}
$$
Its plot is a nondecreasing step function: it jumps from zero to $p$ at recombination and from $p$ to one at $\eta_1$. The <cosmological optical depth> interpretation is that $e^{-\tau(\eta)}$ is the probability that a photon present at time $\eta$ reaches the observer without any later scattering.