Conjugacy classes of non-Abelian group of order $p^3$

Let $G$ be a non-abelian group of order $p^3$. How many are its conjugacy classes?

The conjugacy classes are the orbits of $G$ under conjugation of $G$ by itself. Since $G$ is non-abelian, its center has order $p$. So the class equation yields $p^3 = p + \sum_{[x]} (G: G_x)$, where $G_x$ is the centralizer of $x$ and the sum is taken over disjoint orbits $[x]$. We can also see that $(G:G_x)$ can only be $p$ or $p^2$. So we will have $p$ orbits of length $1$ and then orbits of length $p$ and $p^2$. Any hints on determining the number of the latter?

-

We know that $Z(G) = p$. Suppose $[G:G_x] = p^2$ for some $x \notin Z(G)$. Then $G_x$ has $p$ elements, and since $Z(G) \subseteq G_x$, we have $Z(G) = G_x$. Now since $x$ is in $G_x$, it is also in $Z(G)$. From this it follows that $G_x = G$, and thus $Z(G) = G$, a contradiction. Thus $[G:G_x] = p$ for all $x \notin Z(G)$, showing that $G$ has $p^2 + p - 1$ conjugacy classes.

-
Why not just say that the centralizer of any non-cntral element must properly contain the center? It is a little faster in the second part. –  awllower Jun 3 '12 at 17:57

Suppose $g$ is a noncentral element. Then the centralizer of $g$ contains the centre of $G$, and also contains $g$ itself, giving it at least $p+1$ elements. Thus the centralizer has order $p^2$, so $g$ has $p$ conjugates. There are thus $p+\frac{p^3-p}{p}=p^2+p-1$ conjugacy classes.

-

The centraliser of a non-central element contains at least $p+1$ elements, since it contains the centre, with order $p$. It cannot have order equal to $p^3$, or the element would be central. Thus, the order of the centraliser or a non-central element is equal to $p^2$, and hence the index is equal to $p$, which is to say that it has $p$ conjugates. Therefore, there are $\frac{p^3 - p}{p} = p^2 - 1$ conjugacy classes of non-central elements, giving a total of $p^2 + p - 1$ conjugacy classes.

-

One can break it up into 3 steps. First, show that $|Z(G)|$ is equal to p. Second, show that if $a$ is not in $Z(G)$ then $|N_G(a)|=p^2$. Finally, the last step is to use the class equation to show that there are $p^2+p-1$ conjugacy classes.

-