In Sets and Groups by Green excesses 1 for Chapter 4 reads:
"1 Show that there are $n^{n^2}$ different binary operations on a set $A$ of order $n$. Find all sixteen binary operations on $A=\{a,b\}$. How many are (i) commutative, (ii) associative, (iii) have unit elements, or (iv) have zero elements?"
Can somebody give a hint on solving this question; starting from why is there $n^{n^2}$ different binary operations on a set $A$ of order $n$?
If you represent binary operation on $A$ by the multiplication table, then you'll get a map of $A\times A$ into $A$ which is only $n^n$.
You're on the right lines: you say
but in fact a map from $A$ (i.e. a set of size $n$) into $A$ would have $n^n$ possibilities; here $A\times A$ is a set of size $n^2$.