# Does commutativity imply Associativity?

Does commutativity imply associativity? I'm asking this because I was trying to think of structures that are commutative but non-associative but couldn't come up with any. Are there any such examples?

NOTE: I wasn't sure how to tag this so feel free to retag it.

-
Commutative operations that are associative are the exception. But an important exception! Let $x\ast y=|x-y|$. –  André Nicolas Jun 20 '12 at 20:41
Not even in the presence of an identity element and an opposite, see this. In fact, William's answer is already in that post ;) –  Bruno Stonek Jun 20 '12 at 21:58
The interchange law $(x * y) \cdot (z * w) = (x \cdot z) * (y \cdot w)$, in the presence of a two-sided common unit element, implies commutativity and associativity of $*$ and $\cdot$. (In fact, they have to be the same operation!) –  Zhen Lin Jun 20 '12 at 22:14
See my 3 February 2009 sci.math post A natural example of a commutative, non-associative operator (see Google archive version or Math Forum archive version) for some examples and references. –  Dave L. Renfro Jun 22 '12 at 21:31

Consider the operation $(x,y) \mapsto xy+1$ on the integers.

-
Very nice example! –  Eugene Jun 20 '12 at 20:41

A basic example is the "midpoint" binary operation: $a*b = \frac{a+b}{2}$

In general, if $P(u,v)$ is any polynomial in two variables with rational coefficients, then $x*y = P(x+y,xy)$ is rarely associative - I'd be curious under what conditions on $P$ this operation would be associative.

My example is $P(u,v)=\frac{u}{2}$ and Marlu's example is $P(u,v)=1+v$.

-
In general, a symmetric function $P(x,y)$ is rarely associative. You could take $P(x,y)=\arctan xy+e^{(x+y)^9}$, too. –  Mariano Suárez-Alvarez Sep 14 '12 at 16:38

Let $A = \{e,x,y\}$. Define $\cdot$ on $A$ to be $a\cdot e=a$ for all $a$, $e\cdot a= a$ for all a, and $a\cdot b=e$ for all $a$ and $b$ such that $a\neq e$ and $b\neq e$, (i.e. $a,b \in \{x,y\}$).

This operation is commutative, $e$ is the identity, (everything even has an inverse), but is not associative since $(x \cdot y) \cdot y = e \cdot y = y$ and $x \cdot (y \cdot y) = x \cdot e = x$.

-

The easiest Jordan algebra is symmetric square matrices with the operation $$A \ast B = (AB + BA)/2,$$ similar to a Lie algebra but with a plus sign.

http://en.wikipedia.org/wiki/Jordan_algebra

-