Solution (source code)

= Solution

Under the boundary null $p=\pi_0=0.20$, rejection requires both $X_1>r_1$ and $X_1+X_2\geq r$. Independence of the two <binomial distributions> gives
$$
\alpha=\sum_{x=r_1+1}^{n_1}b(x;n_1,\pi_0)
\left[1-B(r-x-1;n_2,\pi_0)\right].
$$
The rejection event is increasing in $p$, so this boundary value is the supremum over the composite null $p\leq\pi_0$.