Solution
= Solution
The matrix $S$ is the <sample covariance matrix>
$$
S=\frac1n\sum_{r=1}^n(x_r-\bar x)(x_r-\bar x)^T,
\qquad \bar x=\frac1n\sum_{r=1}^nx_r.
$$
Changing $n$ to $n-1$ is another convention, but the objective must use the same convention throughout.