This question already has an answer here:

How many algebraic operations can be defined on a set S with n elements and how many of them are comutative.
Ok so I know that a algebraic operation is a law (let's say *) such that $*:S\times S \rightarrow S$. So for each pair of the cartesian product associate a element from S.
I was thinking like this: Let $A = \{i \in \mathbb{N}|1\leq i \leq |S \times S|\}$, and let $A' = \{\overline{a_1a_2...a_n}\|n = A \ and\ a_i \in A, \forall i = \overline{1,n}\}$. So the cardinal of A' is the answare.


marked as duplicate by David Wheeler, Leucippus, Shailesh, C. Falcon, ASB Jul 4 '16 at 4:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Try 1st for a finite set S, describing the operation in a matrix. How many matrices do you have of size S*S? How many of those matrices represent a commutative operation? $\endgroup$ – JonesY Jul 3 '16 at 10:00
  • $\begingroup$ Think of making the multiplication table. If it is commutative, what does the table look like? $\endgroup$ – Morgan Rodgers Jul 3 '16 at 10:01
  • $\begingroup$ @MorganRodgers I did the multiplication table for a set S with elements a1...an. If it is commutative then the lements should be symmetric through the main diagonal. But what about the numbers of operations that can be defined on that set? $\endgroup$ – Raducu Mihai Jul 3 '16 at 10:12
  • $\begingroup$ Number of multiplication tables=number of operations. Number of symmetric multiplication tables=number of commutative operations. $\endgroup$ – Morgan Rodgers Jul 3 '16 at 10:18
  • $\begingroup$ Ok...then how do I find the numbers of multiplicatin tables. Can't you just tell me your solution? It would be very helpfull. $\endgroup$ – Raducu Mihai Jul 3 '16 at 13:48

There are $n^2$ different ordered pairs in $S\times S$ and for each of them you an associate an element of $S$ to form a map $*$. Pick any element in $S\times S$ and assicate an element $s\in S$, and you can do the same for next one etc...

So there are $n^3$ different possible maps $*$. (this is essentially same as asking how many functions $f$ from $A$ to $B$ where $|A|=n^2$ and $|B|=n$ if that helps you to visualize it).

For coummutative one we need to ensure that for every $s,t$, $*(s,t)=*(t,s)$. So essentially we only need to assign a value for each $(s,t)$ and $(t,s)$ are automatically assigned the same value.

It is trivial that if $s=t$ then $*(s,t)=*(t,s)$. So we look for number of pairs $s,t$ such that $s\neq t$. There are ${n \choose 2}$ different such pairs, and also there are $n$ pairs of the form $(s,s)$. We then assign a value for each of these and there are

$$ \left({n\choose 2} +n\right)\times n $$

such choices

  • $\begingroup$ Let's say that my set S has two elements(1 and 2). So the elements of SxS are (1,2) and (2,1). First of all S does not have n^2 elements(4), Then if we were to find all functions f from SxS to S there are exactly 4 functions. So there are not n^3 operations. Please let me know if I get something wrong because I am so confused. $\endgroup$ – Raducu Mihai Jul 3 '16 at 10:32
  • $\begingroup$ The elements of $S \times S$ are: $(1,1),(1,2),(2,1),(2,2)$, you forgot two. $\endgroup$ – David Wheeler Jul 3 '16 at 19:21
  • 2
    $\begingroup$ The number of functions $A \to B$ when $A,B$ are finite is $|B|^{|A|}$, not $|A|\cdot|B|$.... $\endgroup$ – David Wheeler Jul 3 '16 at 19:24
  • 1
    $\begingroup$ You were doing fine until the very end, but the displayed formula is wrong: see the comment by David Wheeler. $\endgroup$ – Brian M. Scott Jul 3 '16 at 19:45
  • $\begingroup$ Count is very wrong, see above comments. $\endgroup$ – Morgan Rodgers Jul 3 '16 at 20:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.