# Dimension of the linear space $\mathbb{R}^{n\times n}$?

i) What is the dimension of the linear space $\mathbb{R}^{n\times n}$ of all $n\times n$ matrices?

ii) What is the dimension of the subspace of symmetric matrices in $\mathbb{R}^{n\times n}$?

Def: The dimension of the linear space $V$ is defined as the maximum number of linearly independent vectors in $V$.

I really don't understand att all how I can use that definition to answer i) and ii) above. How should I think through this?

• The definition is only about vectors. Apply it to matrices by stacking the columns of the matrix into a single vector. – LinAlg Mar 20 '18 at 19:19
• Imagine $A$ an $nxn$ matrix filled with $0$'s. Replace the $0$ in first line, first column by a $1$: matrix $A_{11}$. Then replace the zero in in$A$ line 1, column 2 by a 1: matrix $A_{12}$ and so on and so forth. How many matrices will you have? The proof of independance of this set of matrices should be rather straight-forward as should be the proof that any matrix in $\mathbb{R}^{n\times n}$ is a linear combination of the matrices in this set. – Bernard Massé Mar 20 '18 at 19:31
• @BernardMassé I'd go all the way to $A_{1n}$, så $n-1$ different matrices? – Parseval Mar 20 '18 at 19:44

HINT

Think to a possible standard basis for the two subspaces.

Case 2-by-2 - General case

$$\begin{bmatrix}a&b\\c&d\end{bmatrix}=av_1+bv_2+cv_3+dv_4=a\begin{bmatrix}1&0\\0&0\end{bmatrix}+b\begin{bmatrix}0&1\\0&0\end{bmatrix}+c\begin{bmatrix}0&0\\1&0\end{bmatrix}+d\begin{bmatrix}0&0\\0&1\end{bmatrix}$$

Case 2-by-2 - Symmetric

$$\begin{bmatrix}a&b\\b&c\end{bmatrix}=aw_1+bw_2+dw_3=a\begin{bmatrix}1&0\\0&0\end{bmatrix}+b\begin{bmatrix}0&1\\1&0\end{bmatrix}+c\begin{bmatrix}0&0\\0&1\end{bmatrix}$$

• You lost me gimusi. Please elaborate. – Parseval Mar 20 '18 at 19:41
• @Parseval I've added some detail. As you noted the dimension is given by the numbers of vectors of a basis. Now it easy to construct a basis by elementary matrices, once you have them you have dimension also. – gimusi Mar 20 '18 at 20:00
• So, for $2\times 2$ matrx (general case), the dimension is $2^2$ and for an $n\times n$ it's $n^2$? The answer in the book for the i) is $\frac{n(n+1)}{2}.$ – Parseval Mar 20 '18 at 20:48
• @Parseval For the general case yes we han $n\times n$ entries and thus we need $n\times n=n^2$ elementary matrix (imagine ordinary vectors in $\mathbb{R^{n^2}}$. How many entries there are for a symmetric matrix of order n? – gimusi Mar 20 '18 at 20:51
• Sorry, I'm a bit tired, I was jumping back and fourth between i) and ii) without realizing it myself. Everything is clear now thank you! – Parseval Mar 20 '18 at 21:25

There are very basic $n\times n$ matrices consisting of a $1$ in position $ij$ and zeroes on the rest of the entries. Those allow you to write a convenient linear combinations for any generic $n\times n$ matrix.

• Yes, but I can't write all of them and count them. What do you have in mind? – Parseval Mar 20 '18 at 19:42
• @Parseval, there are only $n^2$ of these very simple basic matrices – janmarqz Mar 20 '18 at 19:56
• Okay, I understand that. But the answer is $\frac{n(n+1)}{2}$. So there have to be other than those simple basic matrices to add to $n^2$? – Parseval Mar 20 '18 at 20:50
• to count symmetric matrices observe that you only have to count diagonals from the principal diagonal up to the entry $1,n$: this sum is $n+(n-1)+(n-2)+...+2+1$ – janmarqz Mar 20 '18 at 20:57