Non-associative commutative binary operation [duplicate]

Is there an example of a non-associative, commutative binary operation?

What about a non-associative, commutative binary operation with identity and inverses?

The only example of a non-associative binary operation I have in mind is the commutator/Lie bracket. But it is not commutative!


Solution 1:

Here is an example with identity element and inverses. On $\mathbb{R}_{\geq 0}$, define $a*b = \left| a-b \right|$. Then $*$ is clearly commutative, $0$ is its identity and the inverse of any $a$ is itself. Yet, it is not associative, since for instance $2*(1*1) = 2$ while $(2*1)*1 = 0$.

Solution 2:

Consider the "rock-paper-scissors" operation $\ast$ on the set $\{R, P, S\}$ where we declare each element to be idempotent and declare the product of two distinct elements to be the winner according to the usual rules of Rock, Paper, Scissors: \begin{array}{r|ccc} \ast & R & P & S\\ \hline R & R & P & R\\ P & P & P & S\\ S & R & S & S . \end{array} The Cayley diagram is symmetric, so $\ast$ is commutative, but $$(R \ast P) \ast S = P \ast S = S \neq R = R \ast S = R \ast (P \ast S),$$ so $\ast$ is not associative.

Solution 3:

Consider $\Bbb R$ endowed with the commutative arithmetic mean operation $$a \oplus b := \frac{a + b}{2}.$$ It is not associative, as $$(a \oplus b) \oplus c = \frac{a + b + 2c}{4}$$ but $$a \oplus (b \oplus c) = \frac{2a + b + c}{4} .$$ (The operation $\oplus$ has no identity, and hence no inverse, but it defines a quasigroup structure on $\Bbb R$, which means that for any $a, b \in \Bbb R$ there is $z \in \Bbb R$ such that $a \oplus z = b$.)

In fact, this construction seems to work just as well if we replace $\Bbb R$ by any (unital) ring in which $2$ is invertible.

Solution 4:

The simplest example of a nonassociative commutative binary operation (but lacking an identity element) is the two-element structure $\{a,b\}$ with $aa=b$ and $ab=ba=bb=a;$ note that $a=bb=(aa)b\ne a(ab)=aa=b.$ This is the NAND (or NOR) operation of propositional logic, where $a=\text{true}$ and $b=\text{false}$ (or vice versa). See this answer or this one.

Solution 5:

Convolution of distributions is commutative, but not necessarily associative.

You have the identity $R*(S*T)=(R*S)*T$ in the case where at least two of these distributions are of compact support. If this condition is violated, there is a standard counterexample $$(1*\delta_0')*H = 1'*H=0*H=0,\quad 1*(\delta'_0*H)=1*H'=1*\delta_0=1.$$