Is there a binary operation $*$ such that $(a*a)*a\neq a*(a*a)$?

Q: Is there a binary operation $*$ such that $(a*a)*a\neq a*(a*a)$?

I apologize if this question has been asked before or maybe it is too stupid. It is not obvious to me that any binary operation always must satisfy $(a*a)*a= a*(a*a)$. I tried to find counterexamples, but so far no luck.

Certainly this binary operation, if it exists, is not associative.

• It's also not commutative if it exists... – coffeemath Jul 23 '17 at 8:01
• LOL, "so far no luck". If you write down all binary operations you know, including $a-b, a/b, a^b$ and throw a dice, there's a big chance you'd have your counterexample. – Professor Vector Jul 23 '17 at 8:03
• @ProfessorVector I agree, solution was easy. I was looking for something very exotic like octonion multiplication. Didn't think about trivial operations such as substraction of real numbers. – Tyrell Jul 23 '17 at 8:17

Consider the integers $\mathbf{Z}$ and the binary operation $n * m = n-m.$ Then $$(n*n)*n=(n-n)-n=-n$$ but $$n*(n*n)=n-(n-n)=n$$ for all $n.$

Division (in, say, the nonzero reals) provides another example: $${a\over ({a\over a})}=a\quad\mbox{but}\quad{({a\over a})\over a}={1\over a}$$

I would also keep in mind, that a binary operation can be anything, as long as it takes two elements and maps them onto one element (which again is in whatever set you are defining your operation in).

F.ex. for the set $\{a,b\}$ you could define $a\times a:=b$ and $a \times b:=b$ but $b \times a:=a$.
On the one hand you would get $a$ and on the other $b$.

Of course in this case you can just take a 'normal' example, like stated in the other answers.

Operation on $\mathbb{R}_{>0}$: $(x,y)\mapsto x^y$. Then $(3^3)^3 = 19683$ and $3^{(3^3)}= 7.6255975e+12$.

• Indeed, you're right. – Wuestenfux Jul 23 '17 at 8:12