Find a diagonal M, made up of 1's and -1's, to show that
$A=\begin{pmatrix} 2 & 1 & & \\ 1 & 2 & 1 & \\ & 1 & 2 & 1 \\ & & 1 & 2 \end{pmatrix}$ is similar to $B=\begin{pmatrix} 2 & -1 & & \\ -1 & 2 & -1 & \\ & -1 & 2 & -1 \\ & & -1 & 2 \end{pmatrix}$
I'm trying to understand $M^{-1}AM=B$ decomposition but a bit tricky for me.
Can anyone help me to understand how to solve this problem
and what is the solution?