If A is a fixed n by n matrix, and S := {$B\in M_n(\Bbb{C}) : AB = BA$} is a subspace of $M_n(\Bbb{C})$.
Find a 3 by 3 matrix A such that S has dimension 5.
I figured the matrix below has dimension 3 when multiplied with B
$$A= \begin{pmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & i \\ \end{pmatrix}$$
So for a general matrix B, I did AB=BA, and then compared both sides and wherever the corresponding entries didn't match, I concluded them to equal zero. $$ B= \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & j \\ \end{pmatrix}$$