# what is dimension of orthogonal complement of a subspace of a vector space.

This is last part of my other question. I don't understand the last part of problem. Feel free to edit the question.

c) Let $V$ be a vector space of real $n \times n$ symmetric matrices, what is $\text{dim } V$? What is the dimension of the subspace of $W$ of $V$ containing matrices $A$ whose trace is $0$? What is the dimension of the orthogonal complement of $W^{\perp}$ relative to the positive definite scalar product of part $(b)$?

Here is screen shot of the complete question

I think the $\text{dim } V = \frac{n(n+1)}{2}$ and $\text{dim} W = \frac{n(n+1)}{2} - 1$. Since one element of diagonal can be expressed linear combination of other diagonal elements. I don't understand the last part of it. dimension of the orthogonal complement of $W^{\perp}$.

-
"Complement", with an "e", and "compliment", with an "i", are two different things. If I say this question is brilliant, that's a compliment (with an "i"). A complement (with an "e") of $X$ is something that when added to $X$, makes a complete whole. The similarity between the spelling of "complement" (with an "e") and the spelling of "complete" is not coincidental and can serve as a reminder. I corrected the spelling in the question. –  Michael Hardy Jan 31 '13 at 15:11
In your case, $W^{\perp} = \{ X \in V : \text{$\operatorname{tr}(A X) = 0$for all$A \in W$} \}$. –  Andreas Caranti Jan 31 '13 at 15:16
@MichaelHardy An off-track comment: according to this dictionary, "compliment" and "complement" were the same word before 1650, and "compliment" meant to "complete the obligations of politeness." –  user1551 Jan 31 '13 at 15:27
@AndreasCaranti is $X$ vector or another matrix? –  hasExams Jan 31 '13 at 15:42
Since it is a complement, we have $\dim(W) + \dim(W^{\perp}) = \dim(V)$ –  David Wheeler Jan 31 '13 at 16:39

As Andreas Caranti already wrote in the comments, the orthogonal complement of $W$ is defined via: $W^\perp=\{X\in V | \operatorname{tr}(AX)=0 \text{ for all } A\in W\}$.
For a non-degenerate bilinear from, as David Wheeler wrote in the comments, we have $\operatorname{dim}(W)+\operatorname{dim}(W^\perp)=\operatorname{dim}(V)$. Thus, you can conclude $\dim W^\perp=1$ as you already correctly computed the dimensions of $V$ and $W$.
Still one question remains, namely, what is $W^\perp$. If you know it is one-dimensional, this is easy to see, $\operatorname{tr}(AE_n)=\operatorname{tr}(A)=0$ for $A\in W$ and $E_n$ the identity matrix. But you can also approach the problem differently and try to work just with the definition of $W^\perp$ to solve the exercise. I will sketch this solution for $n=2$ and leave the general solution as an exercise:
An arbitrary element of $W$ looks like $A=\begin{pmatrix}a_{11}&a_{12}\\a_{12}&-a_{11}\end{pmatrix}$. For an arbitrary matrix $B=\begin{pmatrix}b_{11}&b_{12}\\b_{12}&b_{22}\end{pmatrix}\in V$ to lie in $W^\perp$ is then the same as having $\operatorname{tr}(AB)=a_{11}(b_{11}-b_{22})+2a_{12}b_{12}=0$ for all $A\in W$. One can conclude that $b_{11}=b_{22}$ and $b_{12}=0$. Hence, $B=\lambda E_n$ for some $\lambda\in \mathbb{R}$. For general $n$, an elementary solution would be similar, but involves a lot of indices.