Solution (source code)

= Solution

Write $s=\sigma/\sqrt n$, $\mu=\delta/s$, and let $Z_1,Z_2$ be independent <standard normal random variables> obtained by centering and scaling the separate stage means. Then
$$
W_1=\mu+Z_1,\qquad W_2=\sqrt2\mu+\frac{Z_1+Z_2}{\sqrt2}.
$$
The second statistic uses all patients, so the statistics are correlated even though the stages' new observations are independent. Their <covariance> is $1/\sqrt2$ and each <variance> is one. This gives the exact <bivariate normal distribution>
$$
\boxed{\begin{pmatrix}W_1\\W_2\end{pmatrix}\sim N_2\left[\begin{pmatrix}\mu\\\sqrt2\mu\end{pmatrix},\begin{pmatrix}1&1/\sqrt2\\1/\sqrt2&1\end{pmatrix}\right].}
$$
Under the <null hypothesis> both means are zero. At $\delta=\delta^*$ replace $\mu$ by $\sqrt n\delta^*/\sigma$; the mean vector is $(\sqrt n\delta^*/\sigma,\sqrt{2n}\delta^*/\sigma)^T$. In this <group sequential design> the full-sample statistic may be viewed as a potential statistic from the underlying sequence of outcomes, even on paths where recruitment stops.