Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to solve following problem but not able to find any way to proceed.

Let $S$ be a set having $n$ elements. Can we count about number of binary operations that can be defined on a set? Can we also count number of commutative binary operations defined on $S$?

Thanks for the help and suggestions

share|cite|improve this question
A binary operation can be thought of as a function $S\times S\to S$. Does that help? – anon Apr 28 '13 at 20:09
@anon Thanks for the hint. Now all I need to do is to find out the number of functions from $S\times S \to S$. Am i right? What about commutative binary operations? – srijan Apr 28 '13 at 20:11
Well, almost. A commutative binary operation can be thought of as a function whose codomain is $S$ and whose domain is the set of all $2$-subsets as well as singletons (to account for things like $a*a$). – anon Apr 28 '13 at 20:28
up vote 8 down vote accepted

If $A$ and $B$ are two finite sets with $|A| = m$ and $|B| = n$ then the number of maps from $A$ to $B$ is $|B|^{|A|} = n^m$. This is because the function must be defined on each of $|A|=m$ members of $A$ and for each of those m members there are $|B|=n$ possible values. Thus, there are $$\Pi_{i=1}^{m}n=n^m$$ different possible functions from $A$ to $B$.

If we apply this to maps from $S\times S\rightarrow S$ we get $|S|^{|S\times S|}=n^{(n^2)}$.

For commutative maps, we require that $(p,q)$ and $(q,p)$ be mapped to the same value. The elements of $S\times S$ are in $1$-$1$ correspondence with the entries of a square $n\times n$ matrix. Commutative maps map an entry of the lower triangle of this matrix to the same value of the corresponding entry of the upper trianglular matrix. Therefore the domain will have cardinality $\frac{n(n+1)}{2}$ and so there will be $n^{(\frac{n(n+1)}{2})}$ commutative maps from $S\times S$ to $S.$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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