Let $$W= \{ p(B) : p \text{ is a polynomial with real coefficients}\},$$ where $$ B= \begin{bmatrix} 0&1&0\\ 0&0&1\\ 1&0&0\\ \end{bmatrix}. $$
What of the following inequalities is satisfied by the dimension of the vector space $W$?
$4 \leq d \leq 6$;
$6 \leq d \leq 9$;
$3 \leq d \leq 8$;
$3 \leq d \leq 4$.
The following is how I have proceeded Here, $$B^2=\begin{bmatrix} 0&0&1\\ 0&1&0\\ 1&0&0\\ \end{bmatrix}.$$
$$B^3=\begin{bmatrix} 1&0&0\\ 0&0&1\\ 0&1&0\\ \end{bmatrix}.$$ And, $B^4=B$, $B^5=B^2$ and so on.
Hence, we can say that the degree of p(B) $\le$ 3.
Since every power of $B$ greater than $3$ can be written as a power of $B$ less than or equal to $3$, every polynomial in $B$ can be reduced to $P+ QB+ RB^2+ SB^3$. That is, every such polynomial can be identified with the quadruple of numbers $(P, Q, R, S)$. So, what is the dimension of this space? How do I proceed now?
The characteristic polynomial of $B$ can be calculated to be $$1-t^3 = -(t-1)\left(t - \frac{1+i\sqrt{3}}2\right)\left(t - \frac{1-i\sqrt{3}}2\right)$$
so $B$ has three distinct eigenvalues. Therefore, the minimal polynomial of $B$ is $m_B(x) = x^3-1$.
This implies that the set $\{I, B, B^2\}$ is linearly independent (otherwise there would exist a nonzero polynomial of degree $\le 2$ annihilating $B$).
On the other hand, for every $p \in \mathbb{R}[x]$ there exists unique $q, r \in \mathbb{R}[x]$ such that $p = m_B q + r$ and $\deg r < \deg m_A = 3$.
Now we have $p(B) = m_A(B)q(B) + r(B) = r(B)$ so we see that every element of $W$ can be expressed as $r(B)$ with $\deg r \le 2$.
Therefore $\{I, B, B^2\}$ is a basis for $W$ so $\dim W = 3$.