Consider the set $$A=\{{0,1,2,3,...,27}\}$$ I am required to find the number of matrices \begin{bmatrix} a & b\\ 0 & c \end{bmatrix} where $a,b,c\in A$ and the matrix is diagonalizable.
Here is how I have gone:
An upper-triangular matrix of order $2$ is diagonalizable iff it has two distinct diagonal entries or it is diagonal. Thus, the required number of such matrices is $28\times 28 \times27+28$.
Is my solution correct?
A real matrix of dimension $n$ is diagonalisable if and only if there exists a basis in $\mathbb R^n$ formed by the eigenvectors of $A$. Here we have that $n=2$. Let's compute the eigenvectors of $A$. First we start with eigenvalues: $$\det(A-\lambda I)= \begin{vmatrix}a-\lambda & b \\ 0 & c-\lambda\end{vmatrix}= (a-\lambda)(c-\lambda) = \begin{cases} \lambda_1 = a \\ \lambda_2 = c \end{cases}$$ The eigenvectors are the solutions to $$(A-\lambda_1 I) v = 0 \ \ \ \& \ \ \ (A-\lambda_2 I) w = 0$$ $$(a-c)v_1 + bv_2 = 0 \ \ \ \& \ \ \ \begin{cases} bw_2 = 0 \\ (a-c) w_2 = 0\end{cases}$$ Therefore, $v= (\frac{-b}{a-c}, 1)$ if $a\neq c$ and $w=(1,0)$. These vectors form a basis if $$\begin{vmatrix}\frac{-b}{a-c} & 1 \\ 1 & 0 \end{vmatrix} \neq 0$$ Which always holds true.
Therefore, we have to choose $a \neq c$ in order for $A$ to be diagonalisable. Choosing from the given set, we have $${28\choose1} \cdot {28\choose1} \cdot {27\choose1} =28 \times 28 \times 27$$
EDIT
I was missing some matrices!! If $a=c$ , then we have the equations $bv_2= 0 $ and $bw_2=0$, so $a=c$ is a double eigenvalue. If $b\neq 0$ we have that there is only one eigenvector, $(1,0)$ so the matrix is not diagonalisable. If $b=0$, all the equations cancel out, we have $\mathbb R^2$, which has a basis, for example $\{e_1,e_2\}$. Therefore, if $b=0$ and $a=c$ the matrix is diagonalisable (in fact, is diagonal); so we have the following possible cases $${28\choose1} \cdot {28\choose1} \cdot {27\choose1} + {28\choose1}=28 \times 28 \times 27 + 28 = \color{blue}{21196}$$