We know by definition that If a vector space $\displaystyle W$ has a basis consisting of $\displaystyle n$ vectors, then the number $\displaystyle n$ is called dimension of $\displaystyle V,$ denoted by $\displaystyle dim(V) = n.$

Let $\displaystyle W$ be the subspace of all symmetric matrices in $\displaystyle M_{2,2}$. What is the dimension of $\displaystyle W$?

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

A symmetric matrix is:

$\displaystyle A = \begin{bmatrix} a & b \\ b & c \end{bmatrix}$

so $\displaystyle A = a\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} + b \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} + b \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix} + c\begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} $

So the set

$\displaystyle S = \left\{ \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix}, \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} \right\}$

spans $\displaystyle W.$ Moreover, $\displaystyle S$ can be shown to be linearly independent, and conclude that dimension of $\displaystyle W$ is $\displaystyle 4$

The book did it like this.

A symmetric matrix is:

$\displaystyle A = \begin{bmatrix} a & b \\ b & c \end{bmatrix}$

so $\displaystyle A = 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} $

So the set

$\displaystyle S = \left\{ \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} \right\}$

spans $\displaystyle W.$ Moreover, $\displaystyle S$ can be shown to be linearly independent, and conclude that dimension of $\displaystyle W$ is $\displaystyle 3$

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