Repeated Eigenvalues 2 Two problema from Differential Equations; Dynamical Systems,  and an Introduction to Chaos (Morris W. Hirsch,Stephen Smale.Robert L. Devaney).
Examples (pages 112-113):
If $$A= \begin{pmatrix}
        1 & 1& 0\\
        -1 & 3 &  0\\
        -1 & 1 & 2 \\
        \end{pmatrix}$$
… $\lambda =2 , m_{\lambda}=3$ $\operatorname{rank}(A-2I)=1 , n_{\lambda}=2 ,k= m_{\lambda}- n_{\lambda}+1=2$ so
 $$\color{#C00}{p= \begin{pmatrix}
        -1& 1 & 0 \\
        -1 & 0 &  0 \\
        -1 & 0 & 1 \\
        \end{pmatrix}}$$ by $ v_1=(A-2I)v_2, v_2 : \begin{cases}
(A-2I)^2v_2= 0\\
(A-2I)v_2 \not = 0\\
\end{cases}
$
But $$p^{-1}Ap \not =J$$  $$\begin{pmatrix}
        0& 2 & 0 \\
        2& 1 &  0 \\
        0 & 0 & 2 \\
        \end{pmatrix} \not = \begin{pmatrix}
        2& 1 & 0 \\
        0 & 2 &  0 \\
        0 & 0 & 2 \\
        \end{pmatrix}$$  what’s wrong?!
two problems exist: first why $v_3= \begin{pmatrix}
        0 \\
        0  \\
        1  \\
        \end{pmatrix}$ from $(A-2I)v_2 = 0$ why this way?(is not be mentioned in definition)
second why this order(from definition) is not true (for $v_i$) in fact 
$\color{#C00}{p= \begin{pmatrix}
        1& -1 & 0 \\
        0 & -1 &  0 \\
        0 & -1 & 1 \\
        \end{pmatrix}}$
 A: Issue 1
I was trying to solve the matrix you posted and spent an hour trying to figure out why my results were not matching the authors' and I decided to go back and check the source!
The matrix $A$ is incorrect - look at the entry $a_{32}$, it should be a $1$, so:
$$A= \begin{pmatrix}
        1 & 1& 0\\
        -1 & 3 &  0\\
        -1 & 1 & 2 \\
        \end{pmatrix}$$
Are you using a newer version of the book and the publisher hosed it (as I have an older copy and the page numbers are different)? I would really like to know if the newer version hosed the matrix.
A check now correctly shows:
$$P^{-1}AP =J = \begin{pmatrix}2& 1 & 0 \\0 & 2 &  0 \\0 & 0 & 2\end{pmatrix}$$
Issue 2
We have $(A - 2I) = \begin{pmatrix}1 & -1 & 0 \\1 & -1 &  0 \\1 & -1 & 0\end{pmatrix}$
The row-reduced-echelon-form (RREF) gives us:
$$\begin{pmatrix}1 & -1 & 0 \\0 & 0 &  0 \\0 & 0 & 0\end{pmatrix}$$
So that we have two linearly independent eigenvectors (x, y, z) for which we
must have $x = y$ while $z$ is arbitrary (in other words z is a free variable).
These authors choose the vectors in reverse order. Since we can have any $z$ we like, they choose the first vector as $v_3 = (0,0,1)$. Do you see why that satisfies the RREF solution we derived? Also, you realize we cannot have a zero eigenvector!
Issue 3
We just need for the eigenvectors in the matrix $P$ to track the eigenvalues in $J$ (the columns are correlated to each other in those two matrices, in other words, you can move the eigenvalues and eigenvectors to any column you desire). Since we have an eigenvalue with a multiplicity of $3$, if we write the eigenvectors in a different order, it will leave the three eigenvalues intact, but will move the $1's$ around.
Try this experiment:


*

*Create three versions of $P$ by swapping the columns.

*Validate that in each case, we get a different variant of the Jordan block where the $1's$ of the matrix are permutted around, so it won't look like $P^{-1}AP = J$.

*If the eigenvalues were distinct, we could move the eigenvalues and eigenvectors around without affecting the result, since we have no Jordan block.

