Solution (source code)

= Solution

Assume equal allocation of $n$ independent offenders to each arm and a two-sided <statistical test> of <significance level> $\alpha$. Write $p_0=0.60$ for P30 and $p_1=0.56$ for initial community-service assignment, with $\Delta=p_0-p_1=0.04$ and $\bar p=(p_0+p_1)/2=0.58$. The two event counts have independent <binomial distributions>. Under the stated alternative, the difference of sample proportions is approximately a <normal distribution> with mean $\Delta$ and <variance>
$$
\frac{p_0(1-p_0)+p_1(1-p_1)}{n}.
$$
The pooled two-proportion test has approximate upper rejection threshold $z_{1-\alpha/2}\sqrt{2\bar p(1-\bar p)/n}$ at the planning rates, where $z_q$ is the <standard normal quantile>. To obtain <statistical power> $0.80$ against a positive difference, place the alternative mean $z_{0.80}$ alternative-standard-errors above that threshold:
$$
\Delta\sqrt n
\simeq z_{1-\alpha/2}\sqrt{2\bar p(1-\bar p)}
+z_{0.80}\sqrt{p_0(1-p_0)+p_1(1-p_1)}.
$$
Solving yields the usual <sample size for comparing two proportions>:
$$
\boxed{n\simeq\frac{\left[z_{1-\alpha/2}\sqrt{2(0.58)(0.42)}
+z_{0.80}\sqrt{(0.60)(0.40)+(0.56)(0.44)}\right]^2}{(0.04)^2}}
$$
per arm, rounded upwards, with total <sample size> $2n$. This targets the dominant rejection tail under the planning alternative; an exact power calculation can include the very small opposite-tail probability or use the <binomial distributions> directly.

For illustration, at $\alpha=0.05$, $z_{0.975}\simeq1.960$ and $z_{0.80}\simeq0.842$, giving $n\simeq2388.8$. Thus
$$
\boxed{2389\text{ per arm, or }4778\text{ altogether}.}
$$
For a prespecified one-sided test, replace $z_{1-\alpha/2}$ by $z_{1-\alpha}$. The calculation assumes complete endpoint ascertainment, independent individual allocation and that the two initial-policy rates are appropriate; losses or clustered allocation would require corresponding design adjustments.