Semimagic square Matrix 
How to prove this? Basically I have no idea at all as how to proceed in this particular question. Please look into this. 
 A: Call those five matrices $P_1,P_2,P_3,P_4,P_5$. 
Start with a semi-magic square, $A$. By subtracting the appropriate multiple of $P_1$, we can make the $(2,2)$ entry zero (that's the entry in row 2, column 2). Then subtract the appropriate multiple of $P_2$ to make the $(1,1)$ entry zero (without affecting the $(2,2)$ entry). Then subtract the appropriate multiple of $P_3$ to make the $(1,3)$ entry zero (without affecting the entries previously made zero). Then subtract the appropriate multiple of $P_4$ to make the $(2,1)$ entry zero (without affecting the entries previously made zero). Finally, subtract the appropriate multiple of $P_5$ to make the $(2,3)$ entry zero  (without affecting the entries previously made zero). 
You now have a semi-magic square that looks like $$\pmatrix{0&x&0\cr0&0&0\cr y&z&w\cr}$$ But that has to be the zero matrix. So, you have written $A$ as a linear combination of $P_1,P_2,P_3,P_4,P_5$. 
A: Firstly, we need an algorithm to make a 3*3 semimagic matrix.
We can put an arbitrary row for the first row and we calculate the sum of the elements in the first row (name it $T$). Then, to make the second row, the first two elements are chosen arbitrarily. The last element of the second row is a number that gives $T$ when added to the rest of the row. So, it is not a free variable and it is dependent. To make the last row, we have to put numbers that satisfy the condition for columns. It is easy to show that the condition for the last row would be satisfied automatically. Therefore, we have 5 (same as the number of elements in the spanning set) free variables and the semimagic matrix space is a 5-dimensional space.
If we prove that the given spanning set, which all of them are semimagic matrices, contains 5 linearly independent elements, we have completed the proof. This task is done easily using contradiction.
A: The number of independent entries in a 3x3 semimagic square which force the other entries is 5. So any 5 linearly independent semimagic squares can span the space of all 3x3 semimagic squares.
