# Valid definition of a binary operation on a set

Need quick help with a homework question:

Determine whether the description of # is a valid definition of a binary operation on a set:

a) On $\Bbb R$ where $a\#b$ is $a*b$ (ordinary multiplication)

b) On $\Bbb Z$, where $a\#b$ is $ab^2$

Can anybody help me solve this and possibly make me understand?

-
Are you saying that you can't square an integer? – Federica Maggioni Apr 22 '13 at 10:53
I don't know how to format it here where the b appears as a superscript – Jurgen Malinao Apr 22 '13 at 10:57
so did you mean $a#b=a^b$? If so, # is not a binary operation, as an example $2#-1$ is not an integer – Federica Maggioni Apr 22 '13 at 11:01

A binary operation on a set $X$ is a map from $X\times X$ to $X$. Therefore to assure that a description yields a binary operation you should check that it is correct for each $(a,b)\in X\times X$ and for every such pair $(a,b)$ it describes an element from $X$ (all these conditions are satisfied for both your cases a) and b), so you have descriptions of binary operations).
A binary operator is a type of function. So, the question becomes, are $ab$ and $ab^2$ defined on all of $\Bbb R^2$ and $\Bbb Z^2$ respectively, and do they produce unique values in $\Bbb R$ and $\Bbb Z$ respectively?