Dimension of subspace of all upper triangular matrices

If $S$ is the subspace of $M_7(R)$ consisting of all upper triangular matrices, then $dim(S)$ = ?

So if I have an upper triangular matrix $$\begin{bmatrix} a_{11} & a_{12} & . & . & a_{17}\\ . & a_{22} & . & . & a_{27}\\ . & . & . & . & .\\ 0 & . & . & . & a_{77}\\ \end{bmatrix}$$

It looks to me that this matrix can potentially have 7 pivots, therefore it is linearly independent and so it will take all 7 column vectors to span it. But that answer is marked as incorrect when I enter it so what am I missing here?

• You shouldn't be thinking of the dimension of the row or column space - how might you write a matrix in co-ordinates? In other words, how many values do you have to specify in order to uniquely determine an upper triangular matrix in $M_7(R)$?
– mdp
Commented Mar 19, 2012 at 11:03

• I dont understand this, anyone able to enlighten me?? I thought S being a subspace of $M_7$ meant I am dealing with all possible upper triangular 7x7 matrices, whereas you seem to be saying the subspace includes matrices of dimensions 1, 2,...,7? Commented Mar 19, 2012 at 11:21
• A basis of $M_7(R)$ is given by the set of matrices with a $1$ in a single entry and $0$s elsewhere - there are $49$ of these. As you have no restrictions on the values of $a_{11},a_{12},\ldots,a_{77}$, the same argument works here and you can just count the number of entries which can be non-zero.
In general, an $n\times n$ matrix has $n(n-1)/2$ off-diagonal coefficients and $n$ diagonal coefficients. Thus the dimension of the subalgebra of upper triangular matrices is equal to $n(n-1)/2+n=n(n+1)/2$.