Solution (source code)

= Solution

Now $p_A=2/3$, $p_B=1/2$, so $\bar p=7/12$, $\Delta=1/6$, $v_0=35/72$ and $v_1=17/36$. The same <sample size> calculation gives
$$
\boxed{n=\left\lceil\left(\sqrt{\frac{35}{2}}z_*+\sqrt{17}z_{0.8}\right)^2\right\rceil,\qquad N=2n.}
$$
At $\alpha=0.05$, the illustrative two-sided total is $2\times137=274$; the one-sided total is $2\times108=216$. The smaller difference needs roughly four times the size: its squared magnitude is a quarter of the previous one, while the <variance> factors change comparatively little.