Solution (source code)

= Solution

For
$$
\mathcal L=n_0(1-p_0)+n_1(1-p_1)
+\eta\left(\frac a{n_0}+\frac b{n_1}-C\right),
$$
the stationary equations are
$$
1-p_0=\frac{\eta a}{n_0^2},
\qquad
1-p_1=\frac{\eta b}{n_1^2}.
$$
Dividing them gives
$$
R^*=\frac{n_0}{n_1}
=\sqrt{\frac{a(1-p_1)}{b(1-p_0)}}
=\sqrt{\frac{p_0}{p_1}}\frac{1-p_1}{1-p_0}.
$$
The fixed-power constraint then determines the total sample size. Strict convexity after eliminating one variable supplies the second-order minimum condition.