Solution (source code)

= Solution

Let $\widehat p_k=X_k/n_k$, where $X_k\sim\operatorname{Binomial}(n_k,p_k)$ independently, and put
$$
\widehat V=\frac{\widehat p_1(1-\widehat p_1)}{n_1}
+\frac{\widehat p_0(1-\widehat p_0)}{n_0}.
$$
The <Wald statistic> is $Z=(\widehat p_1-\widehat p_0)/\sqrt{\widehat V}$. The <central limit theorem> and <Slutsky theorem> give $Z\dot\sim N(0,1)$ under $H_0$. When $p_1-p_0=\delta^*>0$,
$$
Z\dot\sim N\!\left(
\frac{\delta^*}{\sqrt{p_1(1-p_1)/n_1+p_0(1-p_0)/n_0}},1
\right).
$$