TITLE: Show that the number of nonisomorphic finite groups of order $n$ is at most $n^{n^2}.$
QUESTION [7 upvotes]: I have a question. I am supposed to prove the following theorem:
Let $n \in \mathbb{N}$ be a natural number. 
Show that:
the number of nonisomorphic groups of order $n$ is less than or equal to $n^{n^2}$.
My reasoning:
A set $G$ is a group if it's equiped with a binary operation/map: $G\times G \rightarrow G, \space (g_1,g_2)\rightarrow g_1 \circ g_2$. Additionally two groups $G,H$ are isomorphic $G \cong H$ if there exists a isomorphism $f:G \rightarrow H$.
Now, for each such map $G\times G \rightarrow G$ we get a different group. Because there are $n^{n^2}$ such different maps (for $|G|=n$), the number of all possible different groups should be $\leq n^{n^2}$. And since we have different binary operations defined on the same set, we should get different multiplication (Cayley) tables, we would have $f(a)\star f(b)\neq f(a \circ b)$ for $a,b \in G$ and some bijection $f$ . Meaning that, since homomorphisms don't exist, all those different groups are nonisomorphic and we have therefore shown the above theorem to be true.
More intuitively:
The statement of beeing (non) isomorphic can be translated to (not) having the same multiplication table. If we have a group of order $n$, then the multiplication table should be of size $n\times n= n^2$. Each of the $n^2$ entries (in the table) has $n$ possible entries, representing a different choice of the above mentioned binary operation. Because those possibilities multiply, we would have: $n\times \cdots \times n=n^{n^2}$ and each table beeing different, those groups are nonisomorphic.
My question:
Is my reasoning, in both cases, correct? Am I missing something? How would I prove, more formally,  that for different binary operations defined on the same set we get different nonisomorphic groups?
Related questions:
Number of distinct groups of order n upto isomorphism, for a fixed integer n.
The number of groups of order n(upto isomorphism)is
Comment: I am a physicist and don't have major ambitions in abstract algebra, please be nice.

REPLY [2 votes]: Here's how to do a little better than $n^{n^2}$. For a group $G$, define
$d(G)$ to be the least positive integer $k$ such that $G$ can be generated by $k$ elements and let $f(n)$ denote the number of non-isomorphic groups of order $n$.
We first show that if $|G| = n$ then $d(G) \leq \log n$. Let $1=G_0 <G_1 <G_2 <\dots < G_r = G$ be a maximal chain of subgroups. Let $g_i \in G_i \setminus G_{i−1}$ for $1 \leq i \leq r$. Then $\langle g_1, \ldots ,g_i \rangle = G_i$, as one easily sees by induction. In particular, $G$ can be generated by $r$ elements. Now by Lagrange’s Theorem
$$ |G| = \prod_{i=1}^r [G_i : G_{i-1}] \geq 2^r.$$
Hence $r \leq \lfloor \log n \rfloor$. Then by Cayley’s theorem $G\leq S_n$ and so $f(n)$ is at most the number of subgroups of order $n$ in $S_n$ which is at most the number of $\lfloor \log n \rfloor$-generator subgroups of $S_n$ which is at most the number of $\lfloor \log n \rfloor$-element subsets of $S_n$. This last quantity is $\leq (n!)^{\log n} \leq n^{n \log n}$.