Solution (source code)

= Solution
{c}

For the given <real matrix> $M$, direct <matrix multiplication> gives the <eigenvectors>
$$
M\begin{pmatrix}1\\0\\1\end{pmatrix}=0,\qquad
M\begin{pmatrix}0\\1\\1\end{pmatrix}=2\begin{pmatrix}0\\1\\1\end{pmatrix},\qquad
M\begin{pmatrix}1\\1\\0\end{pmatrix}=4\begin{pmatrix}1\\1\\0\end{pmatrix}.
$$
Put these <eigenvectors> into the columns of
$$
P=\begin{pmatrix}1&0&1\\0&1&1\\1&1&0\end{pmatrix},\qquad
P^{-1}=\frac12\begin{pmatrix}1&-1&1\\-1&1&1\\1&1&-1\end{pmatrix}.
$$
Since $\det P=-2\ne0$, $P$ is an <invertible matrix>. The three column identities give $MP=PD$, so
$$
\boxed{D=P^{-1}MP=\operatorname{diag}(0,2,4),\qquad M=PDP^{-1}.}
$$
In particular, the <matrix similarity> is established by an explicit <change-of-basis matrix>.