# [Math] Let $V$ be the vector space of all $4$x$4$ matrices such that the sum of the elements in any row or any column is the same.

linear algebramatricesproof-verification

Let $$V$$ be the vector space of all $$4$$x$$4$$ matrices such that the sum of the elements in any row or any column is the same. What is the dimension of $$V$$?

Sol: I thought of this matrix where every row and column sums to $$s$$ and since it has $$10$$ variables I think the dim is 10. By separating and taking out the variables I could come up with a $$10$$ element basis. Through an obvious but lengthy process I could show its linear independence and the fact that it's a spanning set is obvious from the construction. Is this correct?
$$\begin{bmatrix} a & b & c & s-(a+b+c)\\ d & e & f & s-(d+e+f)\\ g & h & i & s-(g+h+i)\\ s-(a+d+g) & s-(b+e+h) & s-(c+f+i) &-2s+(a+b+c+d+e+f+g+h+i) \end{bmatrix}$$

In general, the dimension of the subspace of $$M_n(K)$$ with equal row and column sum is $$(n-1)^2+1$$, see here:
Actually, if the value is supposed to be zero, the dimension is $$(n-1)^2$$. This follows for $$m=n$$ from the duplicate. We have to add plus $$1$$, if the value is not prescribed.