I am stuck on how to structure the matrix, can anyone help?
That's the usual design matrix, X.
The first column is all 1's (n of them)
The second one is x_1 through x_n
Now, when you obtain
you will get a diagonal matrix because the (1,1) position is n.
The (1,2) and (2,1) spot is the sum of the x's which is zero.
And the (2,2) position is