# Find all the algebraic operations [duplicate]

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, ASBJul 4 '16 at 4:41

• 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? – JonesY Jul 3 '16 at 10:00
• Think of making the multiplication table. If it is commutative, what does the table look like? – Morgan Rodgers Jul 3 '16 at 10:01
• @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? – Raducu Mihai Jul 3 '16 at 10:12
• Number of multiplication tables=number of operations. Number of symmetric multiplication tables=number of commutative operations. – Morgan Rodgers Jul 3 '16 at 10:18
• Ok...then how do I find the numbers of multiplicatin tables. Can't you just tell me your solution? It would be very helpfull. – 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

• 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. – Raducu Mihai Jul 3 '16 at 10:32
• The elements of $S \times S$ are: $(1,1),(1,2),(2,1),(2,2)$, you forgot two. – David Wheeler Jul 3 '16 at 19:21
• The number of functions $A \to B$ when $A,B$ are finite is $|B|^{|A|}$, not $|A|\cdot|B|$.... – David Wheeler Jul 3 '16 at 19:24
• You were doing fine until the very end, but the displayed formula is wrong: see the comment by David Wheeler. – Brian M. Scott Jul 3 '16 at 19:45
• Count is very wrong, see above comments. – Morgan Rodgers Jul 3 '16 at 20:27