= Solution
The expected number of failures is
$$
F(n_0,n_1)=n_0(1-p_0)+n_1(1-p_1).
$$
Holding the alternative and test size fixed, constant power is equivalent to fixing $V(n_0,n_1)=C$. The ethical allocation problem is therefore
$$
\min_{n_0,n_1>0}F(n_0,n_1)
\quad\text{subject to}\quad
\frac a{n_0}+\frac b{n_1}=C.
$$
The <Lagrange multiplier> stationary equations determine the ratio; the second-order condition requires the constrained stationary point to be a local minimum.
Back to article page