Solution (source code)

= Solution

The <sample mean> is
$$
\boxed{\overline X\sim N\left(\mu,\frac{\sigma^2}{n}\right)}.
$$
Write the Gaussian sample vector as its orthogonal projection onto the span of $(1,\ldots,1)$ plus its projection onto the orthogonal complement. These two Gaussian projections are independent. Their squared standardized lengths give <Cochran's theorem>:
$$
\boxed{\frac{S_{XX}}{\sigma^2}\sim\chi^2_{n-1},
\qquad \overline X\ \text{is independent of }S_{XX}}.
$$