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

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

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 S{_{x}}^{2} in the matrix notation x^{T}Ax, where A is symmetric.


How do i do this? its getting ugly if i only try to expand 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 = \begin{bmatrix}\frac{1}{2}&-\frac{1}{2}\\-\frac{1}{2}&\frac{1}{2}\end{bmatrix}


Thanks!