I am told that the set of $n \times n$ symmetric matrices,
$$S^{n} = \{ X \in \mathbb{R}^{n \times n} \vert X = X^T \},$$
is a vector space with dimension $\dfrac{n(n + 1)}{2}$.
Naively, I would initially think that it should be a vector space with dimension $n^2$. However, since the matrix is symmetric, I then wonder if there would be "duplicates", for lack of a better term, which would give us something like $\dfrac{n^2}{2}$. But I'm not sure how one gets $\dfrac{n(n + 1)}{2}$. Could someone please explain this? Thank you.
Denote by $E_{ij}$ the $n \times n$ matrix with a $1$ in position $(i, j)$ and zeroes elsewhere. Then the set of matrices $$\{ E_{ij} + E_{ji} : i, j \in \{1, \ldots, n\}, i < j \} \cup \{ E_{ii} : i \in \{1, \ldots, n \} \}$$ is a basis of the space of symmetric matrices. Its cardinality is $$\binom{n}{2} + n = \frac{n(n-1)}{2} + n = \frac{n(n+1)}{2} \,.$$