Finding the Jordan Form and basis $$A= \begin{pmatrix}
2&1&2\\ -1&0&2 \\ 0&0&1
\end{pmatrix}$$
I found that $$f_A(x)=m_A(x) = (x-1)^3.$$
So the Jordan form must be:
$$J= \begin{pmatrix}
1&0&0\\ 1&1&0 \\ 0&1&1
\end{pmatrix}$$
Now,
$$A-I= \begin{pmatrix}
1&1&2\\ -1&-1&2 \\ 0&0&0
\end{pmatrix} $$
$$(A-I)^2 = \begin{pmatrix}
0&0&4\\ 0&0&-4 \\ 0&0&0
\end{pmatrix}$$ 
$$(A-I)^3 = 0$$
We choose $x_3$ such that $(A-I)^3 x_3= 0$ but $(A-I)^2 x_3\ne 0$. We may choose for example $(0,0,1)^T$. Then we choose $x_2 = (A-I)x_3 = (2,2,0)^T$ and $x_1 = (A-I)x_2 = (4,-4,0)$.
We denote $$Q = \begin{pmatrix}
4&2&0\\ -4&2&0 \\ 0&0&1
\end{pmatrix}$$ 
What I got is: $$Q^{-1}AQ = \begin{pmatrix}
1&1&0\\ 0&1&1 \\ 0&0&1
\end{pmatrix} \ne J$$
Questions:  


*

*I want the $1$'s to be below the main-diagonal. Why did I get them above? (And how do I change it?)

*Is this algorithm "bullet-proof"? Could I always find the Jordan form by observing the characteristic polynomial and minimal polynomial?


*

*If you choose a basis such that $Ab_2 = b_1 + \lambda b_2$ the ones will be above the diagonal.  If you choose a basis such that $A b_1 = b_2 + \lambda b_1$ they will be below.  It's a matter of whether the chains go up or down your indexing.

*No.  These two matrices have different Jordan forms, but the same characteristic and minimal polynomial
$$A = \left(\begin{array}{cccc} 0&1&0&0\\0&0&0&0\\0&0&0&1\\0&0&0&0 \end{array}\right)$$
$$B = \left(\begin{array}{cccc} 0&1&0&0\\0&0&0&0\\0&0&0&0\\0&0&0&0 \end{array}\right)$$
The characteristic polynomial is $t^4$ and minimal polynomial $t^2$.
