Finding the Dimension of a Matrix Polynomial: $W$ = { $p(B)$ : $p$ is a polynomial with real coefficients} Let $W = \{ p(B) : p \text{ is a polynomial with real coefficients}\}$, where
$$B=
\begin{pmatrix}
0 & 1 & 0\\ 
0 & 0 & 1\\ 
1 & 0 & 0
\end{pmatrix}$$
Which of the following possibilities presents the tightest bounds on the dimension $d$ of the vector space $W$?  


*

*$4 ≤ d ≤ 6$   

*$6 ≤ d ≤ 9$   

*$3 ≤ d ≤ 8$   

*$3 ≤ d ≤ 4$   

 A: First, check that $W$ is a subspace: If $p_1(B),p_2(B) \in W$, then $(p_1+p_2)(B) \in W$ and if $p(B)\in W$, then $(\lambda p)(B) \in W$.
The dimension of a subspace is the maximum number of linearly independent vectors (or on this case, matrices, which can also be viewed as vectors)
The Cayley Hamilton theorem tells us that the characteristic polynomial $\chi(x) = \det (xI -B)$ of $B$ satisfies $\chi(B) = 0$.
Since the characteristic polynomial of $B$ is $\chi(x)=x^3-1$, Cayley Hamilton gives (also by direct computation) $B^3 - I=0$, or $B^3 = I$. 
In particular, we have $B^k = B^{k \text{ mod } 3}$ and so any power of $B$ can be written as one of $I,B,B^2$, and hence if $p$ is a polynomial, we can write $p(B) = p_0I+p_1B+p_2 B^2$ for some $p_0,p_1,p_2$. That is, $I,B,B^2$ form a spanning set for $W$.
Hence $W \subset \operatorname{sp} \{I,B,B^2\}$, and we see that $d=\dim W \le 3$.
To see that $d=3$, we need to show that $I,B,B^2$ are linearly independent.
Note that $B^2 = \begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{bmatrix}$. Now suppose $\alpha_0 I+\alpha_1 B + \alpha_2 B^2 = 0$. Since $B_{11} = (B^2)_{11} = 0$, it follows that $\alpha_0 = 0$. Since $I_{31} = (B^2)_{31} = 0$, it follows that $\alpha_1 = 0$, and since $B^2 \neq 0$, it follows that $\alpha_2 =0$. Hence they are linearly independent and so 
$I,B,B^2$ form a basis for $W$, and so $d=3$.
A: $B$  represents a rotation by $2\pi/3$ about the axis $(1,1,1)^\top.$ we also claim that $$\{I, B, B^2\} \text{ is linearly independent. } $$ 
proof of the claim: suppose $$aI + bB + cB^2 = 0 $$ multiplying on the right by $(1,0,0)^\top$ gives $$a(1,0,0)^T + b(0,0,1)^\top+c(0,1,0)^\top = 0 \implies a = 0, b = 0, c = 0.$$ this proves the claim.  therefore a basis for $W$ is  $\{I, B, B^2\}$ and its dimension is $3.$
