We know by definition that If a vector space has a basis consisting of vectors, then the number is called dimension of denoted by

Let be the subspace of all symmetric matrices in . What is the dimension of ?

I wanted to find the basis. So I did it like this:

A symmetric matrix is:

so

So the set

spans Moreover, can be shown to be linearly independent, and conclude that dimension of is

The book did it like this.

A symmetric matrix is:

so

So the set

spans Moreover, can be shown to be linearly independent, and conclude that dimension of is

Are these both correct? or am I wrong? Why?