4

Does there exist an operation that is commutative but not associative?

do you know what is operation?

user26857
  • 52,094
ghazale
  • 89
  • 8
    Aren't you looking for this?

    http://math.stackexchange.com/questions/160945/does-commutativity-imply-associativity

    – Kuba Nov 28 '15 at 13:08

3 Answers3

26

Take rock-paper-scissors, for example.

More precisely: $*\colon \{0,1,2\}\times\{0,1,2\} \to \{0,1,2\}$ given by multiplication table

$$\begin{array}{c | c c c} & 0 & 1 & 2\\ \hline 0 & 0 & 1 & 0\\ 1 & 1 & 1 & 2\\ 2 & 0 & 2 & 2 \end{array}$$

which is obviously commutative, but not associative: $$(0*1)*2 = 1*2 = 2$$ $$0*(1*2) = 0*2 = 0$$

Ennar
  • 23,082
  • 1
    The rock-paper scissors analogy would have been clearer if you had used something like r, p, and s, instead of 0, 1, and 2, but I guess some people might be confused by a function from {r, p, s}^2 to {r, p, s} and better understand functions using numbers. – Mr. Nichan Jun 06 '23 at 18:32
  • @H.H. I don't think it's very important, I used it just to motivate how one could come up with this multiplication table. Also, quite easy to memorize: "example of commutative, non-associative operation is rock-paper-scissors." Although I agree with you it would be more approachable to use letters if someone wanted to show this to kids in school. – Ennar Jun 07 '23 at 01:15
  • Actually, I never figured out in what way it is rock-paper-scissors. I would think the ties should all evaluate to the same number, for one thing. – Mr. Nichan Jun 07 '23 at 23:49
  • @H.H. if there are rock and rock, why should paper or scissors win, for example? If you choose extra number, you need to include it in the multiplication table and it's no longer rock-paper-scissors. Think of it like $0\leq 1 \leq 2 \leq 0$, without transitivity. – Ennar Jun 08 '23 at 10:01
  • I see. The "product" is which object wins, not which player wins. That makes the interpretations of 1, 2, and 3 consistent, so it really would work to replace them with 0=rock, 1=paper, 2=scissors (or one of the other 2 rotations of that). – Mr. Nichan Jun 08 '23 at 13:58
  • @H.H. yes. The fact that there are two players in the game makes it a binary operation. – Ennar Jun 08 '23 at 14:03
  • Actually evaluating algebraic expressions with it makes it more intuitive, since its basically like a tournament between people who always pick the same thing in rock-paper-scissors. – Mr. Nichan Jun 08 '23 at 16:00
7

Take for instance $f(x,y)=2x+2y$ on $\mathbb{N}$. Then $f(x,f(y,z))=2x+4y+4z$ and $f(f(x,y),z)=4x+4y+2z$.

Another example is $f(x,y)=2^{x +y}$ on $\mathbb{N}$. Then $f(x,f(y,z))=2^{x + 2^{y + z}}$ and $f(f(x,y),z) = 2^{2^{x + y} +z}$.

4

Take any Lie algebra over a field of characteristic $2$, where the Lie bracket is not associative (in particular, is not $2$-step nilpotent). Then $[x,y]=[y,x]$ for all $x,y$, but $[x,[y,z]]\neq [[x.y],z]$. An example is the $3$-dimensional simple Witt algebra over characteristic $2$, with basis $(x,y,h)$ and brackets $[x,y]=h,[h,x]=x$ and $[h,y]=y$. If you prefer $x\cdot y$ for the Lie bracket, then $x\cdot y=y\cdot x$ is the commutativity, and $(x\cdot y)\cdot z\neq x\cdot (y\cdot z)$ the non-associativity.

Dietrich Burde
  • 130,978