Solution (source code)

= Solution

Let $n$ be the number allocated to each arm and test equality of the two reconviction <probabilities>, with a specified target difference as the alternative. For equal independent binomial arms, put $\bar p=(p_A+p_B)/2$, $\Delta=p_A-p_B>0$, $v_0=2\bar p(1-\bar p)$ and $v_1=p_A(1-p_A)+p_B(1-p_B)$. Under the null the rejection boundary for $\widehat p_A-\widehat p_B$ is approximately $z_*\sqrt{v_0/n}$; under the planning alternative its mean is $\Delta$ and <variance> is $v_1/n$. <statistical power> 0.8 is obtained approximately by requiring
$$
\Delta\sqrt n\ge z_*\sqrt{v_0}+z_{0.8}\sqrt{v_1}.
$$
Thus the <sample size for comparing two proportions> is
$$
\boxed{n=\left\lceil\frac{[z_*\sqrt{v_0}+z_{0.8}\sqrt{v_1}]^2}{\Delta^2}\right\rceil,\qquad N=2n,}
$$
where $z_q=\Phi^{-1}(q)$, $z_*=z_{1-\alpha/2}$ for a <two-sided test>, or $z_{1-\alpha}$ for a prespecified one-sided superiority test. With $p_A=2/3$ and $p_B=1/3$, this simplifies to
$$
\boxed{n=\left\lceil\left(\frac{3z_*}{\sqrt2}+2z_{0.8}\right)^2\right\rceil.}
$$
For illustration only, at $\alpha=0.05$ this gives 35 per arm, 70 total, for a <two-sided test>, or 27 per arm, 54 total, for a <one-sided test>. No unique numerical count is specified until alpha and sidedness are fixed. These are normal planning approximations; an exact requirement can be checked by summing the probabilities, from the two independent <binomial distributions>, of all tables in an exact test's rejection region and increasing $n$ until <statistical power> is at least 0.8.

This calculation detects a treatment difference when the effect equals the proposed target. It does not promise 80% <statistical power> to establish that the reduction is at least that target via a confidence bound when the true effect lies exactly at the target boundary. Such a different testing objective needs a separately specified null and planning alternative. Complete follow-up and ascertainment by <intention-to-treat analysis> are also required.