TITLE: The number of $3\times 3$ nilpotent matrices over $\mathbb{F}_q$ using the Orbit-Stabilizer theorem
QUESTION [8 upvotes]: The Fine-Herstein theorem says that the number of nilpotent $n\times n$ matrices over $\mathbb{F}_q$ is $q^{n^2-n}$. I am trying to verify this for the case $n=3$ using the orbit-stabilizer theorem.
Here is my method:

Knowing that the minimal polynomial is $x^m$ for $m\leq n$, I determine the possible rational canonical forms:

$\left( \begin{array}{ccc}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \end{array} \right)$ $\left( \begin{array}{ccc}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 1 & 0 \end{array} \right)$ $\left( \begin{array}{ccc}
0 & 0 & 0 \\
1 & 0 & 0 \\
0 & 1 & 0 \end{array} \right)$ 

Let $GL_n(\mathbb{F}_q)$ act by conjugation on each of these matrices, then the sum of the sizes of the three orbits is the number of nilpotent matrices.

We know that $\mid GL_n(\mathbb{F}_q) \mid =(q^n-1)\cdots (q^n-q^{n-1})$, so that all the work goes in to finding the size of the stabilizer.
This method worked like a charm for the $n=2$ case, but I am having trouble finding what an element of the stabilizer looks like in each case for $n=3$. Is this possible to do just by conjugating by a general matrix and setting it equal to the class representative?

REPLY [5 votes]: I looked up this theorem and a proof I found was so nice I wanted to reproduce it here.
A standard fact of linear algebra states that given any linear map $T$ of a finite-dimensional space $V$, we have $V=\operatorname{im}(T^d)\oplus\ker(T^d)$ where $d=\dim V$. 
The map $T$ decomposes as $\rm invertible\oplus nilpotent$ acting on this decomposition; moreover every decomposition $V=A\oplus B$ and pair $(X,Y)\in{\rm GL}(A)\times{\rm Nil}(B)$ uniquely determines every endomorphism of $V$. Note ${\rm Nil}(-)$ is the space of nilpotent maps. Therefore, assuming now that $V$ is finite-dim over a finite field $\Bbb F_q$, the total number of endomorphisms of $V=\Bbb F_q^d$ is given by
$$q^{d^2}=\sum_{V=A\oplus B} |{\rm GL}(A)|\cdot|{\rm Nil}(B)|.$$
Write $N(k)$ for the number of nilpotent matrices in $M_{k\times k}(\Bbb F_q)$. We may count the number of decompositions $V=A\oplus B$ with $\dim B=k$ using orbit-stabilizer: ${\rm GL}(\Bbb F_q^n)$ acts transitively on such decompositions and the stabilizer of $\Bbb F_q^{n-k}\oplus\Bbb F_q^k\,$ is ${\rm GL}(\Bbb F_q^{n-k})\times{\rm GL}(\Bbb F_q^k)$. Thus
$$\begin{array}{ll} \displaystyle q^{d^2} & \displaystyle =\sum_{k=0}^d\left(\frac{|{\rm GL}(\Bbb F_q^n)|}{|{\rm GL}(\Bbb F_q^k)\times{\rm GL}(\Bbb F_q^{n-k})|}\right)|{\rm GL}(\Bbb F_q^{n-k})|N(k) \\
& \displaystyle = \sum_{k=0}^d\frac{|{\rm GL}(\Bbb F_q^d)|}{|{\rm GL}(\Bbb F_q^k)|}N(k) \\
& \displaystyle = N(d)+\frac{|{\rm GL}(\Bbb F_q^d)|}{|{\rm GL}(\Bbb F_q^{d-1})|} \sum_{k=0}^{d-1}\frac{|{\rm GL}(\Bbb F_q^{d-1})|}{|{\rm GL}(\Bbb F_q^k)|}N(k) \\
& = \displaystyle N(d)+\frac{|{\rm GL}(\Bbb F_q^d)|}{|{\rm GL}(\Bbb F_q^{d-1})|}q^{(d-1)^2}. \end{array}$$
Counting $|{\rm GL}_n(\Bbb F_q)|=(q^n-1)(q^n-q)\cdots(q^n-q^{n-1})$ is a classical exercise: to construct an invertible matrix, first choose a nonzero vector, second choose a vector which is not a scalar multiple of the first, third choose a vector which is not in the span of the first two, and so on.
So one may compute
$$\frac{|{\rm GL}(\Bbb F_q^d)|}{|{\rm GL}(\Bbb F_q^{d-1})|}=\frac{q^d-1}{1}\frac{q^{d\phantom{-1}}-q}{q^{d-1}-1}\cdots\frac{q^{d\phantom{-1}}-q^{d-1}}{q^{d-1}-q^{d-2}}=(q^d-1)q^{d-1}. $$
Therefore, solving for $N(d)$ we obtain
$$N(d)=q^{d^2}-(q^d-1)q^{d-1}q^{(d-1)^2}=q^{d(d-1)}. $$