Find a diagonal matrix M 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?
 A: Multiplying by a diagonal matrix from the left multiplies the rows by the diagonal elements; multiplying by a diagonal matrix from the right multiplies the columns by the diagonal elements.
In the present case, you want the diagonal elements to remain unchanged and the off-diagonal elements to change sign; you can achieve this by multiplying, say, the even-numbered rows and columns by $-1$.
A: Think of it in terms of row and column operations. Given a $4\times 4$ matrix $C$, we have that $$\left(\begin{array}{cccc}1 & & & \\ & -1 & & \\ & & 1 & \\ & & & 1\end{array}\right)\cdot C,$$ for example, is the same as $C$, but with all the elements of the second row of $C$ multiplied by $-1$. On the other hand, $$C\cdot\left(\begin{array}{cccc}1 & & & \\ & -1 & & \\ & & 1 & \\ & & & 1\end{array}\right)$$ is the same as $C$, but with all the elements of the second column of $C$ multiplied by $-1$.
It's worth noting that a diagonal matrix with $\pm1$ on the diagonal is its own inverse, so that should also make things a bit easier.
