let $\displaystyle x=(x_{1},x_{2},...,x_{n})$

$\displaystyle \bar{x}=\frac{1}{n}(x_{1}+x_{2}+...+x_{n})$

$\displaystyle S{_{x}}^{2}=\frac{1}{n-1}((x_{1}-\bar{x})^2+(x_{2}-\bar{x})^2+...+(x_{n}-\bar{x})^2)$

Express the quadratic form $\displaystyle S{_{x}}^{2}$ in the matrix notation $\displaystyle x^{T}Ax$, where A is symmetric.

How do i do this? its getting ugly if i only try to expand $\displaystyle S{_{x}}^{2}$
so i tried it for n=2 to get some hint of what the matrix A would be. Well i got the matrix for n=2 but i can't figure out how it would be for an arbitary n.

this is what i got for n=2 : A = $\displaystyle \begin{bmatrix}\frac{1}{2}&-\frac{1}{2}\\-\frac{1}{2}&\frac{1}{2}\end{bmatrix}$