Solution (source code)

= Solution

Subtracting the two asymptotic variances and expanding the conditional second moments gives
$$
V_{\mathrm{known}}-V_{\mathrm{estimated}}
=\frac{\bigl((1-p)\mu_1+p\mu_0\bigr)^2}{p(1-p)}\geq0.
$$
Estimating the randomized treatment probability therefore projects out the component of the known-probability influence function proportional to $Z-p$, weakly improving asymptotic efficiency.