1. ## Rational Canonical Form

$A = \left( \begin{matrix} 4 &1 & 2 & 0 \\ -4 & 0 &1 &5 \\0 &0 &1 & -1 \\0 &0 &1 & 3 \\ \end{matrix} \right)$
$char_A = (x-2)^4$
$min_A=(A -2I)^3=x^3-6x^2+12x-8$.
We deduce that $R = \left( \begin{matrix} 0& 0& 8& 0\\1 &0 &-12 & 0 \\0 &1 & 6 & 0\\0 &0 & 0 & 2 \\
\end{matrix} \right)$
.
We choose $\vec{v_1}= \left( \begin{matrix} 0 \\ 0 \\1 \\0 \\ \end{matrix} \right)$ and $\vec{v_2}= A\vec{v_1} = \left( \begin{matrix} 2 \\ 1 \\1 \\1 \\ \end{matrix} \right) = \vec{v_2}$. Then $\vec{v_3}= A\vec{v_2} = A^2\vec{v_1}$. This is the third column of $A^2$ which is $\left( \begin{matrix} 4 &1 & 2 & 0 \\ -4 & 0 &1 &5 \\0 &0 &1 & -1 \\0 &0 &1 & 3 \\ \end{matrix} \right)\left( \begin{matrix} 2 \\ 1 \\ 1 \\ 1 \\ \end{matrix} \right) = \left( \begin{matrix} 11 \\ -2 \\0 \\ 4 \\ \end{matrix} \right) = \vec{v_3}$. Finally, $\vec{v_4}= \left( \begin{matrix} 1 \\ 0 \\ 0\\ 0 \\ \end{matrix} \right)$.
Let $Q =
\left( \begin{matrix} 0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\
\end{matrix} \right)
$
.
Let's check independence of the columns and invertibility of the matrix right now.
$det(Q) = \left| \begin{matrix}
0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\
\end{matrix} \right| = (1) \left| \begin{matrix} 2& 11 & 1\\1 & -2 & 0 \\1 & 4 & 0\\
\end{matrix} \right| = (1) (1)\left| \begin{matrix} 1 & -2 \\1 & 4 \\
\end{matrix} \right| = 6\neq 0$
, so $Q$ is invertible. This also tells us that the row space (and thus the column space) has dimension 4. It follows that the columns are independent.
Now we check that $QR = AQ$.
$QR = \left( \begin{matrix}
0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\
\end{matrix} \right) \left( \begin{matrix} 0& 0& 8& 0\\1 &0 &-12 & 0 \\0 &1 & 6 & 0\\0 &0 & 0 & 2 \\ \end{matrix} \right)= \left( \begin{matrix}
2& 11 & 42 & 2\\
1 & -2 & -24 & 0\\
1 & 0 & -4 &0\\
1 & 4 & 12 &0\\
\end{matrix} \right)$

$AQ =\left( \begin{matrix} 4 &1 & 2 & 0 \\ -4 & 0 &1 &5 \\0 &0 &1 & -1 \\0 &0 &1 & 3 \\ \end{matrix} \right)\left( \begin{matrix}
0& 2&11 & 1\\0 &1 & -2 & 0 \\1 &1 & 0 & 0\\0 &1 & 4 & 0 \\ \end{matrix} \right) = \left( \begin{matrix}
2& 11 & 42 & 4\\
1 & -2 & -24 & -4\\
1 & 0 & -4 &0\\
1 & 4 & 12 &0\\

\end{matrix} \right)$

It doesn't work can someone tell me why?
It seems that the only vector working is $\vec{v_4}= \left( \begin{matrix} 0 \\ 0 \\0 \\0 \\ \end{matrix} \right)$ !