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?

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$.
