Solution (source code)

= Solution
{c}

A <likelihood-ratio test> rejects for small $\lambda$. The <derivative> of the <natural logarithm> of its variable factor is
$$
\frac d{dt}\{n\log t+m\log(1-t)\}
=\frac{n-(n+m)t}{t(1-t)}.
$$
Thus $t^n(1-t)^m$ increases up to $n/(n+m)$ and decreases thereafter, tending to zero at both endpoints. Every nontrivial lower <level set> of $\lambda$ therefore consists of two tails. For a prescribed <test size> $0<\alpha<1$, the exact <critical region> is
$$
\boxed{T<k_1\quad\text{or}\quad T>k_2},\qquad
0<k_1<\frac n{n+m}<k_2<1.
$$
Writing $F_{n,m}$ for the <cumulative distribution function> of the <beta distribution> with parameters $(n,m)$, the required two equations are
$$
\boxed{\begin{aligned}
k_1^n(1-k_1)^m&=k_2^n(1-k_2)^m,\\
F_{n,m}(k_1)+1-F_{n,m}(k_2)&=\alpha.
\end{aligned}}
$$
The first makes both cutoffs have the same <likelihood ratio>; the second calibrates the <null hypothesis> rejection <probability>. Equivalently, the second left-hand side is
$$
\frac1{B(n,m)}\left\{\int_0^{k_1}t^{n-1}(1-t)^{m-1}\,dt+
\int_{k_2}^1t^{n-1}(1-t)^{m-1}\,dt\right\}.
$$
As the common <likelihood ratio> threshold increases from zero to one, this <probability> increases continuously and strictly from zero to one; hence the equations determine unique cutoffs. \b[The two tail probabilities need not each equal $\alpha/2$] when $n\ne m$. Exact calibration holds for every common rate because the given <null distribution> of $T$ is independent of that rate. Boundary equalities have zero <probability>.