# 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 ;) –  lentic catachresis 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
@marlu Could you explain this some more please? It doesn't say why, or (for people like me who don't know much about maths), what that arrow even means. –  user673679 Jan 12 at 13:13
Well, associativity and commutativity are properties of maps $X\times X \to X$ for a set $X$. In other words, such a map takes two elements as an "input" and returns a single element. In my example, the set under consideration is the set of integers and the map sends each pair of integers $(x,y)$ to $xy+1$. Commutativity means $xy + 1 = yx + 1$ for all $x$ and $y$, which is satisfied. Associativity would mean $x(yz+1) + 1 = (xy+1)z+1$ for all $x$, $y$ and $z$, but it's easy to find examples where this equation does not hold, so the operation is not associative. –  marlu Jan 14 at 4:14
Short, sweet. Nice. –  AJFarmar Mar 20 at 20:55

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

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

-

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$.

-