What is the number of binary operations on the set {a,b} and how?

What is the number of binary operations on the set {a,b} and how?

The number of functions from a set with m elements to a set with n elements is nm.
Binary operation is also a function from a set S x S to S.
So, The number of binary operations on the set S with n elements is (nn)2
So , the number of binary operations on the set {a,b} with 2 elements is( 22)2 = 24