Suppose $S∈L(C^4)$ and $B$ is a basis for $C^4$ for which
$M(S,B)$ = \begin{bmatrix}2&0&-1/2&1/2\\0&2&1/2&-1/2\\1/2&-1/2&1&1\\-1/2&1/2&1&1\end{bmatrix}
The characteristic polynomial of $S$ is $p(z) = (z−1)^2(z−2)^2$. What is the minimal polynomial of S?
Here minimal polynomial and characteristic polynomials has same irreducible factors, so the minimal polynomial has one of the form $$(z-1)(z-2)\;\;\text{or}\;\;(z-1)^2(z-2)\;\;\text{or}\;\;(z-1)(z-2)^2\;\;\text{or}\;\;\rho_S(x)$$
Here $$S-I=\begin{bmatrix}1&0&-1/2&1/2\\0&1&1/2&-1/2\\1/2&-1/2&0&1\\-1/2&1/2&1&0\end{bmatrix}$$ and $\text{rank}(S-I)=3$.
Also $$S-2I=\begin{bmatrix}0&0&-1/2&1/2\\0&0&1/2&-1/2\\1/2&-1/2&-1&1\\-1/2&1/2&1&-1\end{bmatrix}$$ and $\text{rank}(S-2I)=2$.
Thus $S$ has totally three linearly independent eigenvectors[ one for $S-I$ and two for $S-2I$]
Hence the JCF of $S$ is of the form $$\begin{bmatrix} \begin{pmatrix} 1&1 \\ 0&1 \end{pmatrix} \\ & (2)\\ & & (2)\end{bmatrix}$$ Form this, $$m_S(z)=(z-1)^2(z-2)$$